Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telnet IAC command answering

I'm trying to negotiate a telnet connection with a socket. The socket is working,but the server is telling me that thing:

ÿýÿýÿûÿû

login:

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

I read all the RFC docs but I don't understand what should I respond with to be able to send (string ascii data?) to the server, my wish is to run the login prompt successfully and then send commands to a server like "halt" or something else.

Thanks in advance for your answer.

like image 297
Cindy Broutin Avatar asked May 02 '12 12:05

Cindy Broutin


2 Answers

From RFC 854:

Since the NVT is what is left when no options are enabled, the DON'T and WON'T responses are guaranteed to leave the connection in a state which both ends can handle. Thus, all hosts may implement their TELNET processes to be totally unaware of options that are not supported, simply returning a rejection to (i.e., refusing) any option request that cannot be understood.

That is, for every WILL, respond DONT. For every DO, respond WONT.

In your case, you've received (see IANA assigned 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 respond:

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

Note that you don't have to know what 1, 3, or 31 actually mean. That's the beauty. You can refuse those options without even knowing their definition. You'll just default to the network virtual terminal.

like image 89
Robᵩ Avatar answered Sep 25 '22 22:09

Robᵩ


Looking it up 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 looking up the parameter values in here: 1 := echo, 31 := window size.

like image 45
wildplasser Avatar answered Sep 24 '22 22:09

wildplasser