Which Windows command shows listening ports and current TCP connections?

Prepare for the eLearnSecurity Junior Penetration Tester exam with our comprehensive quiz platform. Improve your skills with multiple-choice questions, detailed explanations, and exam tips. Get exam ready with ease!

Multiple Choice

Which Windows command shows listening ports and current TCP connections?

Explanation:
Viewing sockets on Windows shows both listening ports and current TCP connections, which helps you see what services are exposed and who is connected. The Windows netstat utility with options -a, -n, and -o does exactly this: -a lists all sockets (listening and established), -n displays addresses and ports numerically, and -o includes the process ID owning each connection. Running netstat -ano gives you a complete view of all ports in use, along with the program that owns each one, so you can identify which process is listening or communicating. To map a PID to a specific program, check Task Manager’s Details tab or use tasklist with a PID filter. The other choices come from Linux tools or serve different purposes: ss is a Linux command; the Linux variant of netstat shown wouldn’t run on Windows; and arp -a shows the ARP table, not ports or TCP connections.

Viewing sockets on Windows shows both listening ports and current TCP connections, which helps you see what services are exposed and who is connected. The Windows netstat utility with options -a, -n, and -o does exactly this: -a lists all sockets (listening and established), -n displays addresses and ports numerically, and -o includes the process ID owning each connection. Running netstat -ano gives you a complete view of all ports in use, along with the program that owns each one, so you can identify which process is listening or communicating. To map a PID to a specific program, check Task Manager’s Details tab or use tasklist with a PID filter. The other choices come from Linux tools or serve different purposes: ss is a Linux command; the Linux variant of netstat shown wouldn’t run on Windows; and arp -a shows the ARP table, not ports or TCP connections.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy