Skip to content

Commit a93565b

Browse files
committed
Add 'Payload' section with 'Size' to psexec_psh
This missing parameter was causing the payload 'Size' to come through to the encoders as `nil`. This meant that all the stagers that were looking at the payload sizes were being told there was no size. In the case of the meterpreter payloads, this was causing issues with the proxy settings because the proxy configuration detail isn't added to the payload unless there's enough space. This fix adds a default size of 2048 (the same as the plain psexec module). This makes the proxy settings work as expected.
1 parent 9fddc21 commit a93565b

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

modules/exploits/windows/smb/psexec_psh.rb

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class Metasploit3 < Msf::Exploit::Remote
1717

1818
def initialize(info = {})
1919
super(update_info(info,
20-
'Name' => 'Microsoft Windows Authenticated Powershell Command Execution',
21-
'Description' => %q{
20+
'Name' => 'Microsoft Windows Authenticated Powershell Command Execution',
21+
'Description' => %q{
2222
This module uses a valid administrator username and password to execute a powershell
2323
payload using a similar technique to the "psexec" utility provided by SysInternals. The
2424
payload is encoded in base64 and executed from the commandline using the -encodedcommand
@@ -31,25 +31,30 @@ def initialize(info = {})
3131
the window entirely.
3232
},
3333

34-
'Author' => [
34+
'Author' => [
3535
'Royce @R3dy__ Davis <rdavis[at]accuvant.com>', # PSExec command module
3636
'RageLtMan <rageltman[at]sempervictus' # PSH exploit, libs, encoders
3737
],
38-
'License' => MSF_LICENSE,
39-
'Privileged' => true,
40-
'DefaultOptions' =>
38+
'License' => MSF_LICENSE,
39+
'Privileged' => true,
40+
'DefaultOptions' =>
4141
{
4242
'WfsDelay' => 10,
43-
'EXITFUNC' => 'thread'
43+
'EXITFUNC' => 'thread'
4444
},
45-
'Platform' => 'win',
46-
'Targets' =>
45+
'Payload' =>
46+
{
47+
'Space' => 2048,
48+
'DisableNops' => true
49+
},
50+
'Platform' => 'win',
51+
'Targets' =>
4752
[
4853
[ 'Automatic', { 'Arch' => [ ARCH_X86, ARCH_X86_64 ] } ]
4954
],
50-
'DefaultTarget' => 0,
51-
'DisclosureDate' => 'Jan 01 1999',
52-
'References' => [
55+
'DefaultTarget' => 0,
56+
'DisclosureDate' => 'Jan 01 1999',
57+
'References' => [
5358
[ 'CVE', '1999-0504'], # Administrator with no password (since this is the default)
5459
[ 'OSVDB', '3106'],
5560
[ 'URL', 'http://www.accuvant.com/blog/2012/11/13/owning-computers-without-shell-access' ],

0 commit comments

Comments
 (0)