Skip to content

Commit 84599ed

Browse files
author
Austin
authored
Update dlink_850l_unauth_exec.rb
1 parent cddec8c commit 84599ed

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

modules/exploits/linux/http/dlink_850l_unauth_exec.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,28 @@ def initialize(info = {})
5454
OptInt.new('CONNECTBACK_DELAY', [ true, 'Time to wait for shell to connect back to attacker', 10])
5555
])
5656
end
57+
58+
def check
59+
begin
60+
res = send_request_cgi({
61+
'uri' => '/',
62+
'method' => 'GET'
63+
})
64+
if res && res.headers['Server']
65+
auth = res.headers['Server']
66+
if auth =~ /DIR-850L/
67+
if auth =~ /WEBACCESS\/1\.0/
68+
return Exploit::CheckCode::Safe
69+
else
70+
return Exploit::CheckCode::Detected
71+
end
72+
end
73+
end
74+
rescue ::Rex::ConnectionError
75+
return Exploit::CheckCode::Unknown
76+
end
77+
Exploit::CheckCode::Unknown
78+
end
5779

5880
def report_cred(opts)
5981
service_data = {
@@ -196,7 +218,13 @@ def execute(cmd, username, password)
196218

197219

198220
def exploit
221+
222+
print_status("#{peer} - Connecting to target...")
199223

224+
unless check == Exploit::CheckCode::Detected
225+
fail_with(Failure::Unknown, "#{peer} - Failed to access vulnerable url")
226+
end
227+
200228
#
201229
# Information Retrieval, obtains creds and logs in
202230
#

0 commit comments

Comments
 (0)