How to Stop Foreign Adversaries and Hackers: Protecting Open Listening Ports
Before we begin, it is important to understand a few fundamental concepts of the TCP/IP protocol.
1. What Is a Port? What Is a Listening Port?
TCP operates at the transport layer between the application layer and the Internet layer. TCP needs to identify which application is sending data and which application is receiving it. To accomplish this, TCP uses port numbers.
What is a listening port?
TCP communication is based on a client-server model. The client sends requests, while the server listens for and accepts requests on a designated port, delivering the received data to the appropriate application.
If there is no open listening port, TCP cannot deliver incoming data to an application, and the connection request will be rejected.
2. Remote Access Services Are Common Attack Targets
Hackers typically need access to services such as SSH, RDP, Telnet, VNC, or similar remote access servers to launch attacks against a system. Other services, such as email, web servers, or FTP servers, generally provide more limited opportunities for gaining direct control of a system.
3. Active TCP Sessions Are Difficult to Hijack
For an established TCP session, an attacker cannot easily inject packets into the communication because the attacker would need to correctly predict both the TCP sequence (SEQ) number and acknowledgment (ACK) number.
These values are 32-bit numbers that are initially generated and subsequently change according to session traffic, making successful guessing difficult.
Recommendations
Based on these principles and today's available security technologies, organizations can significantly reduce cyberattack risks by implementing the following measures:
1. Minimize Open Listening Ports
Systems should avoid exposing unnecessary listening ports. If a system has no open listening ports accessible from outside networks, opportunities for direct TCP/IP-based attacks are greatly reduced.
2. Restrict Access to Internal Networks
If a listening port is required, restrict access to internal private IP addresses whenever possible. This prevents most Internet-based attackers from reaching the service.
3. Avoid Exposing Remote Access Services
If Internet-facing listening ports are required, avoid exposing remote access services such as SSH, RDP, Telnet, VNC, or similar administrative services directly to the Internet whenever possible.
4. Secure Any Required Internet-Facing Remote Access Services
If Internet-facing remote access services are unavoidable, implement the following controls:
a. IP Allowlisting (Whitelist)
Restrict access to approved IP addresses only. Authorized users should use dedicated, non-shared IP addresses whenever practical.
b. Multi-Factor Authentication (MFA)
Require MFA for all remote access connections.
c. Device Verification
Verify that users are connecting from authorized and trusted devices.
d. Company-Owned VPN Services
Require users to connect through a company-managed VPN before accessing internal resources.
e. MPLS Layer 3 VPN for Branch Offices
For remote branch offices, consider using MPLS Layer 3 VPN (Multiprotocol Label Switching Layer 3 VPN) where feasible.
5. Continuously Monitor Internet Exposure
Organizations should actively monitor for unknown, unauthorized, or unnecessary listening ports exposed to the Internet and promptly investigate any unexpected findings.
Why Do Successful Attacks Still Occur?
One possible explanation is that cybersecurity has traditionally focused more on defending against external attackers than on mitigating insider threats.
I believe that a significant number of successful attacks may involve insiders or individuals with privileged access. In some cases, attackers may attempt to make incidents appear as though they originated solely from external Internet-based threats, while insider-related risks receive less attention.
Regardless of the exact proportion of insider involvement, preventing cyberattacks requires not only strong perimeter security but also system architectures designed to minimize risks from insiders.
This suggests that organizations should adopt a new generation of insider-safe system architecture that addresses both external threats and insider risks.
By reducing unnecessary network exposure, strengthening access controls, verifying users and devices, and implementing controls against insider misuse, organizations can significantly improve their overall cybersecurity posture.