CMD Master
Back to Blog
Arnošt Havelka

Port Scanning

Identify open ports and active services.

Start Interactive Lesson
Port Scanning

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

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 / 3

Which netstat flag shows 'Listening' ports?

Up Next

Introduction to Zoxide

A smarter way to navigate.