Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Networking for Defenders  ›  Lesson

Common Ports and Protocols

Common Ports and their Uses 12 minServices listen on numbered ports, so every open port is a possible way in; close the ones you do not use and prefer encrypted protocols such as SSH, SFTP and HTTPS.

Common Ports and Protocols

The shop's web server runs several services at once: the website, secure remote administration and email. They share one IP address, so how does incoming traffic find the right one? By port number. Every open port is a service waiting for anyone who knocks.

The rule

An open port is an open door. Close every door you don't use.

If the IP address is the building, the port is the door number. A service listens on a port; anything that is allowed to reach that port can talk to it. Common ones to know:

Port Protocol Used for Encrypted?
20, 21 FTP Transferring files No
22 SSH / SFTP Remote admin, secure file transfer Yes
23 Telnet Old remote admin No
25 SMTP Sending email between servers Optional
53 DNS Name lookups Usually no
80 HTTP Websites No
443 HTTPS Websites Yes
3389 RDP Windows remote desktop Yes, but a frequent target

Two rules fall out of the table:

  • Prefer the encrypted partner. SSH instead of Telnet, SFTP instead of FTP, HTTPS instead of HTTP. The unencrypted ones send passwords as readable text.
  • Expose the minimum. Remote-access ports like 22 and 3389 should not be open to the whole internet if you can avoid it; limit them to known addresses or put them behind a VPN.

The shortcut

For each open port, ask two questions: "Do we use it?" and "Is there an encrypted version?" Not used: close it. Unencrypted: switch to the partner.

Reviewing the web server's firewallStep 1 of 4
  1. List what is open

    21 (FTP), 22 (SSH), 80 (HTTP), 443 (HTTPS), 3389 (RDP).

Port 80 is kept open only to redirect people who type the address without https. It serves no content itself.

Drills

Answer fast — trust the rule.

quick drill

Which port does HTTPS use by default?

quick drill

Which is the secure replacement for Telnet?

quick drill

The shop no longer uses a service listening on port 3389. What should you do?

quick drill

Why is FTP a poor choice for uploading files to the web server?

Remember

  • An open port is an open door. Close every door you don't use.
  • For each port: "Do we use it?" and "Is there an encrypted version?"
  • Trap: leaving remote-access ports such as 22 and 3389 open to the whole internet.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainClose the doors

A new hosting company sets up the shop's server with ports 21, 23, 80 and 443 open. Explain which you would keep, which you would close or replace, and why.