Port Scanning Basics
Ports are like doors into your computer. Web servers open port 80, Email uses 25, etc. A "Port Scan" checks which doors are open. While professional tools like Nmap are standard, Windows has built-in ways to check local ports.
1. Checking Your Own Ports (Netstat)
Use netstat to see what connections your computer has established and which ports it is listening on.
Usage:netstat
[/options]
-a
Displays all active connections and the TCP and UDP ports on which the computer is listening.
-n
Displays active TCP connections, but addresses and port numbers are expressed numerically (faster).
-o
Displays the Process ID (PID) associated with each connection.
2. Analyzing the Output
- LISTENING: The port is open and waiting for a connection (e.g., a web server running on your machine).
- ESTABLISHED: An active connection exists (e.g., your browser loading a webpage).
Command Prompt
C:\Users\User>netstat -an | find "LISTENING"
3. Testing a Remote Port (Telnet/PowerShell)
How do you check if another computer has a port open?
Old school: telnet scanme.nmap.org 80
Modern way: PowerShell.
powershell -Command "Test-NetConnection scanme.nmap.org -Port 80"
Knowledge Check
1 / 3Which netstat flag shows 'Listening' ports?