Telnet IAC Command Response

I am trying to negotiate a telnet connection with a socket. The socket is working, but the server tells me this thing:

ÿýÿýÿûÿû login: 

The value ÿýÿýÿûÿû means 255 253 1 255 253 31 255 251 1 255 251 3

I read all the RFC documents, but I don’t understand what I have to answer to send (string ascii data?) To the server, my desire is to successfully launch the login prompt and then send commands to the server, for example, “halt” or something else.

Thanks in advance for your reply.

+8
networking sockets ip tcpclient telnet
source share
2 answers

From RFC 854 :

Since NVT is what remains when no options are enabled, DO NOT and WILL NOT Responses do not guarantee that you will leave the connection in a state that both ends can handle. Thus, all hosts can implement their TELNET Processes completely unaware of options that are not supported, just reject (that is, reject) any that cannot be understood.

That is, for each WILL answer DONT . For each DO answer WONT .

In your case, you received (see IANA telnet options ):

 255 253 1 IAC DO ECHO 255 253 31 IAC DO NAWS 255 251 1 IAC WILL ECHO 255 251 3 IAC WILL SUPPRESS-GO-AHEAD 

So you should answer:

 255 252 1 IAC WONT ECHO 255 252 31 IAC WONT NAWS 255 254 1 IAC DONT ECHO 255 254 3 IAC DONT SUPPRESS-GO-AHEAD 

Please note that you do not have to know what 1, 3 or 31 means. This is beauty. You can refuse these options without even knowing their definitions. You simply use the network virtual terminal by default.

+22
source share

Search in RFC 854

 255 253 1 IAC DO #1 255 253 31 IAC DO #31 255 251 1 IAC WILL #1 255 251 3 IAC WILL #3 

Now we look at the parameter values ​​in here : 1: = echo, 31: = window size.

+1
source share

All Articles