🌐 FTP Downloads


🌐 FTP Downloads β€” Old-School but Still Useful!

FTP (File Transfer Protocol) runs on TCP ports 21 & 20 and is another handy method for moving files around a network. 🎯

You can use:

  • πŸ“¦ The built-in Windows FTP client

  • πŸ’» PowerShell’s Net.WebClient class


🐍 Step 1: Set Up Your Own FTP Server (Pwnbox Side)

Use Python3 and the module pyftpdlib to quickly spin up an FTP server:

sudo pip3 install pyftpdlib

Then launch the server on port 21 (default is 2121):

sudo python3 -m pyftpdlib --port 21

βœ… This will allow anonymous logins by default (no username or password required).


πŸͺ„ Step 2: Download Files Using PowerShell

Here’s a simple one-liner to pull a file from your FTP server:

πŸ“ This saves file.txt from the FTP server into the Public directory.


🧰 Bonus: Using FTP with a Script (Non-Interactive Shell)

If you're working with a limited shell (interactive shell), here's how to automate FTP with a command file:

πŸ’‘ This runs all the FTP steps automatically.

Example output:

Then check your file with:

πŸ“„ Output:


🚨 Quick Tips

  • πŸ›‘οΈ FTP is unencrypted! Avoid using it on sensitive or public networks.

  • πŸ”’ If needed, add authentication to your server.

  • πŸ’Ύ binary mode ensures file integrity when transferring non-text files.

Last updated