Advertisement

Telnet protocol trouble

Started by September 17, 2000 10:11 AM
3 comments, last by tcs 24 years, 3 months ago
Hi, I''m implementing a command line based service over the telnet protocol. At the beginning the user has to enter a password. I want to know how to shadow the password or to remove the whole password line after the password request is finished. I looked at the telnet RFC to understand the telnet command structure. First I have to send a IAC (interpret as command) escape and the I have to send my command. So I have send a 255, 248, ''\0'' string. But this doesn''t work. I''ve tested it on SunOS telnet, Windows telnet and CRT. Here''s the important part of the RFC: TELNET COMMAND STRUCTURE All TELNET commands consist of at least a two byte sequence: the "Interpret as Command" (IAC) escape character followed by the code for the command. The commands dealing with option negotiation are three byte sequences, the third byte being the code for the option referenced. This format was chosen so that as more comprehensive use of the "data space" is made -- by negotiations from the basic NVT, of course -- collisions of data bytes with reserved command values will be minimized, all such collisions requiring the inconvenience, and Postel & Reynolds [Page 13] RFC 854 May 1983 inefficiency, of "escaping" the data bytes into the stream. With the current set-up, only the IAC need be doubled to be sent as data, and the other 255 codes may be passed transparently. The following are the defined TELNET commands. Note that these codes and code sequences have the indicated meaning only when immediately preceded by an IAC. NAME CODE MEANING SE 240 End of subnegotiation parameters. NOP 241 No operation. Data Mark 242 The data stream portion of a Synch. This should always be accompanied by a TCP Urgent notification. Break 243 NVT character BRK. Interrupt Process 244 The function IP. Abort output 245 The function AO. Are You There 246 The function AYT. Erase character 247 The function EC. Erase Line 248 The function EL. Go ahead 249 The GA signal. SB 250 Indicates that what follows is subnegotiation of the indicated option. WILL (option code) 251 Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option. WON''T (option code) 252 Indicates the refusal to perform, or continue performing, the indicated option. DO (option code) 253 Indicates the request that the other party perform, or confirmation that you are expecting the other party to perform, the indicated option. DON''T (option code) 254 Indicates the demand that the other party stop performing, or confirmation that you are no longer expecting the other party to perform, the indicated option. IAC 255 Data Byte 255. Can anyone tell me what I''m doing wrong ? What is the common method to accomplish such a password shadow ? Tim -------------------------- glvelocity.gamedev.net www.gamedev.net/hosted/glvelocity
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
I must say that I never did this kinda stuff, but from what I read here, you say you send a 255,248,0 while the doc says to send 255,248 ... maybe this makes a difference ?
As well, try the Multiplayer forum, there are more network people in there.
-----------------------------Sancte Isidore ora pro nobis !
Advertisement
The 0 was just the null character for the string...


Tim

--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
Not wanting to state the obvious but why not find the source to a preexisting telnet client\server and rip off that code? My first client\server was a modified chat server...
Chris Brodie
And where can I find such a source ?


Tim

--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity

This topic is closed to new replies.

Advertisement