nerdexam
GIAC

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.

Reconnaissance, Scanning, and Enumeration

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)
  • A
    10% (2)
  • B
    5% (1)
  • D
    86% (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.

ANet use /all

net use /all displays mapped network drives and shared resource connections, not open TCP or UDP ports.

BNslookup all

nslookup is a DNS query tool used to resolve hostnames and IP addresses and does not report on open ports or network connections.

CNetshell firewall show config

netsh firewall show config displays Windows Firewall rule configuration, not the current active connections or listening ports on the system.

DNetstat -anCorrect

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

#netstat#open ports#Windows commands#network connections

Community Discussion

No community discussion yet for this question.

Full GCIH Practice