0

I would like to know if there is any way we can see programatically if a telnet connection has been established.

We use a telnet to authenticate against a firewall inside our domain, after we authenticated we can access the hosts behind the firewall. Is their any way in C# how to query this connection state without using third party libraries?

Thanks in advance,

Kevin

UPDATE: These firewalls also have a url login webpage, currently we query those to see if we are connected but this process is far from consistent.

  1. only 75% of our firewalls can be tested like this
  2. this process relates on a timeout which makes the application hang

    -> C# - Testing Internet page - Waiting for timeout

Community
  • 1
  • 1
XikiryoX
  • 1,898
  • 1
  • 12
  • 33

3 Answers3

2

From my experimentation in a similar environment, the Telnet connection will only show up in netstat when the end user is being prompted to enter their credentials to log onto the firewall/server etc.

This connection will be between the IP of the SSL connection and the IP of the firewall/server on the same domain.

The status of this connection shows as ESTABLISHED while it is waiting for input but once the username and password have been authenticated this connection is no longer listed in the netstat output from the host.

However, a seperate connection from the SSL gateway IP and the host will be shown and the status of this will be in TIME_WAIT

Because you are going through an SSL connection there is no direct connection between the host and the destination.

Ideally you need to be able to programatically link the SSL to Firewall connection with the SSL to Host connection that is created. I would suggest capturing the netstat output during authentication using C#.

  • Paul - The connection indeed only shows up at negotiation of the firewall credentials. I shall see if I can indeed capture the netstat shell output. Thanks for your input. – XikiryoX Oct 24 '11 at 15:59
0

Can you perform some netstat functions in C# and query against that?

The Telnet connection should show up, right?

ist_lion
  • 3,149
  • 9
  • 43
  • 73
  • Well that was our initial idea as well, however the telnet connection goes cross domain(small mix up in my initial question, sry) (we use a software vpn connection to the other domain) and therefore is not listed when we do a netstat. Indeed if we telnetted to our home router and did netstat, it showed up, however our vpn adapter connections are not listed in the netstat result. Thanks for the reply – XikiryoX Jul 08 '11 at 09:31
0

C# - Socket to log on to Firewall

--> This fixed the issue on a more speedy and elegant way.

-KL-

Community
  • 1
  • 1
XikiryoX
  • 1,898
  • 1
  • 12
  • 33