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
CVE-2023-25136-PoC — Minimal Docker-based reproduction environment for OpenSSH 9.1p1 pre-auth double-free vulnerability (CVE-2023-25136), demonstrating memory corruption and denial-of-service via a Python PoC client. | Kitploit
Tools/GitHubGitHub/lane0218/cve-2023-25136-poc
Vulnerability AnalysisExploitationPenetration TestingLearning & EducationBinary Exploitation
GitHublane0218/cve-2023-25136-poc

CVE-2023-25136-PoC

Minimal Docker-based reproduction environment for OpenSSH 9.1p1 pre-auth double-free vulnerability (CVE-2023-25136), demonstrating memory corruption and denial-of-service via a Python PoC client.

View Repository
9 months 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

CVE-2023-25136 Vulnerability Reproduction

This project provides a minimal local experimental environment for reproducing the OpenSSH 9.1p1 pre-authentication double free memory corruption vulnerability (CVE-2023-25136) and observing the server process crash (DoS) effect.

Note: Official and mainstream analyses generally consider this vulnerability "difficult to actually exploit for remote code execution" under default security configurations. This environment is primarily used to demonstrate memory errors and denial-of-service effects.

Environment Description

  • Target:

    • OpenSSH 9.1p1 server running in a Docker container
    • Privilege separation user sshd configured
    • To facilitate observation of the double free crash, built with --with-sandbox=no to disable the seccomp sandbox
    • Listens on port 22 inside the container, mapped to port 2222 on the host (WSL)
  • Attacker:

    • Same host / WSL as the target
    • Uses Python3 + paramiko to run the PoC, crafting a specific SSH client identifier and initiating a pre-authentication handshake

Directory structure:

  • Dockerfile: Builds an image with the OpenSSH 9.1p1 vulnerable environment
  • poc.py: Minimal PoC client for triggering the pre-authentication double free

Prerequisites

Before performing the following operations in this directory, ensure:

  • Docker is installed (under WSL2, it is recommended to use Docker Desktop or install Docker directly in WSL)
  • Python 3 and pip are installed

1. Target Setup (OpenSSH 9.1p1 in Docker)

  1. Build the image

Execute in this directory:

root@kitploit:~
docker build -t sshd-9.1p1-vuln .
  1. Start the container
root@kitploit:~
docker run --rm -d --name sshd-vuln -p 2222:22 sshd-9.1p1-vuln

Explanation:

  • --rm: Automatically remove the container when it exits
  • --name sshd-vuln: Container name
  • -p 2222:22: Maps port 22 in the container to port 2222 on the host
  1. Verify sshd is running
root@kitploit:~
docker ps

You should see output similar to:

root@kitploit:~
CONTAINER ID   IMAGE              COMMAND               STATUS          PORTS
xxxxxx         sshd-9.1p1-vuln    "/usr/sbin/sshd -D…"  Up ...          0.0.0.0:2222->22/tcp

2. Attacker PoC Usage

2.1 Install PoC Dependencies

Execute in this directory:

root@kitploit:~
pip install paramiko

2.2 PoC Script Description (poc.py)

poc.py uses paramiko.Transport to actively establish a connection with the target SSH server, faking a client identifier during the pre-authentication phase in an attempt to trigger a double free.

Key features:

  • Default target: 127.0.0.1:2222 (the local Docker container)
  • Default client identifier: SSH-2.0-PuTTY_Release_0.64
  • Provides simple command-line arguments:
    • -t/--target: Target IP (default 127.0.0.1)
    • -p/--port: Target port (default 2222)
    • -c/--client-id: Fake SSH client identifier
    • --timeout: Timeout in seconds
    • -v/--verbose: Print detailed error information

2.3 Run the PoC

With the container sshd-vuln running, execute in this directory:

root@kitploit:~
python3 poc.py

Or explicitly specify parameters:

root@kitploit:~
python3 poc.py -t 127.0.0.1 -p 2222 -v

Expected client output example:

root@kitploit:~
==============================================
   CVE-2023-25136 OpenSSH Pre-Auth Double Free
              Minimal PoC Client
==============================================
[2024-xx-xx xx:xx:xx] Target: 127.0.0.1:2222, ClientID: SSH-2.0-PuTTY_Release_0.64
[+] Sending crafted pre-auth handshake...
[-] Authentication failed or connection closed early.
    Check the server sshd logs for 'free(): double free detected' or similar messages to confirm whether CVE-2023-25136 was triggered.

Explanation:

  • The client reporting Authentication failed or connection closed here is expected, because the server's pre-authentication child process may crash or actively close the connection during processing.

3. Expected Results and Verification

3.1 Server (Container) Logs

After running the PoC, view the container logs on the host:

root@kitploit:~
docker logs sshd-vuln

Expected output similar to:

root@kitploit:~
Server listening on 0.0.0.0 port 22.
Server listening on :: port 22.
Invalid user  from 172.17.0.1 port xxxxx
free(): double free detected in tcache 2

Where:

  • Invalid user: Because the PoC uses an empty username, OpenSSH logs an invalid user attempt
  • free(): double free detected in tcache 2: glibc detects a double free and terminates the current sshd child process. This is the memory corruption/DoS phenomenon we aim to observe.

Note: To be able to see this line, we built OpenSSH with seccomp sandbox disabled (--with-sandbox=no); otherwise, the sandbox might intercept the anomalous behavior and terminate the child process before the double free occurs.

3.2 Nature of the Effect

  • In this experimental environment, the PoC can reliably trigger a crash (DoS) of the pre-authentication child process, causing the current SSH connection to fail. The main sshd process will continue to fork new child processes for subsequent connections.
  • Since the pre-authentication child process runs in a low-privilege + chroot environment with multiple security mechanisms by default, researchers generally consider it extremely difficult to achieve remote code execution solely through this double free vulnerability.
Download Tool