FTP Credential Exploitation
Valid FTP credentials give authenticated access to the FTP file tree. The scope of access depends on the account's chroot configuration and filesystem permissions. From here the goal is to extract sensitive files, identify credential material that pivots to other services, and determine whether FTP write access leads to further impact.
Connect with Valid Credentials
Enter $USER and $PASSWORD at the prompts. A 230 Login successful response confirms access.
With curl for non-interactive access:
Map the Directory Tree
List the full accessible tree from the root:
Recursively list all subdirectories in an interactive session:
ls -la cd / ls -la
Some FTP servers chroot authenticated users to their home directory. Attempting cd / and observing whether the listing changes confirms whether chroot is in effect.
Download Files of Interest
Download a single file:
Download everything recursively with wget:
With lftp for parallel and resumable transfers:
Inside lftp:
Search Downloaded Content for Credentials
SSH private keys, database connection strings, application config files, and .env files are the highest value finds. Credentials recovered here are tested for reuse against SSH, SMB, and any other services on the target.
Test Upload Access
Even with standard credentials, the account may have write access to specific paths:
If upload succeeds and the path is web-accessible, pivot to FTP Web Shell Upload.
Navigate Outside the Chroot
If the server is not properly chrooted, path traversal via the FTP session may reach OS-level files:
cd / cd /etc get passwd
If /etc/passwd downloads successfully, the FTP daemon is running without chroot and the authenticated user can access the full filesystem with whatever OS-level permissions the FTP process holds.
Credential Reuse Against Other Services
FTP credentials are frequently reused across SSH, web application logins, and database accounts. Test the recovered credentials immediately:
References
-
lftp Manuallftp.yar.ru/lftp-man.html (opens in new tab)
Mirror command, parallel transfer, and authenticated FTP usage reference
-
Pennyw0rth/NetExecgithub.com/Pennyw0rth/NetExec (opens in new tab)
nxc for credential reuse testing across SSH, SMB, and other services
Was this helpful?
Your feedback helps improve this page.