Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-40684 PoC — Fortinet FortiOS 授权问题漏洞

Source
Associated Vulnerability
Title:Fortinet FortiOS 授权问题漏洞 (CVE-2022-40684)
Description:Fortinet FortiOS是美国飞塔(Fortinet)公司的一套专用于FortiGate网络安全平台上的安全操作系统。该系统为用户提供防火墙、防病毒、IPSec/SSLVPN、Web内容过滤和反垃圾邮件等多种安全功能。 Fortinet FortiOS存在授权问题漏洞。目前尚无此漏洞的相关信息,请随时关注CNNVD或厂商公告。
Description
Fortinet Critical Authentication Bypass Vulnerability (CVE-2022-40684) [ Mass Exploit ]
Readme
# CVE-2022-40684 (CVSS score: 9.6)
POC for CVE-2022-40684 affecting Fortinet FortiOS, FortiProxy, and FortiSwitchManager appliances.

## Vulnerable Products

-   FortiOS versions between 7.0.0 – 7.0.6 and 7.2.0 – 7.2.1
- FortiProxy versions between 7.0.0 – 7.0.6 and version 7.2.0
- FortiSwitchManager versions 7.0.0 and 7.2.0

## Resource

https://socradar.io/what-do-you-need-to-know-about-fortinet-critical-authentication-bypass-vulnerability-cve-2022-40684/

## Summary
This POC abuses the authentication bypass vulnerability to set an SSH key for the specified user.

## Usage
```plaintext
root@kali:~# python exploit.py -h
 
     ______           __  _            __     ____  ____________
    / ____/___  _____/ /_(_)___  ___  / /_   / __ \/ ____/ ____/
   / /_  / __ \/ ___/ __/ / __ \/ _ \/ __/  / /_/ / /   / __/   
  / __/ / /_/ / /  / /_/ / / / /  __/ /_   / _, _/ /___/ /___   
 /_/    \____/_/   \__/_/_/ /_/\___/\__/  /_/ |_|\____/_____/ 


    CVE-2022-40684 Exploit By Valentin Lobstein (Chocapikk)


usage: exploit.py [-h] [-k KEY] [-u URL] [-l LIST] [-U USERNAME] [-t THREADS] [-o OUTPUT]

options:
  -h, --help            show this help message and exit
  -k KEY, --key KEY     Your SSH pubKey id_rsa.pub
  -u URL, --url URL     Base target uri (ex. http://target-uri/)
  -l LIST, --list LIST  List of targets (list.txt)
  -U USERNAME, --username USERNAME
                        Username
  -t THREADS, --threads THREADS
                        Threads
  -o OUTPUT, --output OUTPUT
                        Output file
```

## Zoomeye Dork

```plaintext

title:"FortiGate"

```


## Mitigations
Update to the latest version or mitigate by following the instructions within the Fortinet PSIRT
* https://www.fortiguard.com/psirt/FG-IR-22-377


## Disclaimer
This software has been created purely for the purposes of academic research and for the development of effective defensive techniques, and is not intended to be used to attack systems except where explicitly authorized. Project maintainers are not responsible or liable for misuse of the software. Use responsibly.
File Snapshot

[4.0K] /data/pocs/9a61f4a0900fc70ba2e531935fb743523c258fba ├── [3.4K] cve-2022-40684.nse ├── [5.9K] exploit.py ├── [ 289] parser_zoomeye.py ├── [2.0K] README.md └── [ 46] requirements.txt 0 directories, 5 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.