Files
metasploit-gs/modules/auxiliary/admin/oracle/oracle_sql.rb
T

61 lines
1.3 KiB
Ruby
Raw Normal View History

##
# $Id$
##
2009-07-14 03:55:32 +00:00
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
2009-07-14 03:55:32 +00:00
##
require 'msf/core'
class Metasploit3 < Msf::Auxiliary
include Msf::Exploit::ORACLE
2009-07-14 03:55:32 +00:00
def initialize(info = {})
super(update_info(info,
2009-12-05 14:24:36 +00:00
'Name' => 'Oracle SQL Generic Query',
2009-07-14 03:55:32 +00:00
'Description' => %q{
2009-12-05 14:24:36 +00:00
This module allows for simple SQL statements to be executed
against a Oracle instance given the appropriate credentials
and sid.
2009-07-14 03:55:32 +00:00
},
'Author' => [ 'MC' ],
'License' => MSF_LICENSE,
2010-05-03 17:13:09 +00:00
'Version' => '$Revision$',
2009-07-14 03:55:32 +00:00
'References' =>
[
[ 'URL', 'https://www.metasploit.com/users/mc' ],
],
'DisclosureDate' => 'Dec 7 2007'))
register_options(
2009-07-14 03:55:32 +00:00
[
OptString.new('SQL', [ false, 'The SQL to execute.', 'select * from v$version']),
], self.class)
end
def run
return if not check_dependencies
2009-07-14 03:55:32 +00:00
query = datastore['SQL']
begin
print_status("Sending statement: '#{query}'...")
result = prepare_exec(query)
#Need this if 'cause some statements won't return anything
if result
result.each do |line|
print_status(line)
end
end
2009-07-14 03:55:32 +00:00
rescue => e
return
2009-07-14 03:55:32 +00:00
end
end
end