How do I find out which process is listening on a TCP or UDP port on Windows? Show
Mateen Ulhaq 22.6k16 gold badges88 silver badges128 bronze badges asked Sep 7, 2008 at 6:26
readonlyreadonly 334k107 gold badges203 silver badges204 bronze badges 13 PowerShellTCP
UDP
cmd
(Add -n to stop it trying to resolve hostnames, which will make it a lot faster.) Note Dane's recommendation for TCPView. It looks very useful! -a Displays all connections and listening ports. -b Displays the executable involved in creating each connection or listening port. In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions. -n Displays addresses and port numbers in numerical form. -o Displays the owning process ID associated with each connection.
answered Sep 7, 2008 at 6:28
Brad WilsonBrad Wilson 66.3k9 gold badges72 silver badges82 bronze badges 21 There's a native GUI for Windows:
answered May 18, 2014 at 5:02
10 For Windows:
xash 3,6809 silver badges22 bronze badges answered Sep 7, 2008 at 6:32
akuaku 121k32 gold badges170 silver badges203 bronze badges 6 Use TCPView if you want a GUI for this. It's the old Sysinternals application that Microsoft bought out.
answered Sep 7, 2008 at 6:38
DaneDane 9,6015 gold badges27 silver badges22 bronze badges 4 The -b switch mentioned in most answers requires you to have administrative privileges on the machine. You don't really need elevated rights to get the process name! Find the pid of the process running in the port number (e.g., 8080)
Find the process name by pid
Jaywalker 3,0293 gold badges30 silver badges42 bronze badges answered Jan 24, 2018 at 3:50
Ram SharmaRam Sharma 2,3671 gold badge7 silver badges7 bronze badges You can get more information if you run the following command:
using the 'Find' command allows you to filter the results.
answered Oct 8, 2013 at 18:56
Nathan24Nathan24 1,35011 silver badges20 bronze badges 4
NOTE: To find the process under Task Manager
answered Nov 8, 2012 at 1:49
CyborgCyborg 1,23412 silver badges12 bronze badges Get PID and Image NameUse only one command:
where The output will contain something like this:
Explanation:
If you want to skip the header and the return of the command prompt, you can use:
Output:
answered Feb 10, 2016 at 10:17
ROMANIA_engineerROMANIA_engineer 52.4k27 gold badges197 silver badges193 bronze badges 1 First we find the process id of that particular task which we need to eliminate in order to get the port free: Type
After executing this command in the Windows command line prompt (cmd), select the pid which I think the last column. Suppose this is 3312. Now type
You can now cross check by typing
the NOTE: sometimes Windows doesn’t allow you to run this command directly on CMD, so first you need to go with these steps: From the start menu -> command prompt (right click on command prompt, and run as administrator)
answered Aug 23, 2014 at 15:25
1 With PowerShell 5 on Windows 10 or Windows Server 2016, run The default output
of
answered Nov 2, 2016 at 19:19
bahrepbahrep 28.7k12 gold badges100 silver badges147 bronze badges To get a list of all the owning process IDs associated with each connection:
If want to kill any process have the ID and use this command, so that port becomes free
answered Apr 17, 2014 at 14:38
Monis MajeedMonis Majeed 1,31814 silver badges21 bronze badges 1 It is very simple to get the port number from a PID in Windows. The following are the steps:
answered May 30, 2016 at 6:36
Nishat LakhaniNishat Lakhani 7131 gold badge8 silver badges20 bronze badges 0
answered Feb 16, 2021 at 23:59
David JesusDavid Jesus 1,7432 gold badges27 silver badges33 bronze badges To find out which specific process (PID) is using which port:
Where 1234 is the PID of your process. [Go to Task Manager → Services/Processes tab to find out the PID of your application.]
answered Dec 14, 2018 at 6:55
Talha ImamTalha Imam 96620 silver badges22 bronze badges 2 In case someone need an equivalent for macOS like I did, here is it:
After you get the
answered Aug 12, 2020 at 11:22
Benjamin WenBenjamin Wen 3,2073 gold badges27 silver badges48 bronze badges 2 Just open a command shell and type (saying your port is 123456):
You will see everything you need. The headers are:
This is as mentioned here.
answered Jan 25, 2017 at 0:13
1 If you'd like to use a GUI tool to do this there's Sysinternals' TCPView.
answered Sep 7, 2008 at 6:40
David WebbDavid Webb 188k57 gold badges309 silver badges298 bronze badges
Replace the
Replace the
answered May 9, 2019 at 12:18
Anatole ABEAnatole ABE 5751 gold badge7 silver badges12 bronze badges 2 Netstat:
The Currports tool helps to search and filter
answered Sep 23, 2018 at 5:05
Blue CloudsBlue Clouds 6,5532 gold badges55 silver badges92 bronze badges Type in the command: For example, if I want to find port 80: This answer was originally posted to this question.
answered Nov 22, 2016 at 15:36
TechnotronicTechnotronic 8,0543 gold badges40 silver badges53 bronze badges
It's not ideal, but if you use Sysinternals' Process Explorer you can go to specific processes' properties and look at the TCP tab to see if they're using the port you're interested in. It is a bit of a needle and haystack thing, but maybe it'll help someone...
answered Mar 13, 2014 at 19:57
Tony DelroyTony Delroy 101k15 gold badges170 silver badges249 bronze badges 1 I recommend CurrPorts from NirSoft. CurrPorts can filter the displayed results. TCPView doesn't have this feature. Note: You can right click a process's socket connection and select "Close Selected TCP Connections" (You can also do this in TCPView). This often fixes connectivity issues I have with Outlook and Lync after I switch VPNs. With CurrPorts, you can also close connections from the command line with the "/close" parameter. answered Jun 29, 2015 at 22:07
JoshJosh 2,0222 gold badges21 silver badges20 bronze badges 0 A single-line solution that helps me is this one. Just substitute 3000 with your port:
Edit: Changed answered Feb 3, 2019 at 14:46
2 To find pid who using port 8000
To Kill that Process in windows
where pid is the process id which you get form first command answered Jul 14, 2020 at 6:13
jizjiz 1892 silver badges5 bronze badges 2 Follow these tools: From cmd: Process Explorer Process Dump Port Monitor All from sysinternals.com. If you just want to know process running and threads under each process, I recommend learning about Example:
The above command will show an all process list in brief every 5 seconds. To know more, you can just go with
And so on and so forth. :) 1 Using Windows' default shell (PowerShell) and without external applicationsFor those using PowerShell, try
answered Aug 25, 2016 at 13:36
mikemaccanamikemaccana 101k91 gold badges365 silver badges458 bronze badges 3 Use:
This shows the PID of the process running on a particular port. Keep in mind the process ID and go to Task Manager and services or details tab and end the process which has the same PID. Thus you can kill a process running on a particular port in Windows.
answered Aug 13, 2013 at 2:32
nishanisha 6932 gold badges14 silver badges28 bronze badges You can also check the reserved ports with the command below. Hyper-V reserve some ports, for instance.
answered Nov 24, 2020 at 14:50
Using PowerShell... ...this would be your friend (replace 8080 with your port number):
Sample output
So in this example tnslsnr.exe (OracleXE database) is listening on port 8080. Quick explanation
answered Dec 28, 2017 at 9:06
JpsyJpsy 19.5k7 gold badges114 silver badges110 bronze badges Which of the following commands should you use to locate open ports?Which of the following commands should you use to locate open ports? EXPLANATION Use nmap to locate open ports. Open ports can provide information about which operating system a computer uses and might provide entry points or information about ways to formulate an attack.
What command could you use to display listening TCP ports on a Linux system?Use ss command to display all open TCP and UDP ports in Linux. Another option is to use the netstat command to list all ports in Linux. Apart from ss / netstat one can use the lsof command to list open files and ports on Linux based system. Finally, one can use nmap command to check TCP and UDP ports too.
Which command should you use to display both listening and non listening sockets on your Linux system tip enter the command as if in command prompt?Which command should you use to display both listening and non-listening sockets on your Linux system? (Tip: enter the command as if in Command Prompt.) EXPLANATION Use netstat -a to identify listening and non-listening sockets on a Linux system.
What of the following would an attacker use to see which ports are listening?Port scanning is used to determine what ports a system may be listening on. This will help an attacker to determine what services may be running on the system. Some port scanners scan through ports in numeric order; some use a random order.
|