Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
fgt-cve-2023-27997-exploit — FortiGate SSL-VPN CVE-2023-27997 Exploit PoC Script with ROP Chain | Kitploit
Tools/GitHubGitHub/onurkerembozkurt/fgt-cve-2023-27997-exploit
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingRed TeamingBinary Exploitation
GitHubonurkerembozkurt/fgt-cve-2023-27997-exploit

fgt-cve-2023-27997-exploit

FortiGate SSL-VPN CVE-2023-27997 Exploit PoC Script with ROP Chain

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
View Repository
11 year agoNot yet reviewed

fgt-cve-2023-27997-exploit

FortiGate SSL‑VPN CVE‑2023‑27997 Exploit PoC Script with ROP Chain

CVE Score Python


Table of Contents

  • Description
  • Affected Versions
  • Installation
  • Usage
  • Example Output
  • Technical Details
  • Warnings
  • References

Description

fgt-cve-2023-27997-exploit.py is a Proof‑of‑Concept (PoC) exploit script written for the critical vulnerability CVE‑2023‑27997 discovered in Fortinet FortiGate devices.
The vulnerability stems from a heap-based buffer overflow that allows remote code execution (RCE) without authentication on the FortiOS SSL‑VPN interface.

Script workflow:

  1. Retrieves the salt value from the target device.
  2. Generates a custom ROP (Return‑Oriented Programming) chain.
  3. Sends a manipulated GET request to the /remote/hostcheck_validate endpoint, triggering a memory overflow.
  4. After the overflow, the prepared ROP chain is executed to run remote commands.

Warning: This script should only be used in authorized testing or laboratory environments.


Affected Versions

ProductVersions
FortiOS7.2.0 – 7.2.5
7.0.0 – 7.0.11
6.4.0 – 6.4.12
6.2.0 – 6.2.14
6.0.0 – 6.0.16
FortiProxyRelevant versions

Installation

  1. Set up a Python 3.7+ environment.
  2. Install the required dependencies:
root@kitploit:~
pip3 install -r requirements.txt

requirements.txt content:

root@kitploit:~
requests
urllib3

Usage

root@kitploit:~
python3 fgt-cve-2023-27997-exploit.py <TARGET_IP> <TARGET_PORT>

Example:

root@kitploit:~
python3 fgt-cve-2023-27997-exploit.py 192.168.1.200 10443
ArgumentDescription
<TARGET_IP>Target FortiGate IP address
<TARGET_PORT>SSL‑VPN port (default: 443 or 10443)

Example Output

root@kitploit:~
[*] Launching FortiOS 7.0.5 CVE-2023-27997 ROP Chain Ping Exploit...
[+] Salt retrieved: 749a2b77
[+] Enc parameter generated (1024 characters)
[!] 500 Internal Server Error - Possible memory overflow or crash!

Technical Details

Click to view

Vulnerability Flow

root@kitploit:~
/remote/info   --> salt value retrieved
/remote/hostcheck_validate?enc=<payload> --> buffer overflow triggered
  • The enc parameter is encrypted with a XOR keystream generated from the combination of salt + seed.
  • A flaw in the length check makes the overflow possible.
  • After the overflow, the ROP Chain is activated.

ROP Chain


Warnings

  • The script should only be run in authorized environments.
  • Unauthorized use is illegal and the target device can crash.
  • FortiOS 7.0.5 versions use TLS 1.0; the script includes the appropriate TLS setting.

References

  • Lexfo Security Blog – XORtigate: CVE‑2023‑27997
  • Bishop Fox – Building an Exploit for CVE‑2023‑27997
  • Fortinet PSIRT Advisory FG‑IR‑23‑097

Download Tool
StepGadgetDescription
1pop rdi ; retCommand address loaded into RDI
2system@pltCommand executed
–0xdeadbeefdeadbeefPlaceholder; actual address must be determined in lab environment

Heap Spray

This PoC is designed to work without requiring heap grooming in a controlled test environment.