views:

526

answers:

2

We have a unix box in our ofc. We usually telnet to this box and initiate commands on it. We usually do this from windows clients from the command prompt using the telnet.exe. We simply provide the ip of the unix box and it loads up a screen where we provide the login credentials. There is a default message before the login prompt saying some proprietary message.

I've tried using the TcpClient class to do the same thing. I've borrowed the code from msdn directly. I don't pass any value for the message parameter (its string.Empty). However I do not get the same response I get; I expected the proprietary message text, but instead I got $$? ? Don't know what that is.

This leads me to conclude that telnet.exe (the command prompt tool) does some initial communication to get the proprietary message. I want to know what it is and simulate something similar through the tcpclient class. What should I do?

And regarding messages: when we say "messages" in this context do we mean human readable messages or the messages mentioned in the RFC854 (the telnet protocol specification)?

+1  A: 

You could sniff the traffic during a regular session (e.g. with Wireshark) to see what's actually going on.

Rob
hi even if I had wireshark how do I figure what are the messages sent to it and what messages received from it...? I can't relate to the rfc with that...
deostroll
A: 

Found an opensource dotnet telnet library to work on. I guess it implements the telnet protocol better than I do...I could only understand only part of the code. Still trying to learn it. There are some assumptions (or rules of the thumb tht its orig dev had) I cannot follow. It is a project hosted on sourceforge. Developed by some1 named Seva Petrov.

dotnettelnet library https://sourceforge.net/projects/dotnettelnet/

deostroll