09.02.2014 Views

Windows sysinternals

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6 Pstools 199<br />

By default, the PsService query command lists all Win32 services configured on the target<br />

system, whether they’re running or not. (PsService without any command-line parameters is<br />

equivalent to psservice query.) To narrow down the list by service or driver name, specify<br />

the name at the end of the command line. PsService will report status information for all<br />

services and drivers with exact or partially matching service or display names. For example,<br />

psservice query ras will list all services and drivers that have service or display names<br />

beginning with ras. (The match is case insensitive.)<br />

You can further filter the query results by type and by state. Add the –t option followed by<br />

driver to display only drivers, service to display only Win32 services, interactive to display<br />

only Win32 services that are marked allow service to interact with desktop, or all not to<br />

filter results based on type. To filter query results based on whether the service or driver is<br />

active, add –s to the command line followed by active, inactive, or all. If a service name is<br />

not added to the command line, PsService defaults to displaying only Win32 services and<br />

all states. If a service name is specified and –t is not specified, PsService displays matching<br />

services or drivers.<br />

Note It is strongly discouraged to mark services “interactive.” Such services are often vulnerable<br />

to elevation-of-privilege attacks and often will not work on <strong>Windows</strong> Vista or newer, or on earlier<br />

versions of <strong>Windows</strong> with Fast User Switching or other terminal services. The psservice query –t<br />

interactive command is an easy way to identify these potentially problematic services.<br />

To list only services or drivers that belong to a particular load order group, name the group<br />

after the –g option. Group name matching is case insensitive but must be an exact match,<br />

not a partial match.<br />

All these options can be combined. The following command displays status information for<br />

kernel drivers on a remote computer that are in the PnP Filter group, that are not loaded,<br />

and that have service or display names beginning with bth:<br />

psservice \\win7x86-vm query -g "pnp filter" -t driver -s inactive bth<br />

Config<br />

The config command displays configuration information about services or drivers. Used by<br />

itself, the PsService config command displays configuration information about all registered<br />

Win32 services on the target system. Add a name after the config command, and PsService<br />

will display configuration settings about all services and drivers with service or display names<br />

beginning with the name you specify. For example, psservice config ras displays configuration<br />

settings for all services and drivers with a service or display name beginning with “ras”<br />

(case insensitive).<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!