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.

59 lines
1.4 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,
'Name' => 'Oracle SQL Generic Query',
'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.
},
'Author' => [ 'MC' ],
'License' => MSF_LICENSE,
'References' => [
2025-02-28 09:35:28 +00:00
[ 'URL', 'http://web.archive.org/web/20110322124810/http://www.metasploit.com:80/users/mc/' ],
2009-07-14 03:55:32 +00:00
],
'DisclosureDate' => '2007-12-07',
'Notes' => {
'Stability' => [CRASH_SAFE],
'SideEffects' => [IOC_IN_LOGS],
'Reliability' => []
}
)
)
2013-08-30 16:28:54 -05:00
register_options(
[
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 !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
rescue StandardError
return
2009-07-14 03:55:32 +00:00
end
end
end