Vulnerability & Exploit Database

Back to search

Microsoft Windows Authenticated Powershell Command Execution

This module uses a valid administrator username and password to execute a powershell payload using a similar technique to the "psexec" utility provided by SysInternals. The payload is encoded in base64 and executed from the commandline using the -encodedcommand flag. Using this method, the payload is never written to disk, and given that each payload is unique, is less prone to signature based detection. A persist option is provided to execute the payload in a while loop in order to maintain a form of persistence. In the event of a sandbox observing PSH execution, a delay and other obfuscation may be added to avoid detection. In order to avoid interactive process notifications for the current user, the psh payload has been reduced in size and wrapped in a powershell invocation which hides the window entirely.

Free Metasploit Download

Get your copy of the world's leading penetration testing tool

 Download Now

Module Name

exploit/windows/smb/psexec_psh

Authors

  • Royce [at] R3dy__ Davis <rdavis [at] accuvant.com>
  • RageLtMan <rageltman [at] sempervictus>

References

Targets

  • Automatic

Platforms

  • windows

Architectures

  • x86, x64

Reliability

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/windows/smb/psexec_psh msf exploit(psexec_psh) > show targets ...targets... msf exploit(psexec_psh) > set TARGET <target-id> msf exploit(psexec_psh) > show options ...show and set options... msf exploit(psexec_psh) > exploit

Related Vulnerabilities

Related Modules