Skip to content

Commit 5e8b9a2

Browse files
David MaloneyDavid Maloney
authored andcommitted
Fix boneheaded mistake
1 parent e448431 commit 5e8b9a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/exploits/windows/winrm/winrm_script_exec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def initialize(info = {})
6565
OptString.new( 'DECODERSTUB', [ true, 'The VBS base64 file decoder stub to use.',
6666
File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "vbs_b64_sleep")]),
6767
], self.class)
68-
68+
@compat_mode = false
6969
end
7070

7171
def check
@@ -177,6 +177,7 @@ def correct_payload_arch?
177177
when "x64"
178178
unless datastore['PAYLOAD'].include? "x64"
179179
print_error "You selected an x86 payload for an x64 target...trying to run in compat mode"
180+
@compat_mode = true
180181
return false
181182
end
182183
when "x86"
@@ -218,7 +219,7 @@ def powershell2?
218219
end
219220

220221
return false unless correct_payload_arch? or @target_arch == "x64"
221-
if @target_arch == "x64"
222+
if @compat_mode == true
222223
@invoke_powershell = "%SYSTEMROOT%\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe"
223224
else
224225
@invoke_powershell = "powershell"

0 commit comments

Comments
 (0)