Networking / Editorial / By Sasmit Narnaware
Imagine a building with hundreds of doors
Imagine walking past a building and finding out it has hundreds of doors. Some lead to offices, some to storage rooms, and some lead to places nobody was supposed to enter.
Now imagine that building is a computer connected to the internet. Every service it runs can potentially communicate through a network port. If you know how to look, those little numbers can tell you a lot about what is happening behind the screen.
Welcome to network ports — one of those basic concepts that starts making a lot more sense once you get into cybersecurity.
IP addresses are buildings; ports are doors
Think of an IP address as the address of a building. A building can have multiple doors: one leads to reception, another to an office, and another to the server room. Different doors, different purposes, same building.
Network ports work in a similar way. An IP address helps identify a machine on a network, while a port number helps identify the service or application that should receive network traffic on that machine.
For example, when you visit a website over HTTPS, your browser will typically connect to port 443 on the web server. Same server, different services, different ports.
Ports are not physical doors. They are numbers used by networking protocols such as TCP and UDP to distinguish communication endpoints.
The numbers you keep seeing
Some port numbers are so common that you will encounter them everywhere while learning networking or doing CTFs:
- Port 80 — HTTP: traditional web traffic.
- Port 443 — HTTPS: encrypted web traffic.
- Port 22 — SSH: remote access through a secure shell.
- Port 21 — FTP: file transfers using the File Transfer Protocol.
- Port 53 — DNS: resolving domain names into information such as IP addresses.
A port number is a clue, not proof
These are standard ports associated with those services, not a guarantee that every service runs on its default port. A web server can run on port 8080. SSH can run somewhere else. You cannot identify everything about a service just by looking at a number.
Still, knowing the common ones gives you a useful starting point. The next question is not only which port is reachable, but what service is actually listening there and whether it is meant to be exposed.
See one in action — locally
You can open a small HTTP server on your own machine. Use a directory containing only files you are comfortable serving, and keep the test bound to localhost so other devices cannot connect to it:
bash
python -m http.server 8080 --bind 127.0.0.1What just happened?
Your Python process is listening for incoming HTTP connections on port 8080. When your browser connects to http://127.0.0.1:8080, the server responds with an HTTP response and you should see a directory listing or a page displaying the files in that directory.
Congratulations: you just ran a web server without installing a large framework or deploying anything to the cloud. Stop it with Ctrl + C when you are done.
Why cybersecurity learners care
During an authorised security assessment or a CTF, you may know a machine's IP address without knowing what is running on it. Checking which ports are reachable can provide clues about the services exposed by that machine.
A reachable SSH service might mean remote administration is available. A web service could lead to an application worth examining. An unexpectedly exposed database service might deserve a closer look.
But an open port does not automatically mean a vulnerability exists. It is a starting point, not a finding. The more interesting questions are: What service is running? Is it configured properly? Is it outdated? Does it expose something it should not? Does it require the intended authentication?
One last thing
Do not confuse an open port with an open door that anyone can walk through. A service can be listening on a port while a firewall blocks external connections. A reachable service can still require strong authentication. And a port number alone does not prove which application is running behind it.
Networking is full of these small details. The more you understand them, the less mysterious the internet becomes. Small numbers. A lot going on.
Only inspect systems you own or systems where you have explicit permission to test. Keep experiments local or inside the scope of an authorised lab or security program.