Discover Open Ports Using Netstat –nab
While browsing the Internet there may be chances that some attacker tries to connect to your computer by opening any port and try to run some program in victims computer so that the attacker can get the control. To get the list of open ports in your computer most of the time we search over the Internet for port scanner.Netstat –nab command will solve your problem. Netstat –nab will show you all the active connection, what are the programs using the network resources and at which port.
When you run the netstat command with the -nab switch, you get information about what TCP and UDP ports the machine is listening on. You also get information about what PID (Process ID) and service is using the port. For example:
C:\Documents and Settings\Administrator>netstat -nab
Active Connections
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4
[System]
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 676
RpcSs
[svchost.exe]
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
[System]
TCP 0.0.0.0:902 0.0.0.0:0 LISTENING 1352
[vmware-authd.exe]
TCP 0.0.0.0:912 0.0.0.0:0 LISTENING 1352
[vmware-authd.exe]
TCP 0.0.0.0:1025 0.0.0.0:0 LISTENING 436
[lsass.exe]
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 2104
TermService
[svchost.exe]
TCP 0.0.0.0:8222 0.0.0.0:0 LISTENING 4
[System]
TCP 0.0.0.0:8333 0.0.0.0:0 LISTENING 4
[System]
TCP 127.0.0.1:1037 0.0.0.0:0 LISTENING 2200
[alg.exe]
TCP 192.168.138.1:139 0.0.0.0:0 LISTENING 4
[System]
TCP 192.168.1.1:139 0.0.0.0:0 LISTENING 4
[System]
TCP 192.168.111.1:139 0.0.0.0:0 LISTENING 4
[System]
TCP 127.0.0.1:912 127.0.0.1:1050 ESTABLISHED 1352
[vmware-authd.exe]
TCP 127.0.0.1:912 127.0.0.1:1038 ESTABLISHED 1352
[vmware-authd.exe]
TCP 127.0.0.1:912 127.0.0.1:1039 ESTABLISHED 1352
[vmware-authd.exe]
TCP 127.0.0.1:912 127.0.0.1:1046 ESTABLISHED 1352
[vmware-authd.exe]
TCP 127.0.0.1:912 127.0.0.1:1049 ESTABLISHED 1352
[vmware-authd.exe]
TCP 127.0.0.1:912 127.0.0.1:1047 ESTABLISHED 1352
[vmware-authd.exe]
TCP 127.0.0.1:1038 127.0.0.1:912 ESTABLISHED 2252
[vmware-vmx.exe]
TCP 127.0.0.1:1039 127.0.0.1:912 ESTABLISHED 2012
[vmserverdWin32.exe]
TCP 127.0.0.1:1046 127.0.0.1:912 ESTABLISHED 1372
[vmware-vmx.exe]
TCP 127.0.0.1:1047 127.0.0.1:912 ESTABLISHED 2012
[vmserverdWin32.exe]
TCP 127.0.0.1:1049 127.0.0.1:912 ESTABLISHED 244
[vmware-vmx.exe]
TCP 127.0.0.1:1050 127.0.0.1:912 ESTABLISHED 2012
Next time you’re having connectivity issues or want to do a quick network security audit on a Windows host, remember to check out the netstat command.
























Leave a Reply