Internet Security

What Ports Should I Block On My Firewall

When it comes to protecting your network, one of the most crucial steps is deciding which ports to block on your firewall. Did you know that there are over 65,000 TCP and UDP ports that can be used for communication? With such a vast number of ports, it's essential to understand which ones pose a potential security risk and should be closed off. By effectively blocking certain ports, you can safeguard your network from unauthorized access and potential cyber threats.

Understanding what ports to block on your firewall requires a combination of historical knowledge and current security considerations. Several ports have been historically associated with specific vulnerabilities or known attack vectors, making them prime targets for security breaches. For example, ports such as 23 (Telnet), 25 (SMTP), and 80 (HTTP) have been frequently exploited by hackers. Additionally, blocking ports that are commonly used for file sharing, like 445 (SMB), can reduce the risk of unauthorized access to your network. It is crucial to stay updated on the latest security best practices and consult with professionals to determine the specific ports that should be blocked for your organization's unique needs.



What Ports Should I Block On My Firewall

Introduction: Understanding the Importance of Blocking Ports on Your Firewall

A firewall is a crucial component of a secure network, acting as a barrier between your internal network and external threats. It helps prevent unauthorized access to your network and protects your sensitive data from potential cyber attacks. By default, firewalls permit or block traffic based on specific rules. One key aspect of firewall configuration is determining which ports to block.

Ports are essential for establishing network connections and allowing the exchange of data between devices. The internet and network services utilize different ports to communicate with devices on your network. However, not all ports are equally safe, and some can pose significant security risks if left open or unmonitored.

In this article, we will explore the ports that you should consider blocking on your firewall to enhance network security and protect your sensitive information from unauthorized access or potential threats.

Commonly Exploited Ports and Their Security Risks

When configuring your firewall, it is essential to understand the commonly exploited ports and the corresponding security risks they pose. By identifying and blocking these ports, you can significantly reduce the potential for cyber attacks and unauthorized access. Here are some commonly exploited ports and their associated security risks:

1. Port 21 – FTP (File Transfer Protocol)

File Transfer Protocol (FTP) is a common method for transferring files over the internet. Port 21 is used for FTP control messages, but it is highly vulnerable to security breaches. Attackers often target this port to gain unauthorized access, upload malicious files, or exfiltrate sensitive data.

To mitigate the security risks associated with FTP, it is advisable to block inbound and outbound traffic on port 21 unless there is a specific need for FTP communication within your network. By doing so, you can prevent unauthorized file transfers and protect your network from potential attacks.

Furthermore, consider implementing more secure file transfer alternatives, such as Secure File Transfer Protocol (SFTP) or use a VPN (Virtual Private Network) to encrypt FTP traffic for enhanced security.

2. Port 22 – SSH (Secure Shell)

Secure Shell (SSH) is a network protocol that provides secure remote access to systems and encrypted data communication. While SSH is commonly used for legitimate administrative purposes, it can also be targeted by attackers to gain unauthorized access to a system.

Blocking inbound traffic on port 22 and allowing it only from trusted IP addresses or specific network segments can help prevent unauthorized SSH access attempts. Additionally, it is recommended to use key-based authentication instead of password authentication for SSH connections, as it provides an additional layer of security.

If you rely on SSH for remote access, consider changing the default SSH port (22) to a non-standard port to make it less susceptible to automated attacks targeting commonly used ports.

3. Port 23 – Telnet

Telnet is a protocol that provides command-line access to remote computers. However, it lacks adequate security measures, making it susceptible to eavesdropping and unauthorized access.

Due to its inherent security risks, it is recommended to block inbound and outbound traffic on port 23, unless there is a specific need for Telnet communication within your network. If you require remote access to systems, consider using SSH as a more secure alternative.

It's important to note that Telnet passwords are transmitted in plain text, making them easily vulnerable to interception. Avoid using Telnet for any sensitive operations, such as transmitting login credentials or accessing critical systems.

4. Port 80 – HTTP (Hypertext Transfer Protocol)

