Cybersecurity · Reference sheet

Common Ports & Protocols

A quick-reference map of the well-known TCP/UDP ports and the protocols behind them, which ones are insecure, and the encrypted services that replace them.

Download Word (.docx)

What ports and protocols are

Every networked service speaks a protocol, an agreed set of rules for how two machines exchange data, and listens on a port, one of 65,536 numbered doorways (0 to 65535) on a host. If an IP address is the street address of a building, the port is the specific door, and the protocol is the language spoken behind it. When your browser loads a secure site, it connects to port 443 and speaks HTTPS. Memorizing the standard port-and-protocol pairs is core security literacy. It lets you read firewall rules, tell normal traffic from suspicious traffic, and spot dangerous misconfigurations at a glance. Seeing Telnet on port 23, or a database quietly exposed on 3306 to the open internet, is an immediate red flag.

Well-known ports: web, remote access & network services

The ports you will meet most often when reading firewall rules or captured traffic. The transport column tells you whether the service rides on TCP, UDP, or both.

PortService & what it doesTransport
20-21FTP: file transfer. Login and data travel in cleartext (insecure).TCP
22SSH: encrypted remote shell, plus SFTP/SCP file transfer and tunneling.TCP
23Telnet: remote terminal login. Everything is cleartext (insecure).TCP
53DNS: resolves hostnames to IP addresses.UDP/TCP
67-68DHCP: auto-assigns IP configuration (server 67, client 68).UDP
69TFTP: minimal file transfer with no authentication (insecure).UDP
80HTTP: web pages sent in cleartext (insecure).TCP
123NTP: synchronizes device clocks across the network.UDP
443HTTPS: HTTP encrypted with TLS. The secure web.TCP
3389RDP: Windows Remote Desktop graphical login.TCP

The number is a convention, not proof

Standard ports are an agreement, not a law. Any service can be told to listen on any port, so seeing traffic on port 80 is not proof it is really HTTP. Attackers hide services on odd ports, and defenders sometimes move SSH off 22 to cut scanning noise. Always verify the actual protocol, never trust the number alone. Modern HTTPS can even run over UDP 443 as HTTP/3 (QUIC).

Well-known ports: email, directory & databases

Mail, directory, monitoring, and database services. Notice how each cleartext mail protocol has an encrypted twin on a different port.

PortService & what it doesTransport
25SMTP: mail server to mail server delivery.TCP
110POP3: downloads mail from the server to one device.TCP
143IMAP: reads and syncs mail that stays on the server.TCP
161-162SNMP: monitors and manages network devices (161 polls, 162 receives traps).UDP
389LDAP: directory lookups for users, groups, and devices.TCP
465 / 587SMTP submission: a mail client sending outbound mail, 465 over implicit TLS or 587 with STARTTLS.TCP
993IMAPS: IMAP encrypted with TLS.TCP
995POP3S: POP3 encrypted with TLS.TCP
3306MySQL / MariaDB database server.TCP
5432PostgreSQL database server.TCP

Port number ranges

IANA, the body that coordinates port numbers, splits all 65,536 ports into three ranges.

RangeWho binds itCategory
0-1023Core, standardized services. Binding one usually requires admin or root privileges.Well-known
1024-49151Vendor and application services registered with IANA, such as MySQL 3306 and RDP 3389.Registered
49152-65535Temporary source ports the OS assigns to outbound client connections. Free for private use.Dynamic

Why the split matters

Because binding a well-known port (under 1024) needs elevated privileges, a service answering on a low port was started by an administrator or root. A rogue program a normal user runs can only grab a high, ephemeral port. That detail helps you reason about how much access an attacker would have needed to open a given listener.

TCP vs UDP

Almost every protocol rides on one of two transport protocols. TCP (Transmission Control Protocol) opens a connection with a three-way handshake (SYN, then SYN-ACK, then ACK) and then guarantees that every byte arrives in order, resending anything lost. UDP (User Datagram Protocol) just fires packets off with no handshake and no guarantee, trading reliability for speed and low overhead. A file download or a login session needs TCP, because one missing byte would corrupt it. A live voice call or a DNS lookup prefers UDP, because it is faster and a single lost packet is cheaper to ignore than to wait for.

PropertyTCPUDP
ConnectionConnection-oriented, 3-way handshakeConnectionless, just send
ReliabilityGuaranteed delivery, retransmits lossBest-effort, no retransmission
OrderingReassembled in orderNo ordering guarantee
OverheadHigher, more control dataMinimal, lightweight
Error handlingAcknowledgements + flow controlChecksum only
Typical usesHTTP/S, SSH, email, file transferDNS, DHCP, VoIP, streaming, NTP, games

DNS uses both

DNS answers ordinary queries over UDP port 53 for speed, but it switches to TCP port 53 when a response is too big for a single UDP packet or during a zone transfer between servers. That is why firewall rules for DNS usually allow both transports.

Insecure protocols and their secure replacements

These legacy protocols send data, and often passwords, as readable text. Each has a modern encrypted replacement. Knowing the pairs lets you flag risky services and recommend the fix.

