此 Python 脚本用于检查 Palo Alto Networks PAN-OS 管理 Web 界面中是否存在严重的身份验证绕过漏洞,该漏洞编号为 CVE-2024-0012。此漏洞可使未经身份验证的攻击者获取管理员权限、篡改配置或利用其他权限提升漏洞。
Zero Touch Provisioning 和 window.Pan)进行准确检测。-t 指定单个目标,或使用 -f 指定目标文件。-d 参数或在交互模式下通过用户提示显示存在漏洞目标的详细结果。-e 或 --explanation 打印关于 CVE-2024-0012 和 CVE-2024-9474 的详细、用户友好的描述。rich 库以清晰、易读的格式显示结果。requests 库,用于 HTTP 请求rich 库,用于样式化输出pip install -r requirements.txt
以交互方式检查单个目标:
python main.py
指定单个 FQDN 或 IP:
python main.py -t 127.0.0.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 (or -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 实现的基础。他们致力于识别和解决关键安全漏洞,持续为网络安全社区树立高标准。