Skip to content

Commit f68d581

Browse files
committed
[FixRM rapid7#8319] - Properly disable BLANK_PASSWORDS for ektron_cms400net
In module ektron_cms400net.rb, datastore option "BLANK_PASSWORDS" is set to false by default, because according to the original author, a blank password will result in account lockouts. Since the user should never set "BLANK_PASSWORDS" to true, this option should never be presented as an option (when issuing the "show options"). While fixing rapid7#8319, I also noticed another bug at line 108, where res.code is used when res could be nil due to a timeout, so I ended up fixing it, too.
1 parent 4790d8d commit f68d581

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

modules/auxiliary/scanner/http/ektron_cms400net.rb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ def initialize(info={})
2929

3030
register_options(
3131
[
32-
#Set to false to prevent account lockouts - it will!
33-
OptBool.new('BLANK_PASSWORDS', [false, "Try blank passwords for all users", false]),
3432
OptString.new('URI', [true, "Path to the CMS400.NET login page", '/WorkArea/login.aspx']),
3533
OptPath.new(
3634
'USERPASS_FILE',
@@ -40,7 +38,9 @@ def initialize(info={})
4038
File.join(Msf::Config.install_root, "data", "wordlists", "cms400net_default_userpass.txt")
4139
])
4240
], self.class)
43-
end
41+
42+
deregister_options('BLANK_PASSWORDS')
43+
end
4444

4545
def target_url
4646
#Function to display correct protocol and host/vhost info
@@ -58,7 +58,16 @@ def target_url
5858
end
5959
end
6060

61+
def cleanup
62+
datastore['BLANK_PASSWORDS'] = @blank_pass
63+
end
64+
6165
def run_host(ip)
66+
# "Set to false to prevent account lockouts - it will!"
67+
# Therefore we shouldn't present BLANK_PASSWORDS as an option
68+
@blank_pass = datastore['BLANK_PASSWORDS']
69+
datastore['BLANK_PASSWORDS'] = false
70+
6271
begin
6372
res = send_request_cgi(
6473
{
@@ -96,7 +105,7 @@ def run_host(ip)
96105
end
97106

98107
rescue
99-
print_error ("Ektron CMS400.NET login page not found at #{target_url} [HTTP #{res.code}]")
108+
print_error ("Ektron CMS400.NET login page not found at #{target_url} [HTTP #{res.code rescue '= No response'}]")
100109
return
101110
end
102111
end

0 commit comments

Comments
 (0)