Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What port is a given program using? [closed]

I want to be able to figure out what port a particular program is using. Are there any programs available online or that come with windows that will tell me which processes are using which ports on my computer?

PS - before you downmod this for not being a programming question, I'm looking for the program to test some networking code.

like image 305
AlexeyMK Avatar asked Sep 19 '08 20:09

AlexeyMK


People also ask

What are closed ports?

Answer. A closed port indicates that no application or service is not listening for connections on that port. A closed port can open up at any time if an application or service is started. A filter port indicates that a firewall, filter, or other network issue is blocking the port.

How do you check which ports are closed?

Enter "telnet + IP address or hostname + port number" (e.g., telnet www.example.com 1723 or telnet 10.17.xxx.xxx 5000) to run the telnet command in Command Prompt and test the TCP port status. If the port is open, only a cursor will show. If the port is closed, a message will say Connect failed.


2 Answers

netstat -b -a lists the ports in use and gives you the executable that's using each one. I believe you need to be in the administrator group to do this, and I don't know what security implications there are on Vista.

I usually add -n as well to make it a little faster, but adding -b can make it quite slow.

Edit: If you need more functionality than netstat provides, vasac suggests that you try TCPView.

like image 129
Graeme Perrow Avatar answered Oct 17 '22 22:10

Graeme Perrow


TCPView can do what you asked for.

like image 40
vasac Avatar answered Oct 17 '22 22:10

vasac