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 commandnetstat -a -omakes a lost of open ports and the processid of the process behind it.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...