Hypertext Transfer Protocol (HTTP) is used for website communication, and port 80 is the default port for unencrypted HTTP traffic. While blocking port 80 may disrupt normal web browsing, it can prevent attacks targeting vulnerabilities in web servers or unauthorized access to web-based systems.

To ensure secure browsing, it is recommended to enable HTTPS (HTTP Secure) for websites and redirect all HTTP traffic to port 443 using a technique called HTTP Strict Transport Security (HSTS). This ensures encrypted communication between the user's browser and the web server, reducing the risk of data interception or manipulation.

By blocking outbound traffic on port 80 and allowing only necessary HTTP traffic through port 443, you can enhance your network security and protect sensitive information transmitted over the web.

Additional Ports to Consider Blocking

In addition to the commonly exploited ports mentioned above, there are several other ports that you should assess and consider blocking on your firewall to bolster your network security. These ports include:

1. Port 135 – MS-RPC (Microsoft Remote Procedure Call)

The MS-RPC protocol is used by Microsoft Windows systems to execute remote procedure calls between machines. Port 135 is commonly targeted by malware and worms to exploit vulnerabilities in Windows systems.

Blocking inbound traffic on port 135 can help mitigate attacks seeking to exploit MS-RPC vulnerabilities and prevent the spread of malware within your network.

If you require remote access to Windows systems, it is recommended to use a Virtual Private Network (VPN) connection or implement a secure remote desktop protocol like Remote Desktop Protocol (RDP) over a non-standard port.

2. Port 443 – HTTPS (HTTP Secure)

While port 443 is commonly associated with secure web browsing (HTTPS), it can also be exploited by attackers to bypass firewall rules and establish covert encrypted channels. In some cases, this can be used for unauthorized data exfiltration or to evade network monitoring.

It is advisable to monitor outbound traffic on port 443 and implement measures to detect and prevent unauthorized or malicious SSL/TLS traffic, such as implementing SSL inspection or utilizing next-generation firewalls capable of deep packet inspection.

Additionally, consider blocking outbound traffic on port 443 for systems that do not require secure web browsing. However, exercise caution to avoid disrupting legitimate HTTPS traffic for necessary web-based applications.

3. Port 3389 – Remote Desktop Protocol (RDP)

Remote Desktop Protocol (RDP) allows users to connect to remote Windows machines and access their desktops. However, leaving port 3389 open and accessible can expose your systems to brute-force attacks and unauthorized access attempts.

If remote access to Windows systems is required, it is recommended to restrict RDP access to trusted IP addresses or utilize a VPN connection for secure remote desktop access.

It is also worth considering implementing account lockout policies and strong passwords for user accounts with RDP access to mitigate the risk of brute-force attacks. Additionally, regularly patching and updating Windows systems can help address potential vulnerabilities.

Conclusion

When configuring your firewall, it is crucial to identify and block ports that pose security risks. By blocking commonly exploited ports and assessing additional ports for potential vulnerabilities, you can significantly enhance your network security and protect your sensitive information from unauthorized access or potential threats.


What Ports Should I Block On My Firewall

Ports to Block on Your Firewall

When it comes to securing your network, blocking certain ports on your firewall is an essential step. By restricting access to these ports, you can minimize the risk of unauthorized access and protect your sensitive information from potential threats.

In deciding which ports to block, it is important to consider the specific needs of your organization and the services that are utilized. However, there are a few commonly blocked ports that are known to pose a high level of risk:

  • Port 80 (HTTP) - Blocking this port can prevent unauthorized access to websites and web-based applications.
  • Port 443 (HTTPS) - This port is commonly used for secure web communication, so blocking it can help prevent potential data breaches or hacking attempts.
  • Port 22 (SSH) - Blocking this port can protect against unauthorized remote access to servers.
  • Port 3389 (RDP) - By blocking this port, you can prevent unauthorized access to remote desktop protocols.

Keep in mind that these are just a few examples, and the ports you choose to block may vary depending on your organization's specific needs and resources. Regularly reviewing your firewall rules and staying updated on the latest security threats can help ensure that your network remains protected.


