Port 21 – FTP (File Transfer Protocol)

Service:

vsftpd ,
proftpd ,
pure-ftpd

Protocol:

TCP

Port:

21

Used for:

Unencrypted file transfer between client and server

Why It’s Open

FTP is one of the oldest methods for transferring files over a network. You’ll often find it in legacy systems, embedded devices, or setups that require batch file uploads or remote file access.

Common Risks

  • Cleartext Authentication: Usernames and passwords are transmitted in plaintext.
  • Anonymous Access: Misconfigured FTP servers may allow login without credentials.
  • Directory Traversal: Attackers may access restricted directories using ../.
  • Brute Force & Default Credentials: Common targets for automated tools.

Want to save time on reporting?

Let PentestPad generate, track, and export your reports - automatically.

logo-cta

Enumeration & Testing

Check if it’s open

Terminal window
nmap -sV -p 21
nmap -p 21 --script=ftp-anon

Connect manually

Terminal window
ftp

Anonymous login test

Terminal window
ftp
Name: anonymous
Password:

What to Look For

CheckpointWhat it means
Anonymous login enabledPublic access, often a misconfiguration
Banner shows old versionMay be vulnerable to known exploits
FTP root accessCan lead to full system compromise

Known Exploits

  1. CVE-2015-3306

The mod_copy module in ProFTPD 1.3.5 allows remote attackers to read and write to arbitrary files via the SITE CPFR and SITE CPTO commands, leading to potential remote code execution.

🔗 NVD Entry

🔗 Exploit-DB Entry

Mitigation

  • Disable anonymous login.
  • Use FTPS or switch to SFTP instead.
  • Restrict access via firewall.
  • Limit users to specific chroot jails.
  • Disable write permissions where not needed.

Real-World Example

Publicly exposed FTP servers allowing anonymous access have led to major leaks of personal and financial data in the past. Tools like Shodan still show thousands of such servers online today.

TL;DR

  • Service: FTP (File Transfer Protocol)
  • Default Port: 21/TCP
  • Risks: Unauthorized file access, data leakage
  • Mitigation: Apply patches, disable anonymous access, use secure alternatives