Telnet client connecting to Win7 Telnet server. [SOLVED]

I have been using the Telnet client example to connect to things. I can connect to a Squeezeplug server and send and receive absolutely fine. I must be doing something wrong though trying to connect to the Win7 Telnet server.

I initially get some wierd characters, if I then send CR LF and it responds with 'Welcome to Microsoft Telnet Service ' but then, whatever I send, I get nothing.

I've tried different line terminations - no change.

Has anyone had the same problems or got any clues? I'm fairly certain the code is OK as it's only the Win7 server I have problems with.

Y'all have fun,

Glyphi

... Added later...
See my later post for file with ability to connect to Win7 Telnet server

I initially get some wierd characters, if I then send CR LF and it responds with 'Welcome to Microsoft Telnet Service ' but then, whatever I send, I get nothing.

Those weird characters are usually terminal configuration settings. I don't have a Win7 box to test with, but maybe this telnet wiki and the related RFCs will help.

Yes, you could be right - I will investigate, many thanks.

I have now tried the KpyM Telnet/SSH Server and apart from terminal codes and a nag screen it works. But I would prefer to get the built in fellow working. But still no Login: prompt.

Thanks!

Glyphi

Hmm, RFC's made excellent reading - I believe I now (I think) cope with the Will, won't, do and don't corrrectly. I'll double check after I've had a proper sleep.

Doesn't seem to help.

I do get the 'Welcome to Microsoft Telnet Service' and after the timeout the 'Telnet Server has closed the connection
Session timed out.' messages. I don't get the Logon: prompt, nor does anything I type echo.

Has anyone out there got the TelnetClient to work with a Microsoft Telnet server? Or understand the Telnet protocol enough to drop me a hint? Is there another option I have to start the negotiation for to get the server asking for for a Logon name?

If you all refuse to help :slight_smile: I'll just have to threaten the code with wireshark! (Wow, I hope the humour in that comes through)

Glyn

I try to avoid using Telnet on (general purpose) servers, because it is too easy to exploit, for my liking.

However, given the symptoms you are reporting, my hunch is you have not configured the Telnet server service properly. I have not looked at the service since Windows 2000 but IIRC, by default the server uses (Microsoft native) NTLM authentication and the client won't get a plain text prompt.

A quick Google turned up these links, which I will leave you to read for yourself.

If that don't fix it, Wireshark is your friend.

So do I, for the same reason.

I have configures the server as bst I know how, and as above, I am getting some respose. Wireshark? I want to marry it - have used it to examine the conversation and the extent to which it drills down is amazing.

I'm suspecting now that a correct respose to the Telnet commands will help me out - once I have read further.

Thanks all,

Glyn

Huzzah, I do have it working now. You have to respond in a correct manner to the Telnet options sent by the server. The sequence goes like this:

IAC Do Authentication Option
Send TN_WONT
IAC Will Echo
Send TN_DO
IAC Will Suppress go ahead
Send TN_DONT
IAC Do TELNET_ENV
Send TN_WONT
IAC Do Negotiate window size
Send TN_WONT
IAC Do Tx Binary
Send TN_WONT
IAC Will Tx Binary
Send TN_DONT
Welcome to Microsoft Telnet Service

login: mydomain\myname
password:
IAC Do Terminal Type
Send TN_WONT

I shall tidy up the program and post it, I suspect others may like to have their program drive windows, if only (like me) to shut it down.

Thanks to you all,

Glyn

Attached is a modified Telnet example. It allows you to connect to a Windows 7 Telnet Server.

Thanks to those above who helped and Wireshark.

Enjoy!

Glyphi

MyExample.txt (6.13 KB)