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
telnetd_CVE-2026-24061_tester — Python script to detect CVE-2026-24061 telnetd vulnerability via NEW-ENVIRON injection, providing risk assessment and mitigation guidance. | Kitploit
Tools/GitHubGitHub/dotelpenguin/telnetd_cve-2026-24061_tester
Vulnerability ScannersExploitationWeb SecurityNetwork SecurityPenetration Testing
GitHubdotelpenguin/telnetd_cve-2026-24061_tester

telnetd_CVE-2026-24061_tester

Python script to detect CVE-2026-24061 telnetd vulnerability via NEW-ENVIRON injection, providing risk assessment and mitigation guidance.

View Repository
1147 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

Telnetd CVE-2026-24061 Test Script

A Python security testing tool to detect vulnerability to environment variable injection in telnetd servers via the NEW-ENVIRON telnet option.

Overview

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 Details

Vulnerability Summary

CVE-2026-24061 is a security vulnerability in telnetd servers that improperly handle environment variables sent via the NEW-ENVIRON telnet option (RFC 1572).

Impact

  • Severity: High
  • Attack Vector: Network
  • Authentication Required: No
  • Impact:
    • Potential command injection
    • Authentication bypass
    • Unauthorized access to the system

Technical Details

The vulnerability occurs when telnetd servers:

  1. Accept the NEW-ENVIRON telnet option
  2. Process environment variables sent via NEW-ENVIRON without proper validation
  3. Use these environment variables in unsafe ways (e.g., passing them directly to login processes)

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.

Affected Systems

  • Telnetd servers that support NEW-ENVIRON option
  • Servers that process USER environment variable without validation
  • Systems using vulnerable versions of telnetd implementations

Script Usage

Prerequisites

  • Python 3.x
  • Network access to target telnet server

Installation

No installation required. The script is standalone and uses only Python standard library modules.

Installing Python

Linux (Ubuntu/Debian):

root@kitploit:~
sudo apt-get update
sudo apt-get install python3

macOS (using Homebrew):

root@kitploit:~
# 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:

  1. Download Python from python.org
  2. Run the installer and check "Add Python to PATH"
  3. Verify installation:
    root@kitploit:~
    python --version
    
    Or using PowerShell:
    root@kitploit:~
    python --version
    

Basic Usage

Linux/macOS:

root@kitploit:~
./telnetd_CVE‑2026‑24061_test.py <host> [port]

Windows (Command Prompt):

root@kitploit:~
python telnetd_CVE‑2026‑24061_test.py <host> [port]

Windows (PowerShell):

root@kitploit:~
python telnetd_CVE‑2026‑24061_test.py <host> [port]

Examples

Linux/macOS:

root@kitploit:~
# 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):

root@kitploit:~
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):

root@kitploit:~
# 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):

root@kitploit:~
# 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

Features

  • Color-coded Output: Automatic color support detection with ANSI colors for better readability
    • Green for success messages
    • Red for errors and high-risk results
    • Yellow for warnings and inconclusive results
    • Cyan for informational messages
    • Colors automatically disabled when piping output or if NO_COLOR environment variable is set
  • Detailed Test Output: Step-by-step progress with detailed analysis
  • Comprehensive Error Handling: Clear error messages with possible causes and recommendations
  • Test Summary: Final summary includes result, risk level, risk severity, and impact assessment
  • Connection Information: Displays remote and local addresses for debugging

Test Outcomes

The script provides four possible outcomes:

1. NOT IMPACTED

root@kitploit:~
[-] 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:

  • Final Result: NOT IMPACTED
  • Risk Level: NONE
  • Risk Severity: N/A

Action Required:

  • No immediate action required for this vulnerability
  • Continue regular security maintenance and updates

2. LIKELY IMPACTED

root@kitploit:~
[!] 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:

  • Final Result: LIKELY IMPACTED (CVE-2026-24061)
  • Risk Level: HIGH
  • Risk Severity: CRITICAL
  • Impact Assessment:
    • Command injection possible
    • Authentication bypass possible
    • Unauthorized system access possible

Action Required:

  • Update telnetd to a patched version
  • Disable NEW-ENVIRON support if not needed
  • Implement proper input validation for environment variables
  • Consider disabling telnet in favor of SSH
  • Implement network access controls
  • Review server logs for suspicious activity

3. INCONCLUSIVE

root@kitploit:~
[+] 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:

  • Final Result: INCONCLUSIVE
  • Risk Level: UNKNOWN
  • Risk Severity: MEDIUM
  • Impact Assessment:
    • Vulnerability status unclear
    • Manual verification required
    • Further investigation recommended

Action Required:

  • Perform manual testing
  • Review server logs
  • Check telnetd configuration
  • Consult vendor security advisories
  • Test with additional environment variables

4. TEST FAILED

root@kitploit:~
[RESULT] TEST FAILED - Communication Error

Meaning: The test could not be completed due to a communication error.

Summary Information:

  • Final Result: TEST FAILED - Communication Error
  • Risk Level: UNKNOWN
  • Risk Severity: N/A
  • Impact Assessment:
    • Test could not be completed
    • Unable to determine vulnerability status

