LAB: NETSTAT Command
Background
The NETSTAT (Network Statistics) command is a built-in Windows networking utility used to display information about active network connections, listening ports, routing tables, Ethernet statistics, and network protocols.
Network administrators use NETSTAT to:
-
Monitor network activity
-
Troubleshoot network problems
-
Identify unauthorized connections
-
Verify open ports
-
Diagnose application communication issues
-
Analyze TCP/IP performance
Prerequisites
-
Windows 10 or Windows 11
-
Internet connection
-
Command Prompt
-
Administrative privileges (recommended for some commands)
Lab Scenario
You are a junior IT support technician investigating reports of slow network performance. Your supervisor asks you to determine:
-
What network connections are currently active.
-
Which ports are listening for incoming connections.
-
Which applications are communicating over the network.
-
Whether there are any suspicious or unexpected connections.
You will use the NETSTAT command to gather and analyze network information.
Part 1 – Open Command Prompt
-
Press Windows + R
-
Type:
cmd
-
Press Enter
Part 2 – Display Active Connections
Type:
netstat
Example Output
Proto Local Address Foreign Address State
TCP 192.168.1.15:49823 20.190.160.45:443 ESTABLISHED
TCP 192.168.1.15:49845 142.250.72.14:443 ESTABLISHED
TCP 192.168.1.15:49850 151.101.1.69:443 TIME_WAIT
Questions
-
How many active connections are displayed?
-
Which protocol is being used?
-
Which remote server is connected?
-
What ports are being used?
Part 3 – Display Listening Ports
Type:
netstat -an
Example Output
Proto Local Address Foreign Address State
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
UDP 0.0.0.0:5353 *:*
Questions
-
Which ports are listening?
-
What does the LISTENING state indicate?
-
Why does UDP not show a connection state?
Part 4 – Display Executable Names
Run:
netstat -b
(Administrator privileges required.)
Example
chrome.exe
TCP 192.168.1.15:50022
142.250.72.14:443
ESTABLISHED
Questions
-
Which application is connected to the Internet?
-
Were multiple applications listed?
-
Why is administrator access required?
Part 5 – Display Process IDs (PID)
Run:
netstat -ano
Example
Proto Local Address Foreign Address State PID
TCP 192.168.1.15:51001 13.107.42.16:443 ESTABLISHED 12540
Now open Task Manager.
-
Press Ctrl + Shift + Esc
-
Select the Details tab.
-
Match the PID from NETSTAT to the running process.
Complete the Table
| PID | Process Name | Port | State |
|---|---|---|---|
Part 6 – Display Ethernet Statistics
Run:
netstat -e
Example Output
Interface Statistics
Received Bytes 23546782
Sent Bytes 19876455
Questions
-
How many bytes have been received?
-
How many bytes have been sent?
-
Which value is larger?
Part 7 – Display Network Statistics
Run:
netstat -s
Observe statistics for:
-
TCP
-
UDP
-
IPv4
-
IPv6
Questions
-
Which protocol transmitted the most packets?
-
Were any errors reported?
-
Why are these statistics useful?
Part 8 – Display the Routing Table
Run:
netstat -r
Questions
-
What is the default gateway?
-
What is the network destination?
-
Why is the routing table important?
Part 9 – Refresh Connections Continuously
Run:
netstat -an 5
The display refreshes every 5 seconds.
Observe:
-
New connections
-
Closed connections
-
Listening ports
Press Ctrl + C to stop.
Questions
-
Did connections change over time?
-
Why would continuous monitoring be useful?
Part 10 – Understanding TCP Connection States
Review the NETSTAT output and identify examples of the following states (if present):
| State | Description |
|---|---|
| LISTENING | Waiting for incoming connections |
| ESTABLISHED | Active connection between two devices |
| TIME_WAIT | Waiting before closing the connection |
| CLOSE_WAIT | Remote side has closed the connection |
| SYN_SENT | Connection request has been sent |
| SYN_RECEIVED | Connection request has been received |
Questions
-
Which connection state appeared most often?
-
Why is TIME_WAIT normal?
-
What does ESTABLISHED indicate?
Part 11 – Troubleshooting Exercise
-
Open a web browser and visit several websites.
-
Run:
netstat -ano
-
Observe:
-
New remote IP addresses
-
New ports
-
New PIDs
-
Close the browser.
-
Run the command again.
Questions
-
Did the connections disappear?
-
Why did some remain in TIME_WAIT?
-
Which application created the most connections?
Lab Questions
-
What is the purpose of the NETSTAT command?
-
What does LISTENING mean?
-
What is a PID?
-
Which command displays executable names?
-
Which command displays routing information?
-
Why are ports important?
-
What is the difference between TCP and UDP?
-
Why would a cybersecurity analyst use NETSTAT?
-
What command continuously refreshes NETSTAT?
-
How can NETSTAT help identify malware or unauthorized network activity?
Challenge Activity
Investigate your computer’s network activity while running different applications.
-
Open a web browser.
-
Open Microsoft Teams or another collaboration application.
-
Open a music or video streaming service.
-
Run:
netstat -ano
Record your findings.
| Application | Protocol | Local Port | Remote Port | Connection State | PID |
|---|---|---|---|---|---|
| Browser | |||||
| Teams | |||||
| Streaming App |
Deliverables
Students must submit:
-
Screenshots of each NETSTAT command executed.
-
Completed tables and analysis.
-
Answers to all lab questions.
-
A one-page summary explaining how NETSTAT helps monitor and troubleshoot network activity.
-
A reflection describing what they learned about active connections, ports, and processes.
Learning Outcomes
Upon successful completion of this lab, students will be able to:
-
Explain the purpose and functionality of the NETSTAT command.
-
Display and interpret active network connections.
-
Identify listening ports and associated applications.
-
Match Process IDs (PIDs) to running programs.
-
Analyze Ethernet and protocol statistics.
-
Interpret TCP connection states.
-
Monitor network activity over time.
-
Apply NETSTAT as a troubleshooting and security tool to identify connectivity issues, verify services, and detect unusual network behavior.
Bonus Activity (Advanced)
Research the following well-known TCP/UDP ports and identify whether they appear in your NETSTAT output.
| Port | Service | TCP/UDP | Common Use |
|---|---|---|---|
| 20/21 | FTP | TCP | File Transfer |
| 22 | SSH | TCP | Secure Remote Access |
| 25 | SMTP | TCP | Email Sending |
| 53 | DNS | TCP/UDP | Name Resolution |
| 80 | HTTP | TCP | Web Traffic |
| 110 | POP3 | TCP | Email Retrieval |
| 143 | IMAP | TCP | Email Retrieval |
| 443 | HTTPS | TCP | Secure Web Browsing |
| 3389 | Remote Desktop (RDP) | TCP | Remote Administration |
Reflection: Explain how understanding ports, connection states, and running processes can help an IT technician troubleshoot network issues and recognize potentially malicious network activity.