Network security

How to Secure Open Ports: A Practical Checklist for Home and Business

Every open port is a door into your network — and attackers scan for them constantly. Here is how to find yours, close the ones you don't need, and lock down the rest.

Cysoro Security TeamPublished · 7 min read
firewall — port scan 22 ssh OPEN80 http OPEN443 https OPEN3389 rdp OPEN !23 telnet OPEN !445 smb FILTERED 2 ports need attention default: DENY inbound 443 — keep, harden NETWORK SECURITY Secure openports Close what you don't need.
Quick answer

To secure open ports, inventory everything listening on your network, close or block every port no service needs, and harden the ones that must stay open with a firewall, strong authentication, and patching. Never expose management interfaces such as RDP, SSH, SMB, or Telnet directly to the internet. Re-scan regularly, because new software and updates open new ports.

Key takeaways

  • An open port is only as safe as the service behind it and who can reach it.
  • Close what you do not need, restrict what you keep to trusted addresses, and patch it.
  • Never expose RDP, SMB, Telnet, or other management interfaces directly to the internet.

Attackers do not guess where your network is weak — they scan for it. Automated tools probe millions of addresses every day, looking for open ports: the doors that let traffic into your computers, servers, and routers.

What is an open port?

An open port is a port where a service is listening and accepting connections. TCP and UDP use 16-bit port numbers, from 0 to 65535, to deliver traffic to the right process on a host. IANA divides them into system ports (0 to 1023), registered ports (1024 to 49151), and dynamic or private ports (49152 to 65535).

Think of your computer as a building and ports as its doors. Port 443 is the front door for a website. Port 22 is the service entrance for remote administration. A port is "open" when someone is standing behind that door, ready to answer.

Security tools usually report a port in one of three states: open (a process is listening and the connection is accepted), closed (the host is reachable but nothing listens), or filtered (a firewall drops the traffic before it reaches the host). Only "open" means a service is exposed — but "filtered" is the state you want for anything you do not need to expose.

Why are open ports a security risk?

Every open port means some code is parsing data from the network. If that code has a vulnerability, anyone who can reach the port can try to use it. That is why vulnerability catalogs such as CISA's Known Exploited Vulnerabilities list are full of network-facing products: VPN gateways, remote access tools, web servers, and file transfer software.

The risk depends on three things: which service is listening, who can reach it, and whether the service is patched, authenticated, and encrypted. The same open port can be low risk on a private subnet and high risk on the internet — so always assess reachability, not just the port number.

Older protocols make the problem worse. Telnet, FTP, and plain HTTP send data, sometimes including passwords, in clear text. Anyone on the network path can read it. Replace them with SSH, SFTP, and HTTPS, which encrypt the same work.

Which ports are most dangerous when exposed?

Some ports deserve attention in every security review. CISA lists several of these among the services commonly exploited in ransomware campaigns, and its Binding Operational Directive 23-02 requires federal agencies to remove management interfaces from the public internet entirely.

PortServiceWhy it is risky when exposed
23TelnetCleartext login credentials that anyone on the path can capture
21FTPCleartext credentials and data; often uses default passwords
22SSHBrute-force target; safe only with keys and MFA
139 / 445SMBFile sharing used to spread malware; SMBv1 is cleartext
3389RDPTop ransomware entry point via weak or stolen credentials
5900VNCRemote desktop, often unencrypted and weakly protected
3306 / 5432MySQL / PostgreSQLDatabases should never face the internet directly

CISA's ransomware guidance is blunt about RDP: attackers typically gain access through port 3389 using weak or compromised credentials, and the fix is multi-factor authentication plus closing unused RDP ports. CISA's list of misconfigurations used in ransomware campaigns covers RDP, FTP, Telnet, SMB, and VNC — and the same logic applies to every management interface in the table: if it administers a system, it should not face the internet.

How do you find open ports on your network?

You cannot secure what you have not inventoried. A proper check has two views: what is listening on each machine, and what the outside world can actually reach.

Finding open ports: check from both sides Inside view: what listens? • List listening services on each host • Note the port, the service, and the owner • Ask: does this service need to run? Tools: ss, netstat, your EDR console Outside view: what is reachable? • Scan your public IP from outside • Anything open here is internet-exposed • Compare with the inside list Tools: Nmap, an external scanner If a port is open outside but nobody can explain why, treat it as an incident.
Check open ports from inside and outside the network. Illustration by Cysoro.

Step 1: list what is listening

On each server and workstation, list the services that are listening for connections, along with their port numbers and the accounts that run them. On Linux, ss -tulpn gives you this in one command; on Windows, netstat -ano does the same. Write down every entry and its business reason.

Step 2: scan from the outside

Run a port scan against your public IP addresses from a machine outside your network. Anything the scan finds open is exposed to the entire internet, including to the automated scanners that probe every address daily. You can start by finding your public address with our free what is my IP tool.

Step 3: check cloud firewalls too

On-premises hosts are only half the picture. Review cloud security groups, network ACLs, and load balancer rules — a single overly broad rule, such as allowing port 22 from 0.0.0.0/0, can expose every server behind it. Document each rule and who approved it.

How to secure open ports: the checklist

