NetSec Atlas

Common Network Ports Cheat Sheet: TCP/UDP Numbers Admins Should Know

NetSec Atlas Team · · 5 min read

Common Network Ports Cheat Sheet: TCP/UDP Numbers Admins Should Know

The ports you meet daily, grouped by web, mail, Active Directory, remote admin and databases, plus commands to list listening ports on Windows and Linux.

Every firewall rule, packet capture and incident ticket eventually comes down to a port number. This cheat sheet lists the ports network and security teams meet most often, what normally runs on them, and what to watch for when you see them open where they shouldn't be.

Port numbers are assigned by IANA. The ranges are: well-known ports 0–1023, registered ports 1024–49151, and dynamic or private ports 49152–65535 (RFC 6335). A service can run on any port, so a number is a hint, not proof of what is listening.

Remote access and administration

PortProtocolServiceSecurity note
22TCPSSH, SFTP, SCPKeys instead of passwords; never expose to the internet without restrictions
23TCPTelnetCleartext; disable it everywhere
3389TCP/UDPRDPHeavily brute-forced; publish only through a gateway or VPN
5900TCPVNCOften weakly protected; keep internal
5985 / 5986TCPWinRM over HTTP / HTTPSRestrict to admin networks

Web and email

PortProtocolServiceSecurity note
80TCPHTTPRedirect to HTTPS
443TCPHTTPS; also many VPNsUDP 443 carries HTTP/3 (QUIC)
25TCPSMTP between mail serversBlock outbound from user devices
465TCPSMTP submission over implicit TLS
587TCPSMTP submission (STARTTLS)Require authentication
110 / 995TCPPOP3 / POP3 over TLSPrefer the TLS port
143 / 993TCPIMAP / IMAP over TLSPrefer the TLS port

Core network services

PortProtocolServiceSecurity note
53UDP/TCPDNSTCP is needed for large answers and zone transfers
67 / 68UDPDHCP server / clientUse DHCP snooping on access switches
123UDPNTPAccurate time is essential for logs
161 / 162UDPSNMP / SNMP trapsUse SNMPv3; v1/v2c send community strings in clear
514UDPSyslogCleartext; RFC 5425 defines syslog over TLS on 6514
1812 / 1813UDPRADIUS authentication / accountingOlder gear may use 1645/1646
49TCPTACACS+Device administration AAA

Windows and Active Directory

PortProtocolServiceSecurity note
88TCP/UDPKerberosDomain controllers only
135TCPRPC endpoint mapperDynamic RPC then uses 49152–65535
137–139UDP/TCPNetBIOSLegacy; disable where possible
389 / 636TCPLDAP / LDAPSPrefer signing and LDAPS
445TCPSMBNever expose to the internet
3268 / 3269TCPGlobal Catalog / over TLS

Databases and infrastructure

PortServiceSecurity note
1433Microsoft SQL ServerKeep on server networks only
3306MySQL / MariaDB
5432PostgreSQL
6379RedisHistorically shipped without authentication by default
9200Elasticsearch HTTP APIFrequently found exposed in breaches
27017MongoDBSame story as Redis and Elasticsearch
2049NFS
500 / 4500IKE / IPsec NAT traversal (UDP)Needed for site-to-site and IPsec remote access

How to check what is really listening

On Windows, Get-NetTCPConnection -State Listen lists listening sockets with their owning process ID; add Get-Process -Id <pid> to name the program. Test-NetConnection server -Port 443 checks reachability from a client.

On Linux, ss -tulpn shows listening TCP and UDP sockets with processes. From another machine, an authorised scan with Nmap tells you what is reachable across the network; our Nmap guide covers safe usage.

Seeing an unexpected port? Identify the process before assuming malware: backup agents, monitoring tools and printers open odd ports all the time. If the owning process makes no sense, treat it as an incident.

Turning this into firewall policy

  1. Start from default deny between zones.
  2. Allow by service and destination, not "any".
  3. Keep admin ports (22, 3389, 5985/5986, SNMP) reachable only from a management network.
  4. Log denies at zone boundaries and review them; scanning patterns show up quickly.

For the bigger picture, see firewall misconfigurations to audit and Windows Firewall advanced rules.

FAQ

Does closing a port make a service secure?

It removes exposure from that path. The service still needs patching and authentication, because attackers who get inside can reach it from other directions.

Why does RDP show both TCP and UDP 3389?

Modern RDP clients use UDP for better performance when available and fall back to TCP.

Is changing SSH or RDP to a non-standard port worth it?

It reduces noise from automated scans but is not a security control. Restrict access by source and require strong authentication.

References

  • #ports
  • #tcp
  • #udp
  • #firewall
  • #cheat-sheet

Related articles