
PANW NGFW CVE-2024-0012
このPythonスクリプトは、Palo Alto Networks PAN-OSの管理Webインターフェースにおける重大な認証バイパス脆弱性(CVE-2024-0012として識別)の有無をチェックします。この脆弱性により、未認証の攻撃者が管理者権限を取得し、設定を改ざんしたり、他の権限昇格脆弱性を悪用したりすることが可能になります。
Zero Touch Provisioningやwindow.PanなどのPalo Alto固有のコンテキストマーカーを使用します。-tで単一のターゲット、-fでターゲットのファイルを指定します。-d引数またはインタラクティブモードでのユーザープロンプトにより、脆弱なターゲットの詳細結果を表示します。-eまたは--explanationを使用して、CVE-2024-0012およびCVE-2024-9474の詳細でユーザーフレンドリーな説明を表示します。richライブラリを使用して、結果をクリーンで人間が読みやすい形式で表示します。requestsライブラリrichライブラリpip install -r requirements.txt
単一のターゲットをインタラクティブにチェックするには:
python main.py
単一のFQDNまたはIPを指定:
python main.py -t 127.0.0.1
ターゲットのリスト(1行に1つ)を含むファイルを指定:
python main.py -f targets.txt
-dまたは--detailsフラグを使用すると、脆弱なターゲットすべての詳細結果を自動的に表示します:
python main.py -t 127.0.0.1 -d
-eまたは--explanationフラグを使用して、CVE-2024-0012およびCVE-2024-9474脆弱性の詳細な説明を表示します:
python main.py -t 127.0.0.1 -d -e (または -de)
[!] Target -appears- vulnerable!
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Key ┃ Value ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
┃ URL ┃ https://127.0.0.1/php/ztp_gate.php/.js.map ┃
┃ Status Code ┃ 200 ┃
┃ Headers ┃ {"Date": "Wed, 20 Nov 2024 15:29:31 GMT", ... ┃
┃ Markers Found ┃ ...<title>Zero Touch Provisioning</title>... ┃
┃ ┃ ...window.Pan = window.Pan || {};... ┃
└─────────────────────────────┴──────────────────────────────────────────────────────────┘
[+] Target does not appear to be vulnerable.
Message: No matching conditions met.
スキャンの最後に、すべてのターゲットとそのステータスをリストしたサマリーテーブルが表示されます:
┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ Target ┃ Status ┃
┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
┃ 127.0.0.1 ┃ Vulnerable ┃
┃ example.com ┃ Not Vulnerable ┃
└───────────────────────┴─────────────────┘
-eまたは--explanationフラグが使用された場合:
CVE-2024-0012 Explained
CVE-2024-0012 is an authentication bypass vulnerability. This means attackers can skip the login process and access sensitive parts of a system without needing a username or password. In Palo Alto Networks’ PAN-OS, this vulnerability allows attackers to trick the system by sending specially crafted HTTP GET requests. These requests include a header called `X-PAN-AUTHCHECK`, which tells the system whether or not authentication is required. If this header is set to `off`, the system mistakenly grants access to restricted areas without checking if the person is logged in.
This vulnerability can be exploited together with CVE-2024-9474, a privilege escalation vulnerability, to gain full root access to the device. Once attackers achieve root access, they can control the firewall, steal sensitive data, or disable security features.
If this vulnerability is confirmed, patch the affected system as soon as possible to prevent exploitation. Additionally, restrict access to the management interface by IP whitelisting or using a dedicated management network.
[bold red]Error:[/bold red] HTTPSConnectionPool(host='127.0.0.1', port=443): Max retries exceeded with URL: /php/ztp_gate.php/.js.map (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x...>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
--targetまたは--file引数が指定されない場合、スクリプトはインタラクティブ入力を促します。-eフラグは、より多くのコンテキストを必要とするユーザー向けに脆弱性の教育的な概要を提供します。このスクリプトはMITライセンスの下でリリースされています。詳細についてはLICENSEファイルを参照してください。
このスクリプトは「現状のまま」提供され、いかなる種類の保証もありません。自己責任で使用してください。作者はこのツールの使用によって生じたいかなる損害についても責任を負いません。
このスクリプトは、watchTowrチームの素晴らしい研究に触発されました。彼らのCVE-2024-0012に対するオリジナルのNuclei YAMLテンプレートが、このPython実装の基礎となりました。重大なセキュリティ脆弱性を特定し対処する彼らの献身的な取り組みは、サイバーセキュリティコミュニティにおいて高い基準を設定し続けています。