Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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
CVE-2025-4255---Buffer-Overflow — Exploit framework targeting CVE-2025-4255, a buffer overflow vulnerability, providing a structured environment for developing and testing exploits. | Kitploit
Tools/GitHubGitHub/tenor-z/cve-2025-4255---buffer-overflow
Vulnerability AnalysisExploitationBinary Exploitation
GitHubtenor-z/cve-2025-4255---buffer-overflow

CVE-2025-4255---Buffer-Overflow

Exploit framework targeting CVE-2025-4255, a buffer overflow vulnerability, providing a structured environment for developing and testing exploits.

View Repository
1019 days agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

PCMan FTP Server 2.0.7 - Stack-Based Buffer Overflow

A comprehensive proof-of-concept exploit tool suite, and cross-platform analysis targeting PCMan FTP Server v2.0.7 [CVE-2025-4255].

This repository documents the progress and efforts required to discover a protocol crash, calculate raw memory alignment boundaries, and execute controlled instruction redirection natively on Windows XP, alongside local Denial of Service (DoS) constraints on Windows 2000, and defensive containment mitigation barriers on Windows 11.


📂 Repository Blueprint

The repository is structurally decoupled into individual scripts mapping to each specific phase of the exploit development lifecycle:

  • patterngen.py – Dynamically constructs a 2400-byte unique, non-repeating cyclic sequence (Aa0Aa1...) and outputs it to a file pattern.txt.
  • fuzzer.py – The main fuzzer used. Pulls data from pattern.txt to safely trigger a protocol buffer overflow inside a target debugger environment.
  • calculateoffset.py – Reads pattern.txt directly to analyze captured register values and locate the exact overflow ceiling.
  • exploit.py – The actual constructed exploit, featuring custom payload delivery arrays for target environments.

  • 🧠 Architectural Overview & Root Cause

    The buffer overflow vulnerability resides within the handling logic of the RMD (Remove Directory) FTP command string parser. The application implements an unsafe, unbounded string copying mechanism (such as strcpy) when loading a directory path argument into memory. Because the application fails to validate the size of user input before moving it into a pre-defined stack buffer space, an oversized parameter induces a classic Stack-Based Buffer Overflow (CWE-121).

    Data systematically cascades past the destination buffer frame, blowing through local storage, overwriting the Saved Frame Pointer (EBP), and completely filling the Extended Instruction Pointer (EIP). By seizing EIP, a remote attacker can dictate the target CPU's exact execution vector.


    🔬 Vulnerability Lifecycle Execution

    1. Protocol Isolation (Fuzzing)

    Initial fuzzing scripts isolated a predictable application collapse on the RMD parameter when the string input payload size scaled between 2100 and 2300 bytes.

    2. Stack Geometry Mapping

    To isolate the precise character edge controlling the execution path, patterngen.py was used to inject a unique sequence. Inside the x32dbg environment, the application crashed with a precise register state:

    • Captured EIP: 7043396F

    Accounting for 32-bit x86 Little-Endian architecture, reversing the hex bytes yields 6F 39 43 70, which maps directly to the ASCII text string o9Cp. Running findoffset.py against the tracking file pinpointed the precise layout boundary configuration:

    [\text{Exact Buffer Offset} = \mathbf{2008 \text{ bytes}}]

    root@kitploit:~
    [      2008 Bytes of Padding (A)      ] [  4-Byte JMP ESP  ] [  NOP Sled  ] [  Shellcode Payload  ]
                                                 ^
                                                 |-- Overwrites EIP cleanly at byte 2009
    

    For a more comprehensive analysis, please read the DISCOVERY.MD file

    3. Execution Redirection & Bad Characters

    FTP network socket managers interpret specific bytes as protocol operations. To prevent premature string truncation mid-transmission, the following Bad Characters were completely scrubbed from all custom instruction arrays:

    • \x00 (Null Byte / String Terminator)
    • \x0a (Line Feed / New Line)
    • \x0d (Carriage Return)

    To pivot across shifting stack spaces, code redirection relies on a static JMP ESP address (0x74e32fd9). When the vulnerable function hits its return phase, EIP reads the jump address, bounces execution straight into the Stack Pointer (ESP) segment, glides down a minor stabilizing NOP sled (\x90 * 20), and runs the payload cleanly.


    🗺️ OS Architecture Differential Analysis

    Vulnerability payload stability is heavily dictated by operating system memory management layers. This script framework was systematically evaluated across three distinct computing eras:

    💻 Windows XP (SP1 / SP2 / SP3)

    • Operational Outcome: Verified Remote Code Execution (RCE)
    • Analysis: Complete success. Due to a total lack of mandatory memory mitigations (ASLR/DEP) for unmanaged legacy binaries, the application safely navigates the code-redirection path natively outside of a debugger context, granting a stable reverse command terminal shell connection.

    💻 Windows 2000

    • Operational Outcome: Remote Denial of Service (DoS)
    • Analysis: The script successfully forces an access violation, corrupts the stack frame data, and crashes the process. However, modern msfvenom payload structures encounter strict API layout desynchronization against legacy Winsock (ws2_32.dll) sub-layers, causing the execution thread context to collapse before initializing an outbound socket channel back to the listener.

    💻 Windows 11

    • Operational Outcome: Mitigated Safe Exception
    • Analysis: While the exploit redirects execution cleanly inside an attached x32dbg harness due to debugger hook overrides, running natively triggers hardened OS defenses. Modern kernel wrappers (SEHOP and hardware-enforced DEP/NX) actively intercept execution inside data-flagged stack sectors, killing the process instantly to neutralize the memory corruption attempt.

    📚 Core Glossary & Concepts

    • EIP (Extended Instruction Pointer): The instruction register holding the memory coordinates of the very next assembly step the CPU will process.
    • ASLR (Address Space Layout Randomization): Shuffles library base locations upon boot, preventing exploitation vectors unless a static non-ASLR module (like blowfish.dll) can be targeted.
    • DEP / NX (Data Execution Prevention): Hardware enforcement flagging stack pages as non-executable to prevent malicious instruction triggers inside data blocks.
    • SEHOP (Structured Exception Handler Overwrite Protection): Guard rails checking exception loop pointer health to block exploitation paths if stack memory frames are structurally mangled.

    🛡️ Secure Coding Remediation (The Big Fix)

    To resolve the root vulnerability completely, software developers must switch from unverified memory copies to secure, bounded alternatives that strictly validate target container boundaries:

    root@kitploit:~
    // ❌ WHAT NOT TO DO - Unbounded string copy
    void handle_rmd_command(char *user_input) {
        char directory_buffer[2000];
        strcpy(directory_buffer, user_input); // Copies data blindly until a null byte, spilling over the stack
    }
    
    // ✅ SECURE CODE - Bounded string copy
    void handle_rmd_command(char *user_input) {
        char directory_buffer[2000];
        // Restricts copying properties to the maximum capacity of the destination array
        // It ensures data copied does not exceed the pre-allocated buffer
        strncpy(directory_buffer, user_input, sizeof(directory_buffer) - 1);
        directory_buffer[1999] = '\x00'; // Guarantees explicit null-termination
    }
    

    ⚠️ Disclaimer

    This repository is established strictly for educational validation, academic research, and defensive threat modeling. Running exploit code against unauthorized environments without explicit permission is strictly illegal.

    Download Tool