Which command lists Windows services and their states from the command line?

Study for the SANS560 GIAC Penetration Tester (GPEN) Test. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Multiple Choice

Which command lists Windows services and their states from the command line?

Explanation:
The command tests your ability to enumerate Windows services and their current states from the command line. It uses the Service Control Manager via the sc tool, specifically the query function, to pull status information about services. By including state=all, you ask it to return every service and show whether each one is RUNNING, STOPPED, or in another state. This is the reliable built-in method to get a complete picture of what services are present and how they’re behaving, which is essential for understanding a system’s surface area during assessment or post-exploitation enumeration. Other common network utilities don’t focus on services: ipconfig shows network interface configuration, which helps with network context but not service status; ping checks reachability to a host; tracert traces the path to a host.

The command tests your ability to enumerate Windows services and their current states from the command line. It uses the Service Control Manager via the sc tool, specifically the query function, to pull status information about services. By including state=all, you ask it to return every service and show whether each one is RUNNING, STOPPED, or in another state. This is the reliable built-in method to get a complete picture of what services are present and how they’re behaving, which is essential for understanding a system’s surface area during assessment or post-exploitation enumeration.

Other common network utilities don’t focus on services: ipconfig shows network interface configuration, which helps with network context but not service status; ping checks reachability to a host; tracert traces the path to a host.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy