Application layer protocol analysis-Telnet protocol analysis

Telnet is a simple remote terminal protocol. Users can use Telnet to seed their location to register (ie log in) to another host (using the host name or IP address) via a TCP connection. Use the telnet program on the end user's computer to connect to the server. End users can enter commands in the telnet program, and these commands will run on the server as if they were entered directly on the server's console. The server can be controlled locally.
The Telnet client process and server process generally belong to the user application program. The data input by the end user through the keyboard is sent to the terminal driver process of the operating system kernel. The terminal driver process sends the user input to the Telnet client process. The data is sent to TCP. TCP is responsible for establishing a TCP connection between the client and the server. The data is sent to the server through the TCP connection. The TCP layer of the server sends the received data to the corresponding application layer Telnet server process.
Telnet's command format
Insert picture description here
IAC: command interpreter, to put it bluntly, it must be the prefix of each command, a fixed value of 255 (11111111 B)

Command code: a series of definitions: (the most commonly used 250 ~ 254)

Insert picture description here
Insert picture description here
Option negotiation: 4 kinds of requests

1)WILL:发送方本身将激活选项
2)DO:发送方想叫接受端激活选项
3)WONT:发送方本身想禁止选项
4)DONT:发送方想让接受端去禁止选项

Insert picture description here
Immediately followed by option code
1
echo
3
suppression to continue
5
state
6
timing marker
24
terminal type
31
window size
32
terminal speed
33
remote flow control
34
line mode
36
environment variable

Build environment

Insert picture description here

Packet capture analysis

Insert picture description here

Insert picture description here
Insert picture description hereInsert picture description hereInsert picture description here

Published 70 original articles · praised 17 · visits 6691

Guess you like

Origin blog.csdn.net/qq_38626043/article/details/104360182