telnetTelnet Cleartext Terminal & IAC Negotiation1983 Cleartext Login Alarms (admin <-> dinosaur_sw telnet TCP 23)
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.
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), anddont(254) option with the0xffIAC escape byte. - Appends
datatext immediately after any IAC negotiation bytes in the same TCP segment.
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.
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"}# 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.frasmAll 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 / Option | Accepted Value | Default | Effect 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) | Omitted | Emits the 3-byte 0xff <CMD> <OPT> IAC negotiation triplet. |
| option <0..255> | 1-byte option number | Omitted | Specifies an auxiliary Telnet option code. |
| data "<text>" | Quoted terminal text (supports \r\n) | Empty | Writes 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
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
| Option | Range / Format | Default | Effect on Packet |
|---|---|---|---|
| wait <number><ns|us|ms|s|m> | Time gap (ns, us, ms, s, m) | 10ms | Advances 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) | Omitted | Appends 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 MAC | Host MAC / RFC multicast MAC | Overrides 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..1 | Untagged | Wraps 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..4095 | Untagged (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..255 | Unlabeled (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..3 | ttl 64, dscp 0, ecn 0 | Sets 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..8191 | ipid 1, flags 0, fragoffset 0 | Sets 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) | 0 | Sets 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..65535 | srcport 49152 (remembered), TCP 23 | Overrides source or destination port and remembers the port pair automatically on <- replies. |
| seq <number> | acknum <number> | win <0..65535> | syn | ack | psh | fin | rst | TCP sequence/ack numbers, window size, flags & RFC 7323 options | psh ack, win 65535, automatic TCP seq/acknum | Overrides 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
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
eng_laptop <- rtu_gw telnet will 1 will 3eng_laptop <- rtu_gw telnet will 1 do 24Each 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.