Catching rogue Web servers
Microsoft makes it very easy to run a personal Web server. So easy, in fact, that many corporate desktops are running Web servers and their companies don't even know! This presents a clear security risk to the organization and in most cases, shutting down these Web servers should be given a high priority. Unfortunately, that's easier said than done.
Part of the problem is that users can install a lot of different Web servers, not just IIS. For that matter, they can install all kinds of services you don't want, from FTP to game servers. It's impossible to know the name of each Web server so that you can script shutting it down, but you do know one thing... what port it's on.
One way to find devices running servers is to put a command in their login scripts. This command will run the "netstat -a" command and search the output for special characters. If it finds them, it will send a netbios message to a monitoring station you setup.
For instance, to find rogue Web servers, and send a message to a host with the computername spanky, use this command:
netstat -a | find "http" && net send spanky Help! I'm running a rogue Web server!
The double ampersands (&&) are a conditional operator that only executes the following command if the previous one is successful.
Of course, you could also use this same script to find all the desktops listening to popular ports like BackOrafice, or whatever the Outlook e-mail virus of the day is using.
Also note that your alert collection server must be running the messenger service to receive these messages, but your users can send them without running the service.
Thomas Alexander Lancaster IV is a consultant and author with over ten years experience in the networking industry, focused on Internet infrastructure.