Key Takeaways: What Ports Should I Block on My Firewall

  • Blocking unnecessary ports on your firewall helps protect your network from unauthorized access.
  • Common ports to consider blocking include Telnet (23), FTP (20 and 21), and SNMP (161 and 162).
  • Blocking ports such as RDP (3389) and SSH (22) can enhance security against remote attacks.
  • It is important to block ports associated with outdated protocols like NetBIOS (137-139) and SMB (445).
  • Regularly reviewing your firewall rules and keeping up with security best practices is crucial for effective port blocking.

Frequently Asked Questions

Firewalls play a crucial role in protecting your network from potential threats. By blocking certain ports, you can enhance your network security. Here are some frequently asked questions about what ports you should block on your firewall.

1. Which ports should I block on my firewall?

Firewalls can block various ports depending on your specific needs and network environment. However, it is generally recommended to block unnecessary ports to reduce the attack surface. Some common ports to consider blocking include:
  • Port 23 (Telnet): Telnet is an insecure protocol that can expose your network to potential security risks. It is advisable to block this port to prevent unauthorized remote access.
  • Port 135 (RPC): RPC (Remote Procedure Call) is commonly exploited by attackers. Blocking this port can help prevent certain types of attacks, such as DDoS attacks.
  • Port 445 (SMB): SMB (Server Message Block) is often targeted by ransomware and other malware. Blocking this port can mitigate the risk of network infections.
  • Port 3389 (Remote Desktop Protocol): RDP is a common target for brute-force attacks. If you do not need remote desktop access, blocking this port can enhance security.
  • Port 69 (TFTP): TFTP (Trivial File Transfer Protocol) is insecure and can be exploited for unauthorized file transfers. Blocking this port can prevent potential data breaches.
Please note that these are just a few examples, and the ports you should block may vary depending on your specific network setup and security requirements.

2. How can blocking ports on my firewall improve security?

Blocking ports on your firewall can significantly improve your network security by limiting the potential attack vectors. When you block unnecessary ports, you reduce the exposure of your network to various types of threats, such as malware, unauthorized access attempts, and data breaches. By only allowing the necessary ports to remain open, you minimize the risk of exploitation and increase the overall security of your network.

3. Are there any risks associated with blocking ports on my firewall?

While blocking ports on your firewall can enhance security, it's important to consider potential risks. Blocking essential ports or misconfiguring your firewall rules can unintentionally disrupt legitimate network traffic. It's crucial to thoroughly assess your network requirements and ensure that you only block ports that are unnecessary or pose a significant security risk. It's recommended to regularly review and update your firewall settings to maintain a balance between security and functionality.

4. Should I block all ports on my firewall?

Blocking all ports on your firewall is not practical or advisable. Different services and applications require specific ports to function correctly. Completely blocking all ports would render your network inaccessible. It's essential to carefully evaluate your network requirements and consider the potential security risks associated with each port before deciding which ones to block. Consult with a network security professional or IT specialist to determine an effective port blocking strategy for your specific needs.

5. How can I determine which ports to block on my firewall?

Determining which ports to block on your firewall requires a comprehensive understanding of your network infrastructure, the services you use, and potential security threats. Conducting a thorough risk assessment, evaluating the necessity of each port, and staying informed about current security vulnerabilities can help you make informed decisions. It's also recommended to consult with network security experts or refer to industry guidelines for best practices in firewall configuration. Regular monitoring and adjustment of your firewall rules are crucial to maintaining a secure network environment.


In conclusion, when it comes to blocking ports on your firewall for security purposes, it is important to consider a few key factors. First and foremost, it is crucial to understand the potential risks and vulnerabilities associated with open ports. By blocking unnecessary ports, you can minimize the chances of unauthorized access and protect your network.

Additionally, it is recommended to regularly update your firewall's rule set and maintain a thorough understanding of your network's requirements. This includes regularly reviewing and assessing which ports need to be blocked and which ones need to remain open for essential communication. By striking the right balance between security and functionality, you can ensure that your network remains protected while allowing necessary traffic to flow freely.


Recent Post