πŸ› οΈ Quick Web File Transfer Method

Sometimes, you just need a quick and dirty way to transfer files from a compromised machine 🐚 to your attacker box (Pwnbox) β€” and lucky for us, Linux makes it easy thanks to built-in tools like Python, PHP, or Ruby! 🎯


πŸπŸ“‘ 1. Python file http.server

If Python is installed (which it usually is), spin up a web server with a one-liner!

Python 3:

z3tssu@htb[/htb]$ python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...

Python 2.7 (Legacy Style):

z3tssu@htb[/htb]$ python2.7 -m SimpleHTTPServer

πŸ§™β€β™‚οΈ PHP file hosting Server ✨

If PHP is installed:

z3tssu@htb[/htb]$ php -S 0.0.0.0:8000
PHP Development Server started at http://0.0.0.0:8000

πŸ’Ž Ruby file hosting Server πŸ’»

If Ruby is available, this works too:

πŸͺ„ Output:


πŸ“₯ 2. Download the File on Pwnbox

Once the target machine (compromised linux) is serving the file, hop onto your Pwnbox (attacker machine) and download it:

πŸ’Ύ You’ll see:


πŸ“Œ Pro Tip ⚠️

These are download-only methods! You’re pulling files from the target to your machine, not uploading. Also, don’t forget: πŸ”’ Some environments may block inbound traffic (like firewall rules), so check connectivity!


Want me to bundle these notes with the previous ones or turn them into printable flashcards? 🎴

Last updated