Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Talking to a telnet server [modified]

Talking to a telnet server [modified]

Scheduled Pinned Locked Moved C#
sysadminsecurityhelp
6 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shultas
    wrote on last edited by
    #1

    Hello Everyone- I am trying to build an application that connects to a telnet server and interacts with it issuing various commands. I have done this in the past and it worked relatively painlessly. This particular device I am working with today however, is using some sort of advanced feature and is sending me an authentication request as soon as I connect to it. (If I use microsoft telnet client to connect, as soon as I connect it prompts me to send my windows login information, if I say no, I am brought to a login: prompt, this is what I want to get to with my program). I have been scouring the net and I cannot find what my response should be to this server to tell it that I do not want to use the NTLM authentication, I just want to be brought to the login: prompt. If anyone could help me I would greatly appreciate it! EDIT: By the way, as soon as I connect, this is what I receive from the server: FF FD 25 FF FB 01 FF FB 03 FF FD 27 FF FD 1F FF FD 00 FF FB 00

    modified on Sunday, August 9, 2009 2:28 PM

    L 1 Reply Last reply
    0
    • S shultas

      Hello Everyone- I am trying to build an application that connects to a telnet server and interacts with it issuing various commands. I have done this in the past and it worked relatively painlessly. This particular device I am working with today however, is using some sort of advanced feature and is sending me an authentication request as soon as I connect to it. (If I use microsoft telnet client to connect, as soon as I connect it prompts me to send my windows login information, if I say no, I am brought to a login: prompt, this is what I want to get to with my program). I have been scouring the net and I cannot find what my response should be to this server to tell it that I do not want to use the NTLM authentication, I just want to be brought to the login: prompt. If anyone could help me I would greatly appreciate it! EDIT: By the way, as soon as I connect, this is what I receive from the server: FF FD 25 FF FB 01 FF FB 03 FF FD 27 FF FD 1F FF FD 00 FF FB 00

      modified on Sunday, August 9, 2009 2:28 PM

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I am not sure but you might be seeing the Microsoft MS-TNAP protocol: [MS-TNAP]: Telnet: NT LAN Manager (NTLM) Authentication Protocol Specification[^] I am not sure if thats what your seeing though because according to this documentation first byte should be 0xF if authenticating with NTLM 4.1 Telnet Client Successfully Authenticating to a Telnet Server[^] Maybe your seeing something other than NTLM? Hope it helps, -David Delaune

      S 1 Reply Last reply
      0
      • L Lost User

        I am not sure but you might be seeing the Microsoft MS-TNAP protocol: [MS-TNAP]: Telnet: NT LAN Manager (NTLM) Authentication Protocol Specification[^] I am not sure if thats what your seeing though because according to this documentation first byte should be 0xF if authenticating with NTLM 4.1 Telnet Client Successfully Authenticating to a Telnet Server[^] Maybe your seeing something other than NTLM? Hope it helps, -David Delaune

        S Offline
        S Offline
        shultas
        wrote on last edited by
        #3

        If I use Hyperterminal to connect, it does not ask me if I want to send my username/password when I connect to the server, it simply connects and says Welcome to Microsoft telnet server ... login: I am in need of whatever it is that Hyperterminal is respond to the server after the servers initial response (that appears to be putting it into dumb terminal / TTY mode). I've ran a port sniffer and I'm just not smart enough to figure it out, there is so much data being sent back and forth :(

        S 1 Reply Last reply
        0
        • S shultas

          If I use Hyperterminal to connect, it does not ask me if I want to send my username/password when I connect to the server, it simply connects and says Welcome to Microsoft telnet server ... login: I am in need of whatever it is that Hyperterminal is respond to the server after the servers initial response (that appears to be putting it into dumb terminal / TTY mode). I've ran a port sniffer and I'm just not smart enough to figure it out, there is so much data being sent back and forth :(

          S Offline
          S Offline
          shultas
          wrote on last edited by
          #4

          Normally when I program an application, I simply connect to it, send commands to the socket and listen for commands back from the socket. It has always been straightforward. This device however, has something different. When I run the packet sniffer even with Hyperterminal, every command that I send out is proceeded by a ton of hex codes. I've tried to read on the RFC of how telnet works but I am just not that advanced. I'm used to opening the socket, reading and writing to it and that's it. I can't figure out how to get the server to just respond to me with simple ASCII

          L L 2 Replies Last reply
          0
          • S shultas

            Normally when I program an application, I simply connect to it, send commands to the socket and listen for commands back from the socket. It has always been straightforward. This device however, has something different. When I run the packet sniffer even with Hyperterminal, every command that I send out is proceeded by a ton of hex codes. I've tried to read on the RFC of how telnet works but I am just not that advanced. I'm used to opening the socket, reading and writing to it and that's it. I can't figure out how to get the server to just respond to me with simple ASCII

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            HyperTerminal knowing about telnet protocols shouldn't be too much of a surprise. It even has some settings about Telnet... :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


            1 Reply Last reply
            0
            • S shultas

              Normally when I program an application, I simply connect to it, send commands to the socket and listen for commands back from the socket. It has always been straightforward. This device however, has something different. When I run the packet sniffer even with Hyperterminal, every command that I send out is proceeded by a ton of hex codes. I've tried to read on the RFC of how telnet works but I am just not that advanced. I'm used to opening the socket, reading and writing to it and that's it. I can't figure out how to get the server to just respond to me with simple ASCII

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Have you tried using this third-pary library? .NET Telnet[^] The source code is available here and it seems to handle the negotiation. http://sourceforge.net/projects/dotnettelnet/files/[^] In fact when I look through the source it appears the 0xFF was the IAC WILL TERMINAL-TYPE as decribed in RFC-930[^] Have a look and let me know how it turns out. Good Luck, -David Delaune

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups