Cybersecurity

What are common ports used by attackers?

Learn about the network ports most frequently targeted by cybercriminals and attackers, and understand why they're vulnerable to exploitation and compromise.

By Inventive HQ Team

Attackers overwhelmingly target a small set of well-known ports that expose remote-access and data services — chiefly 22 (SSH), 3389 (RDP), 445 (SMB), 23 (Telnet), 21 (FTP), and the database ports 3306 (MySQL), 1433 (MSSQL), 5432 (PostgreSQL), 6379 (Redis) and 27017 (MongoDB), alongside the high-volume web ports 80 (HTTP) and 443 (HTTPS). RDP on 3389 is the single most common initial-access vector for ransomware; SMB on 445 was the vector for the WannaCry and NotPetya outbreaks. The reason is efficiency: automated scanners like Nmap, masscan, and Shodan sweep the entire IPv4 internet in minutes, so any service left on its default port is discovered and probed almost immediately.

That is the summary an AI overview would give you. What it can't give you is the working reference below — a single table mapping each targeted port to its service, why attackers love it, and the specific hardening step that shuts it down — plus a clear rule for which ports should never touch the public internet at all. Bookmark the table; that is the part you will actually come back to.

Attackers scanning a range of network ports A scanning beam sweeps across a row of ports. Exposed remote-access and database ports light up in amber as the scanner passes; hardened ports stay grey. Automated scanners find exposed ports in minutes A single sweep probes every port; the risky ones answer back 22 SSH 445 SMB 3389 RDP 3306 MySQL 23 Telnet 5900 VNC 443 HTTPS Amber = high-value target left exposed · Blue = hardened service that can stay open

Understanding Network Ports and Attack Vectors

Network ports are the gateways through which services communicate over the internet. Each port number between 0 and 65535 represents a potential entry point into your systems, but not all ports are equally attractive to attackers. Understanding which ports are most commonly targeted by cybercriminals is essential for developing effective network security strategies.

Security researchers consistently find that attackers focus their efforts on a relatively small set of well-known ports. This concentrated approach allows them to use vulnerability scanners and automated tools to rapidly identify and exploit exposed services across thousands of systems. By understanding which ports attract the most attention, organizations can prioritize their defensive measures and allocate security resources more effectively.

Commonly Targeted Ports at a Glance

The table below is the fast reference: each port attackers routinely target, the service behind it, why it draws fire, and the one hardening move that matters most. "Expose?" flags whether the port should ever be reachable from the public internet.

PortServiceWhy attackers target itKey hardening stepExpose to internet?
21FTPCredentials sent in plaintext; anonymous login often on by defaultReplace with SFTP/FTPS; disable anonymous accessNo
22SSHDirect shell access; mass-automated brute-force of weak/default credsKey-based auth + MFA, disable password & root login, fail2banOnly if hardened
23TelnetEverything (including passwords) sent in plaintext; legacy devicesDisable entirely; replace with SSHNever
25SMTPOpen-relay abuse, spam, spoofing, credential theftRequire auth + TLS; use 587/465 for submissionMail servers only
53DNSCache poisoning, DDoS amplification, hijackingDeploy DNSSEC; restrict recursion; rate-limitAuthoritative only
80HTTPWeb-app exploits (SQLi, XSS); traffic is unencryptedRedirect to HTTPS; front with a WAFYes (redirect)
110 / 143POP3 / IMAPPlaintext mailbox credentials on legacy configsEnforce TLS (995/993); disable plaintext authMail servers only
443HTTPSUniversal web port; app flaws, TLS bugs (e.g. Heartbleed), cert abuseModern TLS config, patch promptly, WAFYes
445SMBEternalBlue/WannaCry/NotPetya; file-share access & lateral movementDisable SMBv1; block at perimeter; patch (MS17-010)Never
1433MSSQLDirect database access; brute-force sa; data theft & ransomwareFirewall allow-list; no internet exposure; strong authNever
3306MySQLExposed DBs found in hours by Shodan; data exfiltration & wipingBind to localhost/VPN; firewall allow-listNever
3389RDP#1 ransomware entry point; credential brute-force, full desktop controlVPN/RD Gateway + NLA + MFA; lock to known IPsNever
5432PostgreSQLSame class as MySQL: direct data access, automated scanningRestrict listen_addresses; VPN + allow-listNever
5900VNCOften no/weak auth; full remote screen controlTunnel over SSH/VPN; require strong authNever
6379RedisHistorically no auth by default; RCE via config abuseRequire auth, bind to localhost, protected-mode onNever
27017MongoDBDefault no-auth instances mass-breached and ransomedEnable auth; bind to private interfaces onlyNever
Loading interactive tool...
Advertisement

The Top Three Most Targeted Ports

According to research from Alert Logic and other major cybersecurity firms, three ports account for approximately 65% of all port-based vulnerability attempts: Port 22 (SSH), Port 80 (HTTP), and Port 443 (HTTPS).

Port 22 - SSH (Secure Shell)

SSH is used for remote administration and secure command-line access to systems. Despite being designed for security, Port 22 is one of the most frequently attacked ports globally because:

  • Organizations often expose SSH directly to the internet for remote administration
  • Many systems run SSH with weak default credentials or outdated versions
  • Brute-force attacks on SSH are highly automated and readily available
  • Successful SSH compromise gives attackers direct system access

Common attacks on Port 22 include dictionary attacks, brute-force password attempts, and exploits targeting vulnerable SSH server versions. Organizations that run SSH should implement strict access controls, use key-based authentication, disable password authentication, change the default port, and maintain up-to-date software.

Port 80 - HTTP (Hypertext Transfer Protocol)

Port 80 is the standard port for unencrypted web traffic. Attackers target this port to:

  • Exploit web application vulnerabilities such as SQL injection or cross-site scripting (XSS)
  • Conduct man-in-the-middle attacks on unencrypted traffic
  • Deface websites
  • Distribute malware
  • Perform credential harvesting

Since HTTP traffic is unencrypted, attackers can intercept and modify data in transit. This makes Port 80 an attractive target for credential theft and malware distribution. The primary defense is migrating entirely to HTTPS and implementing web application firewalls.

Port 443 - HTTPS (Hypertext Transfer Protocol Secure)

Despite encryption, Port 443 remains heavily targeted because:

  • It's the standard port for encrypted web traffic, making it harder for firewalls to block
  • SSL/TLS vulnerabilities like Heartbleed have historically existed
  • Man-in-the-middle attacks can compromise the SSL handshake
  • Compromised certificates can enable attackers to intercept encrypted traffic

The fact that HTTPS is encrypted doesn't eliminate all risks. Attackers still target the protocol itself, the certificate infrastructure, and the underlying web applications.

Other Frequently Targeted Ports

Beyond the top three, several other ports attract significant attack traffic:

Port 21 - FTP (File Transfer Protocol)

FTP is one of the oldest internet protocols and remains vulnerable because:

  • It transmits credentials in plain text
  • Anonymous authentication is often enabled by default
  • Directory traversal vulnerabilities are common
  • It's deprecated in favor of SFTP and SCP

FTP usage should be eliminated entirely. Organizations needing file transfer capabilities should use SFTP (SSH File Transfer Protocol) on Port 22 or HTTPS-based file transfer services.

Port 23 - Telnet

Telnet is fundamentally insecure because all traffic, including authentication credentials, travels in plain text. It's largely obsolete but still targeted on legacy systems. Telnet should be completely disabled and replaced with SSH.

Port 25 - SMTP (Simple Mail Transfer Protocol)

SMTP on Port 25 is vulnerable to:

  • Email spoofing attacks
  • Phishing and spam relay attacks
  • Credential theft during authentication
  • Open relay exploitation

Modern mail systems should use SMTP with authentication and encryption (Port 587 for submission or Port 465 for SMTPS).

Port 53 - DNS (Domain Name System)

DNS serves as the infrastructure for domain name resolution and is targeted for:

  • DNS cache poisoning attacks
  • Distributed Denial of Service (DDoS) attacks
  • DNS spoofing and hijacking
  • DNS amplification attacks

Protecting DNS requires implementing DNSSEC, limiting DNS query sources, using DNS-over-HTTPS (DoH), and monitoring for anomalous query patterns.

Port 445 - SMB (Server Message Block)

SMB is used for file sharing and printer access on Windows networks. It became infamous during the WannaCry and NotPetya ransomware attacks through the EternalBlue vulnerability. Port 445 should:

  • Never be exposed to the internet
  • Be protected behind firewalls and VPNs
  • Run the latest patched versions
  • Have strong access controls

Port 3306 - MySQL

MySQL databases exposed on Port 3306 are frequently targeted for:

  • Direct database access without web application layers
  • Data theft and exfiltration
  • Destructive attacks on database contents
  • Lateral movement through database privileges

Databases should never be directly exposed to the internet. Use network segmentation and firewall rules to restrict access.

Port 3389 - RDP (Remote Desktop Protocol)

RDP enables remote desktop access to Windows systems but is heavily targeted through:

  • Brute-force attacks on weak credentials
  • Exploitation of RDP vulnerabilities
  • Credential theft through compromised RDP clients
  • Ransomware deployment after RDP compromise

RDP should be protected with network-level authentication, strong passwords, multi-factor authentication, and port forwarding through bastion hosts.

Why Attackers Focus on Specific Ports

Attackers concentrate on these ports because:

High-Value Services: These ports provide access to critical services like web applications, file transfer, and remote administration that can give attackers significant control.

Automation: Well-known ports can be scanned and exploited using readily available automated tools. Attackers can scan thousands of IP addresses quickly to find exposed services.

Public Facing: These ports are often exposed directly to the internet, making them accessible without advanced reconnaissance. Organizations frequently misconfigure firewalls or expose services unnecessarily.

Known Vulnerabilities: The software running on these ports (Apache, nginx, OpenSSH, Windows RDP) has extensive historical vulnerability databases that attackers can exploit.

Low Hanging Fruit: Systems running these services often have outdated software, weak credentials, or default configurations that make exploitation trivial.

Defensive Strategies

To protect against port-based attacks:

Network Segmentation: Don't expose services to the internet unless absolutely necessary. Use firewalls, network ACLs, and VPNs to restrict access.

Service Hardening: Keep software updated, disable unnecessary services, use strong authentication, and implement the principle of least privilege.

Port Changes: Change services from default ports (SSH on 2222 instead of 22) to reduce automated scanning effectiveness.

Monitoring: Monitor logs for connection attempts to restricted ports and unusual activity patterns.

Encryption: Use encrypted protocols (HTTPS, SFTP, SSH) instead of unencrypted alternatives.

Access Control: Implement multi-factor authentication, IP whitelisting, and network segmentation.

Vulnerability Management: Maintain an inventory of exposed ports, regularly scan for vulnerabilities, and remediate findings promptly.

Conclusion

Understanding which network ports attract the most attack traffic allows organizations to focus their limited security resources on the highest-impact defenses. While Port 22, 80, and 443 account for the majority of attacks, organizations must also secure the full range of services running on their networks. The most effective defense combines network segmentation, service hardening, access control, and continuous monitoring to detect and respond to attack attempts before they succeed.

Frequently Asked Questions

What ports do hackers attack the most?

Attackers concentrate on a small set of well-known ports that expose remote-access and data services: 22 (SSH), 3389 (RDP), 445 (SMB), 23 (Telnet), 21 (FTP), and the database ports 3306 (MySQL), 1433 (MSSQL), 5432 (PostgreSQL), 6379 (Redis) and 27017 (MongoDB). Web ports 80 (HTTP) and 443 (HTTPS) also see huge volume because almost everything runs on them. RDP on 3389 is consistently the single most common entry point for ransomware, and SMB on 445 was the vector for WannaCry and NotPetya. Automated scanners sweep the entire internet for these defaults within minutes of a service going live.

Which ports should never be exposed to the internet?

Remote-administration and database ports should almost never face the public internet: 3389 (RDP), 445 (SMB), 23 (Telnet), 5900 (VNC), 3306 (MySQL), 1433 (MSSQL), 5432 (PostgreSQL), 6379 (Redis) and 27017 (MongoDB). These give direct access to systems or data with no application layer in front of them, and exposed instances are found and attacked within hours. Put them behind a VPN, a bastion/jump host, or a zero-trust access proxy, and restrict them with firewall allow-lists so only known IP addresses can reach them.

Is it safe to leave port 22 (SSH) open to the internet?

SSH on port 22 can be exposed safely, but only if it is properly hardened. Disable password authentication entirely and use key-based (or certificate-based) authentication, disable root login, enforce multi-factor authentication, and rate-limit connections with a tool like fail2ban. An unhardened SSH server on port 22 will receive thousands of automated brute-force attempts per day. Where possible, keep SSH behind a VPN or bastion host rather than open to the whole internet.

Does changing the default SSH port actually improve security?

Moving SSH off port 22 (for example to a high random port) meaningfully cuts the volume of automated scanning and brute-force noise, because most mass scanners only probe the default. But it is obscurity, not security — a targeted attacker will find the new port in seconds with a full port scan. Treat a port change as noise reduction that makes your logs cleaner, and always pair it with the real controls: key-based auth, MFA, and firewall allow-listing.

Why is RDP (port 3389) considered so dangerous?

RDP on port 3389 gives full graphical control of a Windows machine, so a single compromised credential can hand an attacker the whole desktop. It is the number-one initial-access vector for ransomware: attackers buy or brute-force RDP credentials, log in, disable defenses, and deploy ransomware manually. Exposed RDP is trivially found by scanners like Shodan. Never expose 3389 directly — require a VPN or RD Gateway, enforce Network Level Authentication and MFA, and lock it to known source IPs.

What port did the WannaCry ransomware use?

WannaCry spread through port 445 (SMB) in May 2017, exploiting the EternalBlue vulnerability (MS17-010) in Microsoft's SMBv1 implementation. NotPetya used the same SMB vector a month later. This is why port 445 should never be reachable from the internet and why SMBv1 should be disabled entirely on modern networks. Keep SMB internal, patched, and segmented behind firewalls.

How do attackers find open ports on my systems?

Attackers use port scanners such as Nmap and masscan, plus internet-wide search engines like Shodan and Censys that continuously catalog every exposed service. A scanner sends probe packets to a range of ports and records which ones respond, revealing what services you are running and often their exact versions. Mass scanning of the entire IPv4 internet takes only minutes, so any service you expose is discovered almost immediately — there is no meaningful window of being "too obscure to find."

Are open ports always a security risk?

An open port is only a risk if a vulnerable, misconfigured, or unnecessary service is listening behind it. A patched, hardened, authenticated service on an open port can be perfectly safe — that is how the entire web works on ports 80 and 443. The real risks are unnecessary services left running, unpatched software with known CVEs, weak or default credentials, and unencrypted protocols like Telnet and FTP. Close ports you do not need, and harden the ones you do.

network securityportsattack vectorsvulnerability management