Telnet IAC option negotiation
What is Telnet IAC option negotiation?
Telnet IAC (Interpret As Command, byte 255) is the escape byte that starts every Telnet control sequence, including the WILL, WON'T, DO and DON'T commands client and server exchange to agree on options such as echo or window size. AdminKit's port check flags an open Telnet port 23 on your own IP.
By AdminKit team, Netbase JSC · Updated
A Telnet connection carries two kinds of bytes on one stream: the text a user types or reads, and commands about the session itself. RFC 854 separates them with a single escape byte, IAC (“Interpret As Command”, value 255). Whatever follows an IAC is a command, not text, and a real data byte 255 is sent doubled.
How does Telnet IAC option negotiation work?
RFC 855 builds option negotiation on four commands, each sent as IAC, the command byte and an option code:
- WILL (251) — “I will perform this option” (or “I agree to”).
- WON’T (252) — “I refuse to perform this option”.
- DO (253) — “please perform this option”.
- DON’T (254) — “please stop performing this option”.
For example, a server that wants to echo the user’s typing sends FF FB 01 (IAC WILL ECHO, option 1), and a client willing to report its window size sends IAC WILL NAWS, option 31 in RFC 1073. Options that need parameters use subnegotiation: the values travel between IAC SB (250) and IAC SE (240), such as the window’s width and height. Because refusing is always allowed, both sides can fall back to plain network virtual terminal behaviour when they disagree.
Packet captures make the exchange visible: the Wireshark Telnet display filter reference lists fields such as telnet.cmd, telnet.subcmd and telnet.naws_subopt.width for the decoded commands. Clients differ in who speaks first; the PuTTY manual explains that in active mode it starts negotiating as soon as the connection opens, while in passive mode it waits for the server, and that two passive ends would never negotiate at all, which is why PuTTY defaults to active mode.
Why does IAC negotiation matter for exposed devices?
Many routers, cameras and embedded devices send IAC sequences before their login prompt, so a raw TCP client that ignores them shows stray bytes, and anything that parses Telnet traffic has to strip or answer them first. More important for defenders, negotiation only agrees on presentation features like echo, terminal type or window size; it does not encrypt anything, so the credentials typed after it still cross the network in plain text. AdminKit’s guide to securing an exposed Telnet device covers turning the service off or replacing it with SSH.
AdminKit’s port check includes TCP port 23 in its fixed list and reports an open Telnet port on your own public IP as a high-severity finding.
Telnet IAC option negotiation belongs to AdminKit’s machine protocols cluster — browse the AdminKit glossary index for other related terms.
Frequently asked questions
What byte value is Telnet IAC?
255 (0xFF). RFC 854 defines IAC as the Interpret As Command escape, and a literal data byte 255 is sent as two IAC bytes in a row so it is not mistaken for a command.
What do WILL, WON'T, DO and DON'T mean in Telnet?
WILL (251) offers or agrees to perform an option, WON'T (252) refuses to perform it, DO (253) asks the other side to perform it and DON'T (254) asks it to stop. Each is sent as IAC, the command byte and the option code.
What is Telnet subnegotiation?
Once both sides agree to an option, some options need extra parameters. Those are sent between IAC SB (250) and IAC SE (240), for example the terminal type name or the window width and height for NAWS.
Does Telnet option negotiation add encryption?
No. The options described here only agree on how the session behaves and looks. The username, password and every keystroke still cross the network in plain text.