Skip to content
Buy me a coffee

Ports

tag: networkingtag: beginners

A port is a number from 0 to 65535. Traffic arrives at an address and a port, and the computer hands it to whichever program is listening on that port.

  • 0–1023, well-known ports: standard services, such as 443 for HTTPS.
  • 1024–49151, registered ports: assigned to specific applications.
  • 49152–65535, dynamic ports: picked at random by your computer for its side of a conversation.

When your browser opens a website, the server’s door is 443 and your side is a random dynamic port.

  • TCP sets up a connection first and checks that everything arrives, in order. Web, email, SSH.
  • UDP just sends, with no checking. Faster, used where speed beats completeness: DNS lookups, video calls, games.

Common ports grouped by job

Port Service Transport Encrypted
22 SSH TCP Yes
23 Telnet TCP No
25 SMTP, server-to-server mail TCP Optional
53 DNS UDP, TCP No
67 / 68 DHCP UDP No
80 HTTP TCP No
443 HTTPS TCP (and UDP for HTTP/3) Yes
445 SMB, Windows file sharing TCP Optional
3389 RDP, Remote Desktop TCP Yes

Click a port number for what it’s for, how malware uses it and what to look for, or read them all on Common ports.

Cleartext ports and their secure replacements

System Command
macOS lsof -i -P -n | grep LISTEN
Windows (as administrator) netstat -ano
Linux ss -tulpn

Each line shows a program and the port it’s listening on. Look only at your own machine.

  • Ports are conventions, not rules. Malware often talks on 443 or 80 to blend in with web traffic, even when it isn’t speaking HTTPS or HTTP.
  • Odd ports stand out. A workstation sending traffic out on an unusual high port is worth a look.
  • Some ports should never face the internet. RDP (3389) and SMB (445) open to the internet are a common way in for attackers.

Common ports: each common port, how malware uses it and what to look for.

One Reverse Look

"A little learning is a dangerous thing." ~ A. Pope

One Reverse Look · Made with ❤ · Your friendly knowledge seeker