2010-04-30 08:40:19 +00:00
|
|
|
##
|
|
|
|
# $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
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2009-07-14 03:55:32 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
|
|
|
include Msf::Exploit::ORACLE
|
2010-04-30 08:40:19 +00:00
|
|
|
|
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'))
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
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
|
2010-03-24 19:02:38 +00:00
|
|
|
return if not check_dependencies
|
|
|
|
|
2009-07-14 03:55:32 +00:00
|
|
|
query = datastore['SQL']
|
|
|
|
|
|
|
|
begin
|
2009-12-03 23:57:02 +00:00
|
|
|
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
|
2010-04-30 08:40:19 +00:00
|
|
|
return
|
2009-07-14 03:55:32 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|