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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.3 KiB
Ruby
Raw Normal View History

2009-07-14 03:55:32 +00:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2009-07-14 03:55:32 +00:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Auxiliary
2009-07-14 03:55:32 +00:00
include Msf::Exploit::ORACLE
2013-08-30 16:28:54 -05: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
2017-08-24 21:38:44 -04:00
against an Oracle instance given the appropriate credentials
2009-12-05 14:24:36 +00:00
and sid.
2009-07-14 03:55:32 +00:00
},
'Author' => [ 'MC' ],
'License' => MSF_LICENSE,
'References' =>
[
[ 'URL', 'https://www.metasploit.com/users/mc' ],
],
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2007-12-07'))
2013-08-30 16:28:54 -05:00
register_options(
2009-07-14 03:55:32 +00:00
[
OptString.new('SQL', [ false, 'The SQL to execute.', 'select * from v$version']),
])
2009-07-14 03:55:32 +00:00
end
2013-08-30 16:28:54 -05:00
2009-07-14 03:55:32 +00:00
def run
return if not check_dependencies
2013-08-30 16:28:54 -05:00
2009-07-14 03:55:32 +00:00
query = datastore['SQL']
2013-08-30 16:28:54 -05:00
2009-07-14 03:55:32 +00:00
begin
print_status("Sending statement: '#{query}'...")
result = prepare_exec(query)
# Need this if statement because 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