aplonis has asked for the wisdom of the Perl Monks concerning the following question:
There is a Win32 utility called RAdmin (Remote Administration) which forwards the mouse/keyboard and/or screen to another PC over Ethernet. It's cool for keeping an eye on a PC running a test stand. But I don't like the idea of someone peeping into my desktop. Let them come see the regular way. RAdmin uses by default, I believe, port 1149.
Who might know of a script one can run which will detect when one's PC is forwarding its screen to an Ethernet Peeping Tom...be they nosy boss or whomever?
Lacking one ready made, how might I get started to write one? In short, how do I monitor 127.0.0.1:1149 or whichever for outgoing screen traffic?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RAdmin detector for Win32
by pg (Canon) on Aug 29, 2005 at 02:08 UTC | |
The default port for RAdmin is 4899. 127.0.0.1 is sort of not precise. You actually don't want to monitor localhost, but your address on the network. Easy ways include: 1) to have a script that runs netstat periodically: netstat -a 10 etc. You can do it through open2, so your script can alert you when centain port is connected. 2) run firewall on your PC (some company does not allow employee to run firewall on their PC, you have to check this first) A more complex (might be better) way is to do some pcap programing. But this might be over-engneered, as most likely netstat should be good enough in your case. | [reply] |
|
Re: RAdmin detector for Win32
by anthski (Scribe) on Aug 29, 2005 at 06:19 UTC | |
Something like
should do the trick, if you run it as a scheduled task every 10 minutes (or however often). You could also write this into a loop which slept for 10 minutes and then opened netstat, etc and save yourself from running it as a task at a defined period, etc.
| [reply] [d/l] |
|
Re: RAdmin detector for Win32
by puploki (Hermit) on Aug 29, 2005 at 11:03 UTC | |
I agree with all the other replies to this - all valid ways of using Perl to check for this open port, but... Why are you so concerned about RAdmin in particular? I know from experience that there are thousands of programs around that will quite happily drop a screen capture/keylogger on your machine. Of course, these all run on a myriad of different ports - not to mention the fact that if I wanted, I could change RAdmin's listening port and therefore circumvent your checks. The other big killer on an exploited Windows box (much like *NIX) is not to trust any console tools - most backdoor writers these days are savvy enough to hide their processes by running a kernel layer filter. These are most commonly used to hide themselves from task manager, but I wouldn't put it past them to hide their network ports either. It's not that any of these suggestions are wrong in the Perl sense, and forgive me if I'm preaching to a learned monk, but it might just lull you into a false sense of security. A good software based firewall (hell, even XP SP2's inbuilt one) are going to cover most of the bases in this area. | [reply] |
by aplonis (Pilgrim) on Aug 29, 2005 at 16:07 UTC | |
You are correct, of course. But RAdmin is the tool which I know is employed ubiquitously in a certain location. It is installed on all PCs there. It's useful enough for tracking PCs running equipment, as I said. I use it myself. But I suspect it's used for more than that. In fact, I'm quite sure. In one sense, I don't mind so much that folks may look over my shoulder. It's just terribly impolite to sneek about doing it. Folks are welcome to view my activities all day long. I've nothing to hide. I just think it better they do so in person. Who would not agree that to be invisible while gawking is just plain rude. In short, I'm not so concerned as to be paranoid. I don't want to counter it. I just want to know when its happening. A simple matter of courtesy, is all. Thanks to all | [reply] |
|
Re: RAdmin detector for Win32
by aplonis (Pilgrim) on Aug 30, 2005 at 18:20 UTC | |
One last question, since I'm not so much a Win32 guy... Does NETSTAT for Win32 create any outbound Ethernet traffic? Or does it do its thing entirely on its own side of the port? Put another way, will running NETSTAT in a loop raise alarms on the network and bring down the lowering brow of IT SysAdmin types? | [reply] |
by anthski (Scribe) on Aug 31, 2005 at 06:24 UTC | |
...a program that accesses network related data structures within the kernel, then provides an ASCII format at the terminal. Netstat can provide reports on the routing table, TCP connections, TCP and UDP "listens," and protocol memory management So running netstat in a loop wont bring your local sysadmin running for the reason you cite. Obviously, running anything in a loop without care may cause other problems.
cheers, | [reply] |
|
Re: RAdmin detector for Win32
by aplonis (Pilgrim) on Aug 30, 2005 at 20:01 UTC | |
Okay, for what it's worth, here's my version. It does seem to work well enough:
| [reply] [d/l] |
|
Re: RAdmin detector for Win32
by kerpau (Novice) on Aug 29, 2005 at 22:14 UTC | |
| [reply] [d/l] |
|
Re: RAdmin detector for Win32
by aplonis (Pilgrim) on Sep 08, 2005 at 19:07 UTC | |
As promised, here is my version. I made it to scan any port or ports, and their neighbors, however may be desired. It sits quitely until it sees a connection. Then it pops up a Tk window. Thanks to all.
| [reply] [d/l] |