Action Required:

  • Retry the test
  • Check network stability
  • Review server logs
  • Verify network connectivity

How It Works

  1. Connection: Establishes a TCP connection to the target telnet server
    • Displays connection status and addresses
    • Handles connection errors with detailed messages
  2. Banner Reception: Receives and displays the initial server banner (if any)
    • Shows banner length and preview
  3. NEW-ENVIRON Negotiation:
    • Sends IAC DO NEW_ENVIRON to request NEW-ENVIRON option
    • Waits for server response (IAC WILL NEW_ENVIRON)
    • Displays negotiation status
  4. Environment Variable Injection:
    • Constructs a telnet subnegotiation payload
    • Sends USER=-f root environment variable via NEW-ENVIRON
    • The -f flag is a common login bypass technique
    • Shows payload details
  5. Response Analysis:
    • Monitors server response
    • Determines if the server processed the injected variable
    • Provides detailed vulnerability assessment
  6. Test Summary:
    • Displays final result
    • Shows risk level and severity
    • Provides impact assessment
    • Includes completion timestamp

Technical Implementation

Telnet Protocol Constants

The script uses standard telnet protocol byte values:

  • IAC (255): Interpret As Command
  • DO (253): Request option enablement
  • WILL (251): Agree to enable option
  • SB (250): Subnegotiation Begin
  • SE (240): Subnegotiation End
  • NEW_ENVIRON (39): NEW-ENVIRON option number (RFC 1572)

Payload Structure

The injection payload follows RFC 1572 format:

root@kitploit:~
IAC SB NEW_ENVIRON IS VAR USER <0x01>-f root IAC SE

Where:

  • IAC SB: Start subnegotiation
  • NEW_ENVIRON: Option identifier
  • IS: Information Subnegotiation
  • VAR: Variable type indicator
  • USER: Environment variable name
  • 0x01: VALUE byte
  • -f root: Injected value
  • IAC SE: End subnegotiation

Error Handling

The script includes comprehensive error handling for:

  • Connection timeouts (with possible causes)
  • Connection refused errors (with troubleshooting tips)
  • Invalid port numbers (with clear error messages)
  • Socket communication errors (with recommendations)
  • Network failures (with retry suggestions)

All errors are reported with clear, color-coded, user-friendly messages that include:

  • Error description
  • Possible causes
  • Recommended actions
  • Test summary even on failure

Limitations

  • False Positives: Some servers may accept NEW-ENVIRON but properly sanitize inputs
  • False Negatives: Servers may process variables differently than expected
  • Network Dependencies: Requires network connectivity to target
  • Detection Method: Relies on server response patterns, which may vary

Security Considerations

⚠️ Important: This script is for authorized security testing only.

  • Only test systems you own or have explicit permission to test
  • Unauthorized testing may violate laws and regulations
  • Use responsibly and ethically
  • Results should be verified through additional testing

Mitigation Recommendations

If a server is found to be vulnerable:

  1. Immediate Actions:

    • Update telnetd to the latest patched version
    • Review and apply vendor security patches
    • Consider disabling telnet service if not required
  2. Configuration Changes:

    • Disable NEW-ENVIRON option if not needed
    • Implement input validation for environment variables
    • Use firewall rules to restrict telnet access
  3. Long-term Solutions:

    • Migrate to SSH (Secure Shell) instead of telnet
    • Implement network segmentation
    • Regular security audits and updates

References

  • CVE: CVE-2026-24061
  • RFC 1572: Telnet Environment Option (NEW-ENVIRON)
  • RFC 854: Telnet Protocol Specification
  • RFC 855: Telnet Option Specifications

Color Output

The script automatically detects terminal color support and uses ANSI colors for better readability:

  • Disable colors: Set NO_COLOR=1 environment variable
  • Force colors: Set FORCE_COLOR=1 environment variable
  • Colors are automatically disabled when output is piped to a file

Example:

root@kitploit:~
# Disable colors
NO_COLOR=1 ./telnetd_CVE‑2026‑24061_test.py 10.0.2.134

# Force colors (useful for some terminals)
FORCE_COLOR=1 ./telnetd_CVE‑2026‑24061_test.py 10.0.2.134

License

This script is provided as-is for security testing purposes. Use at your own risk.

Disclaimer and Warranty

NO WARRANTY

THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

LIMITATION OF LIABILITY

THE AUTHORS, CONTRIBUTORS, AND DISTRIBUTORS OF THIS SOFTWARE SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

USE AT YOUR OWN RISK

  • This tool is provided for educational and authorized security testing purposes only
  • The authors and contributors are not responsible for any misuse, damage, or legal consequences resulting from the use of this tool
  • Always ensure you have proper authorization before testing any system
  • Unauthorized access to computer systems is illegal and may result in criminal prosecution
  • The authors assume no responsibility for any actions taken using this software
  • Users are solely responsible for ensuring compliance with all applicable laws and regulations
  • This software may cause unintended effects on target systems
  • Results from this tool should be verified through additional testing and professional security assessment
  • The authors make no guarantees about the accuracy, completeness, or reliability of test results

Contributing

Improvements and bug reports are welcome. Please ensure any modifications maintain the script's security testing purpose and ethical use guidelines.

Download Tool