Skip to content

Commit 72f0a56

Browse files
committed
Add more improvements
1 parent 8fe3f28 commit 72f0a56

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

modules/auxiliary/scanner/http/drupal_views_user_enum.rb

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module of Drupal, brute-forcing the first 10 usernames from 'a' to 'z'
2525
[
2626
'Justin Klein Keane', #Original Discovery
2727
'Robin Francois <rof[at]navixia.com>',
28-
'Brandon McCann "zeknox" <bmccann [at] accuvant.com>'
28+
'Brandon McCann "zeknox" <bmccann[at]accuvant.com>'
2929
],
3030
'License' => MSF_LICENSE,
3131
'References' =>
@@ -50,7 +50,11 @@ def check(base_uri)
5050

5151
if not res
5252
return false
53-
elsif res.message != 'OK' or res.body != '[ ]'
53+
elsif res and res.body =~ /\<title\>Access denied/
54+
# This probably means the Views Module actually isn't installed
55+
print_error("#{rhost} - Access denied")
56+
return false
57+
elsif res and res.message != 'OK' or res.body != '[ ]'
5458
return false
5559
else
5660
return true
@@ -72,7 +76,7 @@ def run_host(ip)
7276

7377
# Check if remote host is available or appears vulnerable
7478
if not check(enum_uri)
75-
print_status("#{ip} does not appear to be vulnerable, will not continue")
79+
print_error("#{ip} does not appear to be vulnerable, will not continue")
7680
return
7781
end
7882

@@ -109,14 +113,26 @@ def run_host(ip)
109113
final_results.each do |user|
110114
print_good("Found User: #{user}")
111115

112-
store_loot(
113-
type,
114-
'text/plain',
115-
Rex::Socket.getaddress(datastore['RHOST']),
116-
user,
117-
'drupal_user.txt',
118-
user
116+
report_auth_info(
117+
:host => Rex::Socket.getaddress(datastore['RHOST']),
118+
:port => datastore['RPORT'],
119+
:user => user,
120+
:type => "drupal_user"
119121
)
120122
end
123+
124+
# One username per line
125+
final_results = final_results * "\n"
126+
127+
p = store_loot(
128+
'drupal_user',
129+
'text/plain',
130+
Rex::Socket.getaddress(datastore['RHOST']),
131+
final_results.to_s,
132+
'drupal_user.txt'
133+
)
134+
135+
print_status("Usernames stored in: #{p}")
121136
end
137+
122138
end

0 commit comments

Comments
 (0)