Protocol 53 of 81Layer 7FrameAssembly v3.1.2
llms-full.txt
telnetTelnet Cleartext Terminal & IAC Negotiation

1983 Cleartext Login Alarms (admin <-> dinosaur_sw telnet TCP 23)

Default Port / Protocol
TCP 23
Host Endpoint Rule
Dual-Stack IPv4/IPv6
Wireshark Display Filter
telnet
Standards & Specs
RFC 854, RFC 855
Wire Stack:Ethernet II[802.1Q / QinQ / MPLS]IPv4 / IPv6TCP 23Telnet

What It Does on the Wire

If TCP 23 fires on a modern network, either someone powered on a museum switch or a red teamer is having a great afternoon. telnet emits authentic 0xff IAC will/do bytes plus cleartext prompts.

Telnet (telnet, RFC 854 / RFC 855) sends terminal sessions and 0xff Interpret-As-Command (IAC) option triplets (WILL, WONT, DO, DONT) in cleartext over TCP port 23. Because credentials and commands travel unencrypted, detecting unexpected Telnet connections is a mandatory compliance check in PCI-DSS, NIST 800-53, CIS Benchmarks, and IEC 62443 OT networks.

FrameAssembly encodes 0xff IAC negotiation triplets (do, dont, will, wont) alongside ASCII terminal prompts and CLI commands (data) so you can verify IDS and NAC cleartext-management alerts safely without enabling Telnet on a real switch.

PCI-DSS / OT Security Cleartext Management Alert Verification

Replay a Telnet TCP 23 login prompt and CLI command across a monitored SPAN port or NDR sensor to confirm SOC alerts trigger immediately.

IoT / Telnet Honeypot & Mirai-Style Probe Signatures

Simulate automated enable / shell / sh Telnet command strings (data) to test Suricata IoT botnet detection rules.

RFC 855 IAC Option Parser Testing

Combine will 1 (Echo), will 3 (Suppress Go Ahead), and do 24 (Terminal Type) triplets with terminal text.

Minimal Quickstart (telnet_quickstart.frasm)

Hit Preview Packets to compile in-browser and eyeball timestamps + wire byte lengths, or ship it straight to the Playground.

telnet_quickstart.frasm10 lines
Open in Playground
host audit_pc { ip 10.10.10.50 }
host legacy_sw { ip 10.10.10.2 }
compile {
audit_pc -> legacy_sw tcp syn srcport 51023 dstport 23 wait 1ms
audit_pc <- legacy_sw tcp syn ack wait 1ms
audit_pc -> legacy_sw tcp ack wait 1ms
audit_pc <- legacy_sw telnet will 1 do 24 data "User Access Verification\r\nUsername: " wait 3ms
audit_pc -> legacy_sw telnet do 1 wont 24 data "operator\r\n"
}

What the Compiler Calculates So You Don't Have To

  • Defaults to TCP destination port 23 (psh ack) and tracks TCP sequence numbers automatically.
  • Prefixes every will (251), wont (252), do (253), and dont (254) option with the 0xff IAC escape byte.
  • Appends data text immediately after any IAC negotiation bytes in the same TCP segment.
Multi-Frame Lab · Ready to Compile

Legacy OT RTU Telnet Login Detection Scenario

Models a TCP 23 connection to a legacy serial-to-Ethernet terminal server, negotiating Echo/Suppress-Go-Ahead options and sending a show running-config command.

telnet_cleartext_audit.frasm14 lines
Open in Playground
host eng_laptop { ip 192.168.50.15 }
host rtu_gw { ip 192.168.50.200 }
compile {
eng_laptop -> rtu_gw tcp syn srcport 50123 dstport 23 win 65535 mss 1460 wait 1ms
eng_laptop <- rtu_gw tcp syn ack win 65535 mss 1460 wait 1ms
eng_laptop -> rtu_gw tcp ack wait 1ms
eng_laptop <- rtu_gw telnet will 1 do 24 wait 2ms
eng_laptop <- rtu_gw telnet will 3 data "RTU-GW01 login: " wait 5ms
eng_laptop -> rtu_gw telnet do 1 wont 24 wait 2ms
eng_laptop -> rtu_gw telnet do 3 data "maint\r\n" wait 3ms
eng_laptop <- rtu_gw telnet data "Password: " wait 5ms
eng_laptop -> rtu_gw telnet data "show version\r\n"
}
Terminal Commands (FrameAssembly CLI v3.1.2)
# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show telnet_cleartext_audit.frasm

# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly telnet_cleartext_audit.frasm telnet_cleartext_audit.pcap
frameassembly telnet_cleartext_audit.frasm telnet_cleartext_audit.pcapng

# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse telnet_cleartext_audit.pcap telnet_cleartext_audit_edited.frasm

All telnet Keywords & Header Options

Every sub-keyword and header option is lowercase [a-z0-9]+ with zero underscores — mix and match them in any order after telnet:

src_host -> dst_host telnet [do <0..255>] [dont <0..255>] [will <0..255>] [wont <0..255>] [option <0..255>] [data "<text>"]
Keyword / OptionAccepted ValueDefaultEffect on Packet
do <0..255> | dont <0..255> | will <0..255> | wont <0..255>Telnet option code (1 Echo, 3 Suppress Go Ahead, 24 Terminal Type, 31 Window Size)OmittedEmits the 3-byte 0xff <CMD> <OPT> IAC negotiation triplet.
option <0..255>1-byte option numberOmittedSpecifies an auxiliary Telnet option code.
data "<text>"Quoted terminal text (supports \r\n)EmptyWrites NVT ASCII terminal characters into the Telnet segment.

Cross-Layer Wrappers Valid with telnet

802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol

11 options
OptionRange / FormatDefaultEffect on Packet
wait <number><ns|us|ms|s|m>Time gap (ns, us, ms, s, m)10msAdvances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back).
payload "<text>" | hexpayload "<hex>"Quoted text or hex bytes (choose one)OmittedAppends or overrides raw payload bytes ("deadbeef" or "de:ad:be:ef") and updates packet lengths and checksums.
srcmac <mac> | dstmac <mac>Colon, hyphen, or Cisco dot MACHost MAC / RFC multicast MACOverrides the 14-byte Ethernet II source or destination MAC address for this single packet.
vlan <0..4095> [pcp <0..7>] [dei <0|1>]VLAN ID 0..4095, PCP 0..7, DEI 0..1UntaggedWraps the packet in an IEEE 802.1Q VLAN tag (0x8100) with optional 802.1p QoS priority.
qinq <0..4095> [innervlan <0..4095>]Outer S-VLAN 0..4095, Inner C-VLAN 0..4095Untagged (innervlan 1 when qinq is set)Double-tags the packet with outer IEEE 802.1ad S-Tag (0x88a8) plus inner IEEE 802.1Q C-Tag (0x8100).
mpls <0..1048575> [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>]Label 0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255Unlabeled (at most 1 mpls tag per packet)Inserts a 32-bit MPLS label header (0x8847) ahead of the Layer 3 header.
ttl <0..255> [dscp <0..63>] [ecn <0..3>]TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3ttl 64, dscp 0, ecn 0Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings.
ipid <0..65535> [df] [mf] [fragoffset <0..8191>]IPv4 ID, DF/MF flags, fragment offset 0..8191ipid 1, flags 0, fragoffset 0Sets IPv4 Identification, Do-Not-Fragment (df), More-Fragments (mf), and fragment offset (ignored over IPv6).
flowlabel <0..1048575>20-bit IPv6 Flow Label (0..1048575)0Sets the 20-bit IPv6 Flow Label for ECMP routing tests (ignored when running over IPv4 hosts).
srcport <0..65535> | dstport <0..65535>Port number 0..65535srcport 49152 (remembered), TCP 23Overrides source or destination port and remembers the port pair automatically on <- replies.
seq <number> | acknum <number> | win <0..65535> | syn | ack | psh | fin | rstTCP sequence/ack numbers, window size, flags & RFC 7323 optionspsh ack, win 65535, automatic TCP seq/acknumOverrides automatic TCP sequence tracking, flags, or RFC 7323 options (mss, wscale, sackperm, tsval, tsecr).

Gotchas & Quick Fixes

Include \r\n Line Endings in Interactive Commands

Valid v3.1.2 Syntax
eng_laptop -> rtu_gw telnet data "show ip interface brief\r\n"

RFC 854 Network Virtual Terminal (NVT) lines end with CR-LF (\r\n), which IDS command signatures often check for.

One Option Per IAC Verb Per Packet Line

Avoid
eng_laptop <- rtu_gw telnet will 1 will 3
Valid v3.1.2 Syntax
eng_laptop <- rtu_gw telnet will 1 do 24

Each IAC verb (will, wont, do, dont) may appear once on a packet line. Combine different verbs on one segment (will 1 do 24) or send a second will 3 on the next Telnet segment.

Field Guide 03
Poke Stateful Firewalls, Suricata, Zeek & OT Conduits