Page 1 of 1 1
Topic Options
#160179 - 2006-04-02 02:34 AM Identifying remote terminal server connections
topry Offline
Fresh Scripter

Registered: 2001-12-20
Posts: 5
I am looking for a method to identify if a user is connecting from outside our LAN. While I can retrieve the ComputerName and IP Address of the remote system using the WTSManager COM object, it is possible/likely for the remote user to have a router and be using the same 192.168.x.x subnet that is used on the LAN. I also do a NSLookup on the IP and compare the computer names, but that too is no guarantee. Someone could use the same private subnet and machine name as what is used on the LAN and this check would identify them as being local. [granted a small probability - but still possible]

SecureRDP is using a method that retrieves the login name, machine name and MAC address - the MAC is retrieved only for local clients, so this would work, if I could find the method to use.

Anyone know of a way to positively identify remote terminal server clients?

Top
#160180 - 2006-04-03 08:54 AM Re: Identifying remote terminal server connections
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I don't think someone can work on the same private subnet as you use on your LAN. If a user logs in using a router at home, he will be using (D)NAT. The WTSManager object will return the public address of his router for that computer.
Top
#160181 - 2006-04-03 05:27 PM Re: Identifying remote terminal server connections
topry Offline
Fresh Scripter

Registered: 2001-12-20
Posts: 5
Actually, they can. The RDP client does not care what the clients non-routable IP may be, it depends only on the public IP of the client. Unfortunately, I cannot find a method that will return that either. WTSManager, which apparently is just a COM wrapper for some WTS methods, returns only the clients IP.
Top
#160182 - 2006-04-03 06:27 PM Re: Identifying remote terminal server connections
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I still find it strange that WTSManager would give you an IP Address that, if used by Windows Terminal Server, would be routed wrong. I am affraid that I cannot test it.
Maybe this can help you?
Determine RDP Client IP Address

Top
#160183 - 2006-04-04 03:09 PM Re: Identifying remote terminal server connections
topry Offline
Fresh Scripter

Registered: 2001-12-20
Posts: 5
Thanks for the reply, WScript will retrieve the IP of the Terminal Server itself. WTS methods will return the IP reported by the RDP client. From more research, this is what Microsoft says is all it can return. When using NAT, the clients do not have access to the public IP of their router and can only report the private, non-routable IP.

I would have thought the desire to have different scripts for local/remote clients would not be unusual.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.053 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org