
A comprehensive all-in-one Python-based Proof of Concept script to discover and exploit a critical authentication bypass vulnerability (CVE-2024-55591) in certain Fortinet devices.
A comprehensive all-in-one Python-based Proof of Concept script to discover and exploit a critical authentication bypass vulnerability (CVE-2024-55591) in certain Fortinet devices. This script:
nmapCVE-2024-55591 is a critical authentication bypass in certain Fortinet products (FortiOS & FortiProxy). By exploiting a flaw in the WebSocket/Telnet management interface, an attacker can gain privileged CLI access without valid credentials.
According to the Fortinet PSIRT Advisory (FG-IR-24-535), the following versions are known to be affected:
git clone https://github.com/exfil0/CVE-2024-55591-POC.git
cd CVE-2024-55591-POC
python3 attack.py
When executed, the script automatically checks for missing Python dependencies (requests, urllib3) and attempts to install them.
You will be prompted for:
Once you confirm, the script tests connectivity, checks vulnerability, upgrades the connection to WebSocket, and attempts the auth bypass.
At startup, this script checks for requests and urllib3. If missing, it attempts to install them via pip.
If you choose, the script runs nmap -sS -p- --min-rate 500 <host> to discover open TCP ports, then either:
If multiple ports are discovered open, you can instruct the script to test them all. This is useful if Fortinet services are listening on non-standard ports.
If the exploit succeeds, you can optionally run additional commands in the same Telnet session, such as:
diag sys topdiag debug crashlog readexecute shellYou can modify these post-exploitation commands in the script to gather more advanced data.
The script attempts to parse the device version from the output of get system status or get system info. If it matches a known vulnerable range, it notifies you.
192.168.1.50y (Yes) to discover open portsy if connecting via HTTPS/443get system statusy or nIf Nmap finds multiple open ports, you can choose to test all ports automatically or pick a specific one.
/login?redir=/ng returns Fortinet’s management interfaceservice-worker.js?local_access_token=ScaryBYte contains the substring api/v2/staticget system statusIf post-exploit mode is enabled, the script sends additional debug or system commands. The output is collected and displayed in your console.
This Proof of Concept script is provided for educational and testing purposes only. Unauthorized exploitation of systems without explicit permission is illegal. Always ensure you have the appropriate approvals before scanning or testing any systems, and refer to Fortinet’s Advisory (FG-IR-24-535) for patch information.