WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Mapping Ports to Services

Keywords: 	  Mapping Ports to Services

Question:

I am looking to map what active ports goto what services/executables. I know fport from Foundstone does this, but I need to customize it a bit, would anyone have any idea how to get me started in the journey??????

Answer:

The DOS command
	netstat -a -o
makes a lost of open ports and the processid of the process behind it.

NOTE: the -o switch is only available for use with Windows XP server. It is not available on Windows XP Home, Windows 2000 or any earlier versions of Windows.

If you do a:

	cmd=Environment("COMSPEC")
	line="/c netstat -a -o >output.txt"
	RunWait(cmd,params)
it should make a file output.txt that has the results of the netstat listing.

Then you can parse the file peeling off the port information. Then, maybe, with the process extender, you might be able to relate the process id back to an exe name or something...


Article ID:   W15521
File Created: 2004:02:02:10:00:22
Last Updated: 2004:02:02:10:00:22