Port 80 is one of the most used ports on the Internet. It is used to establish HTTP connections , that is to say data exchanges between a web browser and a web server. For example, when you type the address of a website into your browser, it sends a request to the web server via port 80, and the web server returns the requested page via the same port.
Port 80 is therefore essential for accessing websites, but it also presents security risks. Indeed, it can be used by hackers to launch denial of service (DDoS) attacks, which consist of saturating a web server with malicious requests to make it unavailable. It can also be exploited by malware to communicate with remote servers and transmit sensitive data.
To protect yourself from these threats, it may be useful to block port 80 on your computer or network. In this article, we will explain to you how to block port 80 on Windows and Linux, as well as the consequences of this operation.
How to block port 80 on Windows ?
On Windows , there are several methods to block port 80. The simplest is to use the firewall built into the operating system. Here are the steps to follow:
- Open Control Panel and click System and Security.
- Click Windows Defender Firewall, then Advanced Settings in the left menu.
- Click Inbound Rules, then click New Rule in the right menu.
- Select Port in the rule type, then click Next.
- Check TCP and enter 80 in the Local Specific and Remote Specific fields. Click Next.
- Select Block connection and click Next.
- Check the Domain, Private and Public boxes according to the network profiles to which you want to apply the rule. Click Next.
- Give the rule a name, such as Block port 80, and click Finish.
You have created a rule that blocks all incoming connections via port 80 on your Windows . You can verify that the rule is enabled by checking the list of inbound rules in Windows Defender .
If you want to block port 80 for outgoing connections, that is, those that go from your computer to a web server, you must repeat the same steps by clicking on Outbound Rules instead of Inbound Rules .
How to block port 80 on Linux?
On Linux, there are also several methods to block port 80. One of the most common is to use iptables, a program that allows you to configure network packet filtering rules. Here are the steps to follow:
- Open a terminal and type the following command to block incoming connections through port 80:
sudo iptables -A INPUT -p tcp –dport 80 -j DROP
- Type the following command to block outgoing connections through port 80:
sudo iptables -A OUTPUT -p tcp –dport 80 -j DROP
You have created two rules that block all connections via port 80 on your Linux computer. You can verify that the rules are active by typing the following command:
sudo iptables -L
If you want to delete the rules, you can type the following commands:
sudo iptables -D INPUT -p tcp –dport 80 -j DROP
sudo iptables -D OUTPUT -p tcp –dport 80 -j DROP
What are the consequences of blocking port 80?
Blocking port 80 can have pros and cons. The main benefit is to strengthen the security of your computer or network, preventing attacks or data leaks through this port. The main disadvantage is to limit access to websites that use the HTTP protocol.
Indeed, if you block port 80, you will no longer be able to access websites that use this port to communicate. You will then see an error message in your browser, indicating that the connection failed or that the site is inaccessible. This can be annoying if you want to visit legitimate websites that don't use the more secure HTTPS protocol and use port 443.
To get around this problem, you can use a proxy server or VPN, which allows you to change ports or IP addresses to access blocked websites. You can also modify the port 80 blocking rule to make it more specific, by specifying the IP address or domain name of the web server to which you want to block or allow access.
FAQs
Here are some frequently asked questions about port 80:
How do I know if port 80 is open or closed?
To find out whether port 80 is open or closed on your computer or on a web server, you can use the telnet program, which makes TCP connections to a specified port. For example, to test port 80 of the website www.example.com, you can type the following command in a terminal:
telnet www.example.com 80
If port 80 is open, you will see a message indicating that the connection has been established. If port 80 is closed, you will see a message indicating that the connection failed or timed out.
How to change the default port 80?
If you want to change the default port 80 on your web server, you need to modify the web server configuration. For example, if you are using Apache, you must edit the httpd.conf file and change the value of the Listen parameter. For example, to use port 8080 instead of port 80, you would replace the following line:
Listen 80
by :
Listen 8080
You must then restart the web server for the changes to take effect.
What is the difference between port 80 and port 443?
Port 80 and port 443 are the two most used ports for web connections. The main difference between them is that port 80 uses the HTTP protocol, which is not secure, while port 443 uses the HTTPS protocol, which is secure. The HTTPS protocol uses SSL/TLS encryption to protect data exchanged between the web browser and the web server. It thus guarantees the authenticity, confidentiality and integrity of the data.
Does blocking port 80 affect other ports?
No, blocking port 80 does not affect other ports. Each port is independent and can be opened or closed according to the rules you define. Blocking port 80 does not automatically block other ports used for web connections, such as port 443 for HTTPS or port 8080 for alternate HTTP.
Does blocking port 80 slow down browsing speed?
No, blocking port 80 does not slow down browsing speed. On the contrary, it can even improve it in some cases, avoiding attacks or interference that could overload the web server or the network. Additionally, most modern websites use HTTPS, which uses port 443 and is faster and more efficient than HTTP.
Conclusion
Port 80 is a very important port for web connections, but it can also present security risks. To protect yourself from attacks or data leaks via this port, it may be useful to block it on your computer or network. However, this also means no longer being able to access websites that use the HTTP protocol. You must therefore weigh the pros and cons before making this decision.
If you want to block port 80, you can use your operating system's firewall or a program like iptables. You can also use a proxy server or VPN to bypass port 80 blocking and access blocked websites. You can also edit the port 80 blocking rule to make it more specific, specifying the IP address or domain name of the web server you want to block or allow access to.
We hope this article helped you understand what port 80 is, what it is for and how to block it. If you have any questions or comments, please let us know in the section below.