metasploit-framework/modules/auxiliary/admin/oracle/oracle_sql.rb

54 lines
1.3 KiB
Ruby
Raw Normal View History

##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
2016-03-08 13:02:44 +00:00
class MetasploitModule < Msf::Auxiliary
2013-08-30 21:28:54 +00:00
include Msf::Exploit::ORACLE
def initialize(info = {})
super(update_info(info,
'Name' => 'Oracle SQL Generic Query',
'Description' => %q{
This module allows for simple SQL statements to be executed
against a Oracle instance given the appropriate credentials
and sid.
},
'Author' => [ 'MC' ],
'License' => MSF_LICENSE,
'References' =>
[
[ 'URL', 'https://www.metasploit.com/users/mc' ],
],
'DisclosureDate' => 'Dec 7 2007'))
register_options(
[
OptString.new('SQL', [ false, 'The SQL to execute.', 'select * from v$version']),
], self.class)
end
def run
return if not check_dependencies
query = datastore['SQL']
begin
print_status("Sending statement: '#{query}'...")
result = prepare_exec(query)
# Need this if statement because some statements won't return anything
2013-08-30 21:28:54 +00:00
if result
result.each do |line|
print_status(line)
end
end
rescue => e
return
end
end
end