FTP Anonymous Login Exploitation
Anonymous FTP access confirmed by FTP Anonymous Access Check gives unauthenticated read or write access to the FTP file tree. The impact depends on what is stored there and whether writable paths overlap with a web server root.
- Recursive download mirror the entire FTP root with wget or lftp for offline credential and config searches.
- Credential hunting grep downloaded content for passwords, API keys, SSH private keys, and .env files.
- Write access exploitation upload a PHP or ASPX web shell if writable paths overlap with the web server root.
- Reverse shell trigger the uploaded shell over HTTP and catch the connection with netcat.
Connect Anonymously
Username: anonymous Password: any string or blank
Download All Files Recursively
Use wget to mirror the entire FTP root in one command:
-r enables recursive download. --no-passive forces active mode, which works better on some targets. The downloaded content lands in a directory named after the target IP.
With curl for a single file:
What to Look For in Downloaded Files
After pulling everything down, search for credential material:
Configuration files, credential files, SSH private keys, and database connection strings in the FTP root are all immediately useful for lateral movement or privilege escalation.
Upload a File
If write access is confirmed:
put /tmp/payload.txt
Web Shell Upload via Anonymous FTP
If the writable directory is also served by a web server, upload a PHP web shell and trigger it over HTTP:
Confirm the shell is accessible:
Expected output: uid=33(www-data) gid=33(www-data)
If execution is confirmed, upgrade to a reverse shell. Start your listener:
Trigger the reverse shell:
The full web shell upload workflow is covered in FTP Web Shell Upload.
Using lftp for Faster Transfers
lftp handles anonymous FTP and supports mirror operations more reliably than wget on some targets:
Inside lftp:
This downloads the entire FTP tree to /tmp/ftp_loot/ using five parallel connections.
References
-
Full reference for lftp commands including mirror, parallel transfers, and anonymous access