GCIH · Question #469
What command would you issue on a Windows 7 system in order to list the open TCP and UDP ports and connections to these ports?
The correct answer is D. Netstat -an. The netstat -an command on Windows displays all active TCP and UDP connections and listening ports in numeric format, making it the correct tool for this task.
Question
What command would you issue on a Windows 7 system in order to list the open TCP and UDP ports and connections to these ports?
Options
- ANet use /all
- BNslookup all
- CNetshell firewall show config
- DNetstat -an
How the community answered
(21 responses)- A10% (2)
- B5% (1)
- D86% (18)
Why each option
The netstat -an command on Windows displays all active TCP and UDP connections and listening ports in numeric format, making it the correct tool for this task.
net use /all displays mapped network drives and shared resource connections, not open TCP or UDP ports.
nslookup is a DNS query tool used to resolve hostnames and IP addresses and does not report on open ports or network connections.
netsh firewall show config displays Windows Firewall rule configuration, not the current active connections or listening ports on the system.
netstat -an uses the -a flag to show all active connections and listening ports (both TCP and UDP) and the -n flag to display addresses and port numbers numerically rather than resolving hostnames. This combination provides a complete view of open ports and their connection states on Windows systems.
Concept tested: Windows netstat command for active port enumeration
Source: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/netstat
Topics
Community Discussion
No community discussion yet for this question.