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 179<br />

starts an instance of Cmd.exe on server1 that runs the built-in ver command and then exits.<br />

The output of ver from server1 appears in the local console window in which PsExec was<br />

launched. In this case, Cmd.exe is the “program” part of the PsExec command line and /c ver<br />

is the optional “arguments” part passed to the program when it starts.<br />

PsExec Alternate Credentials<br />

The “Alternate Credentials” section earlier in this chapter described the use of the –u and –p<br />

parameters to provide explicit credentials to PsTools utilities. If these options are not used,<br />

the logged-on user account that is running PsExec is used to authenticate to the remote<br />

system, and then that account is impersonated by the remote process started by PsExec. This<br />

raises several issues:<br />

■ To start a process on a remote system, PsExec must use an account that has<br />

administrative rights on the remote system.<br />

■ If the remote process accesses network resources, it will authenticate as anonymous<br />

unless Kerberos delegation has been enabled. This is the one-hop limitation of impersonation:<br />

the computer on which a logon session is established with explicit credentials<br />

can authenticate to a remote server that can impersonate that security context on that<br />

system, but the process on the remote computer cannot then use the security context<br />

to authenticate to a third system.<br />

■ The impersonated security context will not include any logon SIDs that would grant it<br />

access to any interactive user sessions.<br />

You should provide explicit credentials if the account running PsExec does not have<br />

administrative access to the remote computer, if the remote process requires authenticated<br />

access to network resources, or if the remote process needs to run on an interactive user<br />

desktop. When explicit credentials are supplied, they are used to authenticate to the remote<br />

system, and then to create a new logon session that can run on a particular interactive<br />

desktop.<br />

Important The user name and password used to create the new logon session are transmitted<br />

to the remote system in the clear—that is, unencrypted. Anyone sniffing the network will be<br />

able to capture these credentials. Consider configuring your network to use IPsec with ESP<br />

(Encapsulating Security Payload) to encrypt all communications.<br />

The –u and –p parameters can also be used when starting a process on the local computer,<br />

in a manner similar to RunAs.exe. And as with RunAs.exe, because of UAC the target process<br />

will not have full administrative rights on <strong>Windows</strong> Vista or newer, even if the user account is<br />

a member of the Administrators group (unless you specify –h, described later).<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!