How To Stop A Port In Windows
Open ports in Windows 10 are frequently accounted dangerous because hackers can exploit them if the service or application the ports are associated with are unpatched or lack bones security protocols. Therefore, it is recommended to close whatsoever listening network ports that your system isn't using.
Let us brief you on what ports are and why they can be unsafe.
Table of contents
- What are network ports?
- Are open network ports unsafe?
- ii ways to check which ports are open/listening in Windows ten
- Make up one's mind open up ports with process name using Command Prompt
- Decide open ports with process ID using Control Prompt
- How to close an open port
- How to quickly close ports using Command Prompt
- How to block network ports in Windows Firewall using Command Prompt
- Block port in Windows Firewall using command line
- Unblock/Open port in Windows Firewall using command line
- Closing words
What are network ports?
Network ports are used by Windows services and applications to send and receive data over the network. If you wonder if this is what the IP address is used for, so yous are admittedly right. Even so, a unique IP address defines the path to a specific device, whereas a port defines what application or service on that item device to ship that information to.
Just like the IP addresses, a port is also unique within its ecosystem. Significant, the same port cannot be used past ii dissimilar services/applications. Therefore, both of these unique identifiers, the IP address, and the port number, are used to send and receive data from a figurer.
A port number can exist institute suffixed to an IP address, as in the example below:
xxx.xxx.thirty.xxx:80
Here, the numbers followed by the colon announce the port number. Below are a few ports used past certain services and applications by default:
- FTP – 21
- SSH – 22
- Telnet – 23
- SMTP – 25
- DNS – 53
- DHCP – 67 & 68
- HTTP – eighty & 8080
- HTTPS – 443
- SNMP – 161
- RDP – 3389
A single IP accost tin can have 65535 TCP and 65535 UDP ports in total.
Are open network ports dangerous?
Non all ports that are listening are dangerous. Sometimes an application opens the ports automatically without informing the users. If the application is poorly synthetic and the security protocols lack the basic infrastructure, an attacker might exploit those and infiltrate your PC.
An open networking port is not always dangerous, but it is e'er ameliorate to keep your guard upwardly and shut whatever ports that are not required.
2 ways to check which ports are open/listening in Windows 10
Yous can figure out which ports are currently open on your figurer, even if the installed applications did not inform you that they are using them. Here are 2 ways to bank check which ports are open and which service/application uses them on your local computer before y'all proceed to block them.
Here is a guide to check if a remote network port is open.
Make up one's mind open ports with process name using Control Prompt
Some applications give out the name of the awarding/service associated with a port number. Y'all can apply the below-given command in Command Prompt to determine which ports are open and what are the names of the associated applications.
- Open up Command Prompt with administrative privileges.
- Enter the following command:
netstat -ab - Command Prompt will now display the output of open network ports with their associated application/service names, equally in the paradigm beneath:
Since the IP address assigned to our computer is 10.0.0.31, it displays different ports used by various applications suffixed to the IP accost. However, every bit y'all may notice, some of the names of the services and applications are unidentifiable. For that, we shall prefer the second method.
Determine open ports with process ID using Control Prompt
In this approach, we shall be comparison the process IDs of the running applications and services associated with the ports so determining the name of the process using the Job Manager. Here is how to do and then:
- Open up Control Prompt with administrative privileges.
- Enter the post-obit control:
netstat -aon - Command Prompt will at present brandish a list of TCP and UDP ports currently listening on your computer. Note the associated PIDs to compare from the Job Manager.
- At present open the Task Manager by right-clicking on the Taskbar and clicking on Job Managing director. Or, you may use the Ctrl + Shift + Esc shortcut keys.
- Now switch to the Details tab within the Task Manager and match the PID with the associated name of the process/application.
Now you lot have sufficient data on the ports you would like to close, if whatsoever. Keep to the next pace to block/close whatsoever listening ports on your computer.
How to close an open port
If you have found a port that you are no longer using or are not sure if it is secure to proceed open, you should preferably block it. If you wish to close an open port, yous can practice so with Windows Firewall or Windows Defender in case of Windows 10.
- Open the Windows Firewall by going to Start –> Control Panel –> Windows Firewall. If you are using Windows 10, you can open the Windows Defender Firewall past going to Run –> firewall.cpl.
- From the left side menu, click on Avant-garde settings.
- From the correct side menu of the new window, select Entering Rules.
- Then click New rule in the correct pane.
- On the Rule type screen in New inbound rule wizard, select Port and then click Next.
- On the side by side screen, select the type of port every bit adamant through the Command Prompt before, and then enter the port number you want to shut in front of Specific local ports. Click Next when washed.
- On the side by side screen, select Block the connection and and so click Next.
- On the Profile screen, select All Profiles and click Next.
- Now set a name for the rule and click Terminate.
You accept now successfully disabled the port. Y'all can echo the steps to cake additional ports or delete this one by navigating to the Inbound rules and removing the corresponding rules.
How to quickly close ports using Command Prompt
A couple of commands can be used to place the processes that have opened the ports so close the ports by killing the process.
- Open Command Prompt and run the command: netstat -a -o -northward. This will show all the open ports in your organization along with their current state and the process ID that have opened the ports.
- If you want to discover a specific port, you lot should run the control: netstat -a -o -n | findstr "993". Replace 993 with the port number you want to observe.
- The last column on the listing is the Process ID or PID number. Killing the procedure will automatically close the listening port. To kill the process, run the command: taskkill /pid 993.
Please note that this is a quick and temporary manner of closing the port using the command prompt. If you want to permanently block the port from opening again, you should follow the outset method given above.
How to block network ports in Windows Firewall using Command Prompt
Block port in Windows Firewall using command line
You lot can besides permanently block ports in Windows Defender Firewall using the Control Prompt.
To create a block port rule in Windows Firewall, run the following command in Command Prompt:
netsh advfirewall firewall add together rule name="Rule Proper noun" protocol=TCP dir=out remoteport=993 action=block
Replace Rule Name with your own rule name, for example, since I'm blocking IMAP port, I'll name the rule every bit Block IMAP. Replace TCP with either RCP or UDP, whichever port you want to block. Replace 993 with the actual port number yous desire to block.
Unblock/Open port in Windows Firewall using command line
To open the port again, but run the post-obit command in CMD:
netsh advfirewall firewall delete rule name="Rule Proper name"
Replace Dominion Name with the actual dominion name, Cake IMAP in my case. This volition delete the rule that we created to a higher place.
Closing words
Listening ports are non always dangerous, as it is very much dependent on what application/service it is open through. However, it is withal important non to give the attacker whatsoever chance to exploit your system's vulnerabilities and wise to close whatsoever ports that are not existence used.
Also see:
Source: https://www.itechtics.com/close-listening-ports/
Posted by: beardenschanithems86.blogspot.com

0 Response to "How To Stop A Port In Windows"
Post a Comment