Path: blob/master/modules/auxiliary/admin/oracle/oracle_sql.rb
19566 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::ORACLE78def initialize(info = {})9super(10update_info(11info,12'Name' => 'Oracle SQL Generic Query',13'Description' => %q{14This module allows for simple SQL statements to be executed15against an Oracle instance given the appropriate credentials16and sid.17},18'Author' => [ 'MC' ],19'License' => MSF_LICENSE,20'References' => [21[ 'URL', 'http://web.archive.org/web/20110322124810/http://www.metasploit.com:80/users/mc/' ],22],23'DisclosureDate' => '2007-12-07',24'Notes' => {25'Stability' => [CRASH_SAFE],26'SideEffects' => [IOC_IN_LOGS],27'Reliability' => []28}29)30)3132register_options(33[34OptString.new('SQL', [false, 'The SQL to execute.', 'select * from v$version']),35]36)37end3839def run40return if !check_dependencies4142query = datastore['SQL']4344begin45print_status("Sending statement: '#{query}'...")46result = prepare_exec(query)47# Need this if statement because some statements won't return anything48if result49result.each do |line|50print_status(line)51end52end53rescue StandardError54return55end56end57end585960