Insecure protocolThe riskSecure replacement
Telnet (23)Sends usernames, passwords, and every keystroke in plaintext. Anyone sniffing the network reads them.SSH (22)
FTP (20-21)Credentials and file contents travel unencrypted.SFTP (22) / FTPS
HTTP (80)Pages and form data, including passwords, sent in the clear.HTTPS (443)
POP3 (110)Mailbox login and downloaded messages unencrypted.POP3S (995)
IMAP (143)Mailbox login and synced messages unencrypted.IMAPS (993)
SMTP (25, plain)Mail relayed with no encryption between hops.SMTP+STARTTLS (587)
SNMP v1 / v2cCommunity strings act as passwords but are sent in plaintext.SNMPv3
TFTP (69)No authentication and no encryption at all.SCP / SFTP (22)

Never send secrets over cleartext protocols

Never type a username, password, or anything sensitive over Telnet, FTP, or plain HTTP, especially on shared Wi-Fi. These protocols transmit everything as readable text, so anyone capturing the traffic sees your credentials instantly. Reach for the encrypted replacement every single time.

Inspecting ports on a host

Defenders constantly ask two questions: what ports is this machine listening on, and does each open port belong there? These commands answer that. Run them against your own machine or a lab VM to build the habit of auditing your attack surface.

CommandWhat it doesExample
ss -tulnSocket Statistics - list listening TCP and UDP ports, numeric with no name lookup (-t TCP, -u UDP, -l listening only, -n numeric).ss -tuln
sudo ss -tulnpSocket Statistics run as root - the same listing plus the process and PID that owns each port (-p adds the owning process, and sudo lets you see processes you do not own).sudo ss -tulnp
netstat -tulnNetwork Statistics - older tool that lists the same listening TCP/UDP ports on many systems (-t TCP, -u UDP, -l listening only, -n numeric).netstat -tuln
lsof -i :PORTLiSt Open Files (on Unix a network socket counts as an open file) - show which process is using one specific port (-i selects internet/network files).sudo lsof -i :443
getent servicesGET ENTries - resolve a port number to its registered service name from /etc/services, or the reverse.getent services ssh
nc -zvNetCat - test whether a single TCP port is open and reachable (-z scans without sending data, -v is verbose so it prints the result).nc -zv example.com 443
nmap -pNetwork MAPper - inventory open ports across hosts you are authorized to scan (-p selects which ports to probe).nmap -p 22,80,443 192.168.1.10
# -t TCP, -u UDP, -l listening only, -n numeric so it skips slow name lookups
$ ss -tuln
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* tcp LISTEN 0 511 0.0.0.0:80 0.0.0.0:* tcp LISTEN 0 511 0.0.0.0:443 0.0.0.0:* udp UNCONN 0 0 0.0.0.0:53 0.0.0.0:*
# This host serves SSH (22), HTTP (80), HTTPS (443), and a DNS resolver (53).
$ getent services 22/tcp
ssh 22/tcp
# The file /etc/services maps port numbers to their registered protocol names.
Auditing which ports your own machine is listening on

Registered name vs everyday acronym

The name getent shows comes from /etc/services, which uses IANA's registered name, and that is not always the acronym you know. Port 53 shows up as domain, not DNS, and 3389 shows as ms-wbt-server, not RDP. The port number is the reliable identifier, so match on the number first and treat the name as a hint.

Scan only what you are allowed to

Only scan hosts you own or have explicit written permission to test. Port-scanning someone else's systems without authorization can be a crime under laws like the U.S. Computer Fraud and Abuse Act, even if you change nothing. Practice on your own machine, a lab VM, or a sanctioned cyber range.

Try it yourself

The saved output of ss -tuln from a fictional school lab server: a header line, then one line per listening socket. Every address in it is the wildcard 0.0.0.0, loopback, or a private network address, so nothing in the file points at a real computer.

Get to the file first

Your browser saves the file to your Downloads folder. Move it into a labs folder and go there: mkdir -p ~/labs && mv ~/Downloads/listening-ports.txt ~/labs/ && cd ~/labs Then run cat listening-ports.txt to see it. On WSL, your Windows Downloads folder is /mnt/c/Users/<your-name>/Downloads instead of ~/Downloads.

Using listening-ports.txt and the tables on this sheet, answer each question. Where a command helps, write ONE command using pipes. Column 5 is Local Address:Port: awk '{print $5}' prints it, cut -d: -f2 keeps just the port, and tail -n +2 skips the header line. 1. How many TCP sockets are in the LISTEN state? ( grep -c ) 2. Exactly one port number appears twice, once on a udp line and once on a tcp line. Which port is it, and which protocol from this sheet uses both transports on that port? ( awk, cut, sort -n, uniq -d ) 3. Two services accept connections only from the same machine, because they are bound to 127.0.0.1. Which two port numbers are they, and which database server does the Well-known ports table list for each? 4. One listening TCP port runs the protocol this sheet says sends every keystroke in plaintext and should be replaced by SSH. What port number is it, and what local address is it bound to? 5. How many different port numbers in the file fall in the well-known range, 0 to 1023? Count a port number once even if it appears on two lines. ( sort -nu, then awk '$1 < 1024', then wc -l ) Bonus: run ss -tuln on your own machine or lab VM and compare its listeners with this server's.