Cyberlium

Networking › Module 4 › Lesson 2

BeginnerModule 4Lesson 2/4

Common Ports You Must Know

Essential port numbers for triage, firewalls, and exams

15 min+41 XP3 quiz
Module progress2 of 4

Opening

The number in the log is already a hypothesis

When a SIEM screams 3389 at 03:12, you should feel Windows Remote Desktop before you feel "some high port." When a firewall ticket says "open 5432 to the world," you should hear PostgreSQL, not "a random TCP door." Port numbers are not a trivia deck of 100 services. They are a short list of hypotheses that change the next command you run. This lesson keeps a tight set: 22, 53, 80, 443, 25, 587, 993, 3389, 3306, 5432, 8080. For each, you will know why the number matters in logs and firewalls — and you will always pair it with the Topic 2 bind-address question: is this LISTEN on 127.0.0.1 or on 0.0.0.0?

1. Remote shells, name lookups, and the web

22/TCP is SSH. In logs it is brute-force background radiation on any 0.0.0.0 listener facing a network. In firewalls it is the hole you punch for admin — and the hole ransomware operators pray you punched from 0.0.0.0/0. A 22 that binds only 127.0.0.1 is a local jump, not a WAN door. Same number, opposite tickets. 53 is DNS, usually UDP for small queries, TCP when answers grow or when zone transfers happen in environments that still allow them. Blocking 53 outbound without offering a resolver makes every app look dead while ping-by-IP still works. Allowing 53 to the world on a workstation is rarely the intent; a LISTEN on 0.0.0.0:53 might be a local recursive, malware, or a container — worth identifying, not ignoring because "DNS is normal." 80/TCP is HTTP, the postcard. 443/TCP is HTTPS, the envelope. Firewalls that "allow web" mean 80 and 443; attackers who "look like web" also love 443 because it blends in. A forgotten 80 vhost can still set cookies in cleartext. 443 on a phishing name still has a padlock. The port tells you the channel class, not the operator's morals.

2. Mail submission vs mailbox, and the admin/database leftovers

25/TCP is SMTP relay between mail systems. Unexpected 25 listeners on a laptop are a finding (spam zombie or a forgotten MTA). Many ISPs block outbound 25; that is anti-spam, not a broken internet. 587/TCP is submission: a client authenticates and hands mail to its provider, usually with STARTTLS. If you allow 587 off a subnet, you are allowing people to send mail through whatever they authenticated as — a different policy than "allow 25 to the world" (open relay territory). 993/TCP is IMAPS, encrypted mailbox access. 143 would be the cleartext cousin; you are not required to memorize every vintage mail port, but 993 in a firewall rule means "email clients may sync." It does not mean the messages are non-phishing. Encryption of the IMAP channel ≠ authenticity of the sender.

3389/TCP is RDP. In incident response it is one of the loudest initial-access ports on Windows estates: exposed RDP plus stolen passwords is a cliché because it still works. A home lab VM with 3389 on 0.0.0.0 attached to a bridged NIC is a different risk than 3389 on 127.0.0.1 behind your own SSH tunnel. 3306/TCP is MySQL/MariaDB. 5432/TCP is PostgreSQL. Databases almost never need to listen on all interfaces of a laptop. 0.0.0.0:3306 on a café Wi-Fi is how class projects become other people's data. 127.0.0.1:5432 is "only local processes, including your app on the same box." 8080/TCP is the unofficial "I started a Java/dev server and forgot." It is not a magic protocol; it is HTTP (or something HTTP-like) on a high port so it does not need root for 80. Treat unexpected 8080 like unexpected 80, then check the bind address.

3. Wrong vs right: flashcards without bind addresses

Worked failure mode — reciting 443 = HTTPS while missing who can connect. Carry Topic 2: 0.0.0.0 vs 127.0.0.1.

  • Wrong

    You dump a 100-port table into Anki and still cannot say whether ss showing *:3389 is a LAN emergency. You open 3306/5432 to 0.0.0.0/0 "temporarily." You nmap the office for 22/3389 to "inventory," without a charter. You assume 8080 is safe because it is not 80.

  • Right

    Memorize this short list and the why. On your VM, ss -tuln, pick three LISTEN lines, write port → likely service → bind address → who can connect. If nothing listens on 22/80/443, that is still a valid lab result. Do not scan other hosts to force a match.

4. Practical: interpret three listeners, not a port encyclopedia

You are not collecting a museum of numbers. You are practicing triage sentences: "This is 443/TCP on 127.0.0.1 — local HTTPS only." "This is 22/TCP on 0.0.0.0 — SSH on every IPv4 NIC; firewall may still filter, but the process accepted the bind." Three lines. Your machine. Then stop.

ss -tuln — three listeners on YOUR box

ss -tuln

# Cheat-sheet (do not nmap these on other people)
# 22/tcp   SSH
# 53/udp   DNS (sometimes 53/tcp)
# 80/tcp   HTTP
# 443/tcp  HTTPS
# 25/tcp   SMTP relay
# 587/tcp  mail submission
# 993/tcp  IMAPS
# 3389/tcp RDP
# 3306/tcp MySQL
# 5432/tcp PostgreSQL
# 8080/tcp leftover HTTP-ish dev server

mkdir -p "$HOME/cyberlium-lab"
{
  echo 'Three LISTEN lines (copy from ss):'
  echo '1) port / proto / bind / likely service / who can connect'
  echo '2)'
  echo '3)'
  echo
  ss -tuln
} > "$HOME/cyberlium-lab/common-ports-ss.txt"
chmod 600 "$HOME/cyberlium-lab/common-ports-ss.txt"

# NEVER: nmap school/work/neighbors for "the list"
# NEVER: bind a database to 0.0.0.0 to make the screenshot prettier
# NEVER: confuse "I memorized 3389" with "I checked 127.0.0.1 vs 0.0.0.0"

Mission: three-line port triage

Run ss -tuln on your own VM or WSL. In $HOME/cyberlium-lab/common-ports-ss.txt, interpret three listening sockets (or as many as exist). Each line: number, TCP vs UDP, likely service from the short list (or "unknown/other"), bind 127.0.0.1 vs 0.0.0.0/*, and who could connect. Do not nmap other hosts. Do not start dangerous daemons just to fill the list.

Stuck? Ask Cyberlium AI Mentor

If ss shows only 127.0.0.53:53 and you wanted 80/443, ask Cyberlium AI Mentor for a hint — not a scan of the default gateway. Try: "Hint only: I have no 22/80/443 listeners — is that a failed lab, and how do I still practice 127.0.0.1 vs 0.0.0.0 on whatever IS listening?"

You now treat a short port list as triage language: SSH, DNS, HTTP/HTTPS, mail relay vs submission vs IMAPS, RDP, two databases, and leftover 8080 — always plus bind address. You refused the 100-port dump. Next — Lab — Port & Connection Check — you will use ss and a localhost-only python HTTP server (and nc to 127.0.0.1) to prove a door opens, then shut it. Never nmap the LAN.

Knowledge Check

1

APPLY: ss shows 0.0.0.0:5432 and 127.0.0.1:3306. You take the laptop to a café. Which listener is the database facing the LAN?

Multiple choice

Knowledge Check

2

APPLY: A firewall change "allow 25 from any" vs "allow 587 to the mail provider from the subnet" — which is the dangerous open-relay-shaped idea?

Multiple choice

Knowledge Check

3

APPLY: True or False: 8080 on 0.0.0.0 is often a forgotten HTTP dev server and should be treated like an unexpected 80, not ignored because the number is unofficial.

True or False

← Previous

Answer all 3 knowledge checks to continue. (0/3 answered)