Work through these steps in order. The goal is not to close every port — it is to keep required services available while removing unnecessary exposure, hardening weak services, and monitoring the ports that must stay open.

  1. Close what you do not need. Stop the service or disable the port. Unused services from old installs, debug tools, and forgotten test servers are the most common findings.
  2. Block at the firewall. Set a default-deny rule: block all inbound traffic, then allow only what is explicitly approved. Every allow rule should name the port, the source, and the reason.
  3. Restrict what you keep. Limit SSH and RDP to trusted IP addresses or a VPN. Management interfaces belong on an internal management network, never on the public internet.
  4. Patch everything listening. Prioritize internet-facing services, and check CISA's Known Exploited Vulnerabilities catalog first — if a service you expose is on it, patching is urgent.
  5. Require strong authentication. Use key-based login for SSH, MFA for RDP and VPNs, and unique, long passwords everywhere. Disable default credentials.
  6. Encrypt the traffic. Replace Telnet with SSH, FTP with SFTP, and HTTP admin panels with HTTPS. Disable SMBv1 and use SMBv3 with signing.
  7. Log and alert. Log connection attempts to open ports and alert on anomalies, such as a sudden burst of login failures or a new listening service.
  8. Re-scan regularly. Schedule a monthly external scan and repeat it after every change. Exposure drifts back unless someone keeps checking.

How do you harden ports that must stay open?

Some ports have to stay open: 443 for a website, 25 for a mail server, 22 for remote administration of a server you manage. For those, the work is hardening, not closing.

Hardening a port that must stay open 1 Restrict sources allow-list IPs or require a VPN 2 Patch and update latest version, KEV first 3 Strong auth keys, MFA, no defaults Then encrypt the traffic and alert on failed logins and unusual volumes.
Three hardening steps for any port that must remain open. Illustration by Cysoro.

For SSH (port 22): disable password login and root login, use key-based authentication, and consider changing the port only as an extra layer — never as the only defense, since scanners find non-standard ports quickly.

For RDP (port 3389): do not expose it at all if you can avoid it. Put it behind a VPN or gateway, enforce MFA and account lockout after failed attempts, and log every login. CISA's ransomware guidance recommends exactly this.

For web ports (80 and 443): keep the web server and its frameworks patched, use TLS 1.2 or 1.3 only, and add a web application firewall if the site takes input. Check your headers with our security headers checker.

For databases (3306, 5432, 1433): bind them to localhost or a private network, and reach them only through an application server or VPN. A database that answers the internet directly is a breach waiting to happen.

What about open ports on a home router?

Home networks have the same problem on a smaller scale. The usual culprits are port forwarding rules set up for games, cameras, or remote access and then forgotten — plus UPnP, which lets devices open ports on your router automatically.

  • Turn off UPnP unless you have a specific device that needs it, and review the forwarding table after every change.
  • Delete forwarding rules for devices you no longer use, especially cameras, DVRs, and old game consoles.
  • Keep router firmware updated and change the default admin password. A router with a default password is an open door, not a firewall.
  • Use your router's firewall and check it blocks inbound connections by default. Our guide to securing your Wi-Fi covers the router settings that matter most.

Common mistakes when securing open ports

These errors show up again and again in incident reports, and all of them are avoidable.

  • Security by obscurity. Moving SSH from port 22 to port 2222 slows down casual scans by minutes, not days. Use real authentication instead.
  • Forgetting the cloud. A locked-down office network means little if a cloud security group exposes a database to the world.
  • Opening ports for a test and never closing them. Temporary rules become permanent unless someone owns the cleanup.
  • Trusting "filtered" forever. Firewall rules change. Re-scan, because a rule that was filtered last month may be open today.
  • Ignoring outbound rules. Blocking inbound traffic is only half the job. Restricting outbound traffic limits what stolen data can leave and what malware can download.

The bottom line

Open ports are not the enemy — unmanaged ones are. Inventory what listens, close what you do not need, restrict and harden what you keep, and re-scan on a schedule. That routine alone removes the entry point behind a large share of ransomware and espionage intrusions.

Start today: list your listening services, run an external scan, and close the first unnecessary port you find. If you want continuous visibility into what your organization exposes, Cysoro's attack surface management platform watches for new exposures as they appear.

Frequently asked questions

What is an open port?

An open port is a numbered endpoint on a computer where a service is listening and accepting connections. TCP and UDP use 16-bit port numbers from 0 to 65535. When a port is open, software on that port can receive data from anyone who can reach it.

Are open ports dangerous?

Not by themselves. The risk depends on which service is listening, who can reach it, and whether that service is patched, authenticated and encrypted. An open port on a private network is far less risky than the same port exposed to the internet.

How do I find open ports on my network?

Scan from outside with a port scanner such as Nmap, and check locally with commands like ss or netstat that list listening services. Compare the two views: anything the outside scan sees is exposed to the internet.

Should I close port 80 and 443?

No, if you run a public website. Ports 80 (HTTP) and 443 (HTTPS) are how websites work. The goal is not to close every port, but to close the ones no service needs and to protect the ones that must stay open.

Is it safe to expose RDP to the internet?

No. CISA lists RDP on port 3389 among the services commonly exploited in ransomware campaigns, usually through weak or compromised credentials. Put RDP behind a VPN, restrict it to trusted addresses, and require multi-factor authentication.

What is the difference between open, closed and filtered ports?

Open means a service is listening and accepts connections. Closed means the host is reachable but nothing listens on that port. Filtered means a firewall blocks the traffic before it reaches the host, so a scanner cannot tell whether a service is there.

How often should I check for open ports?

At least monthly, and after every software install, update, or firewall change. New software and updates can open ports you did not know about, so regular re-scanning catches drift before an attacker does.

Does a firewall close open ports?

A firewall does not close a port on the host, but it can block traffic to it so the port is not reachable from outside. The strongest approach is both: stop the service you do not need, and block the port at the firewall.

Sources

  1. CISA — BOD 23-02: Mitigating the Risk from Internet-Exposed Management Interfaces
  2. CISA — Misconfigurations and Weaknesses Known to be Used in Ransomware Campaigns
  3. Huntress — Guide to System Hardening: Checklist and Best Practices
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against CISA's BOD 23-02 guidance on internet-exposed management interfaces and CISA's ransomware misconfigurations list.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free