
Python script to detect CVE-2026-24061 telnetd vulnerability via NEW-ENVIRON injection, providing risk assessment and mitigation guidance.
A Python security testing tool to detect vulnerability to environment variable injection in telnetd servers via the NEW-ENVIRON telnet option.
This script tests telnetd servers for CVE-2026-24061, a vulnerability that allows attackers to inject environment variables through the NEW-ENVIRON telnet option. If a server improperly handles these environment variables, it may be vulnerable to command injection or authentication bypass attacks.
The script provides detailed, color-coded output with step-by-step progress, comprehensive error handling, and a final summary that includes the test result, risk assessment, and impact analysis.
CVE-2026-24061 is a security vulnerability in telnetd servers that improperly handle environment variables sent via the NEW-ENVIRON telnet option (RFC 1572).
The vulnerability occurs when telnetd servers:
The NEW-ENVIRON option (RFC 1572) allows telnet clients to send environment variables to the server. A vulnerable server may accept and process these variables without sanitization, potentially allowing an attacker to inject malicious values that could lead to command execution or authentication bypass.
No installation required. The script is standalone and uses only Python standard library modules.
Linux (Ubuntu/Debian):
sudo apt-get update
sudo apt-get install python3
macOS (using Homebrew):
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python 3
brew install python3
# Verify installation
python3 --version
Windows:
python --version
Or using PowerShell:
python --version
Linux/macOS:
./telnetd_CVE‑2026‑24061_test.py <host> [port]
Windows (Command Prompt):
python telnetd_CVE‑2026‑24061_test.py <host> [port]
Windows (PowerShell):
python telnetd_CVE‑2026‑24061_test.py <host> [port]
Linux/macOS:
# Test default telnet port (23)
./telnetd_CVE‑2026‑24061_test.py 10.0.2.134
# Test custom port
./telnetd_CVE‑2026‑24061_test.py 10.0.2.134 2323
# Make script executable (if needed)
chmod +x telnetd_CVE‑2026‑24061_test.py
# Or run directly with python3
python3 telnetd_CVE‑2026‑24061_test.py 10.0.2.134 2323
Windows (Command Prompt):
REM Test default telnet port (23)
python telnetd_CVE‑2026‑24061_test.py 10.0.2.134
REM Test custom port
python telnetd_CVE‑2026‑24061_test.py 10.0.2.134 2323
Windows (PowerShell):
# Test default telnet port (23)
python telnetd_CVE‑2026‑24061_test.py 10.0.2.134
# Test custom port
python telnetd_CVE‑2026‑24061_test.py 10.0.2.134 2323
macOS (Homebrew Python):
# If using Homebrew-installed Python, use python3 explicitly
python3 telnetd_CVE‑2026‑24061_test.py 10.0.2.134
# Or make executable and run directly
chmod +x telnetd_CVE‑2026‑24061_test.py
./telnetd_CVE‑2026‑24061_test.py 10.0.2.134 2323
NO_COLOR environment variable is setThe script provides four possible outcomes:
[-] NEW-ENVIRON not accepted
[RESULT] NOT IMPACTED
Meaning: The server does not support or accept the NEW-ENVIRON option. The server is not vulnerable to this specific attack vector.
Summary Information:
Action Required:
[!] ENV accepted by server
[RESULT] LIKELY IMPACTED (CVE-2026-24061)
Meaning: The server accepted the NEW-ENVIRON option and appears to have processed the injected environment variable. The server is likely vulnerable to CVE-2026-24061.
Summary Information:
Action Required:
[+] No response to ENV injection
[RESULT] INCONCLUSIVE
Meaning: The server accepted NEW-ENVIRON but did not provide a clear response. Manual verification is recommended.
Summary Information:
Action Required:
[RESULT] TEST FAILED - Communication Error
Meaning: The test could not be completed due to a communication error.
Summary Information:
Action Required: