PT0-001 · Question #70
Which of the following commands will allow a tester to enumerate potential unquoted services paths on a host?
The correct answer is D. wmic service get name, displayname, patchname, startmode | findstr /i "auto" | findstr /i /v. Identifying unquoted service paths requires a WMIC query that retrieves service executable pathnames and filters results to highlight auto-start services whose paths may contain exploitable unquoted spaces.
Question
Which of the following commands will allow a tester to enumerate potential unquoted services paths on a host?
Options
- Awmic environment get name, variablevalue, username / findstr /i "Path" | findstr /i "service"
- Bwmic service get /format:hform > c:\temp\services.html
- Cwmic startup get caption, location, command | findstr /i "service" | findstr /v /i "%"
- Dwmic service get name, displayname, patchname, startmode | findstr /i "auto" | findstr /i /v
How the community answered
(32 responses)- A13% (4)
- B6% (2)
- C3% (1)
- D78% (25)
Why each option
Identifying unquoted service paths requires a WMIC query that retrieves service executable pathnames and filters results to highlight auto-start services whose paths may contain exploitable unquoted spaces.
This command queries the 'wmic environment' class, which exposes system environment variables, not service executable paths, so it cannot surface unquoted path vulnerabilities.
This command exports all service data to an HTML report file and performs no filtering or path-quoting analysis, making it unsuitable for targeted unquoted path enumeration.
This command queries 'wmic startup' entries, which are run-once or login startup items, not installed Windows services, and therefore cannot enumerate service path vulnerabilities.
The command queries service name, displayname, pathname, and startmode via WMIC, which exposes the full executable path for each service. Piping through 'findstr /i auto' isolates automatically starting services, and the additional findstr /v filter removes entries with properly quoted paths, leaving candidates for unquoted path privilege escalation. Pathname is the critical field that reveals whether spaces in the path are unquoted.
Concept tested: WMIC enumeration of unquoted service paths
Source: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic
Topics
Community Discussion
No community discussion yet for this question.