2009-01-12 05:18:05 +00:00
|
|
|
##
|
2009-03-15 18:12:33 +00:00
|
|
|
# $Id$
|
2009-01-12 05:18:05 +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.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2009-01-12 05:18:05 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::MSSQL
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-01-12 05:18:05 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2009-10-13 22:24:47 +00:00
|
|
|
'Name' => 'Microsoft SQL Server Generic Query',
|
2009-01-12 05:18:05 +00:00
|
|
|
'Description' => %q{
|
|
|
|
This module will allow for simple SQL statements to be executed against a
|
|
|
|
MSSQL/MSDE instance given the appropiate credentials.
|
|
|
|
},
|
|
|
|
'Author' => [ 'tebo <tebo [at] attackresearch [dot] com>' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2009-03-15 18:12:33 +00:00
|
|
|
'Version' => '$Revision$',
|
2009-01-12 05:18:05 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2011-07-24 19:36:37 +00:00
|
|
|
[ 'URL', 'http://www.attackresearch.com' ],
|
2009-01-12 05:18:05 +00:00
|
|
|
[ 'URL', 'http://msdn.microsoft.com/en-us/library/cc448435(PROT.10).aspx'],
|
2009-10-13 22:24:47 +00:00
|
|
|
]
|
|
|
|
))
|
2009-01-12 05:18:05 +00:00
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options(
|
2009-10-13 22:24:47 +00:00
|
|
|
[
|
|
|
|
OptString.new('SQL', [ false, 'The SQL query to execute', 'select @@version']),
|
|
|
|
], self.class)
|
2009-01-12 05:18:05 +00:00
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-01-12 05:18:05 +00:00
|
|
|
def run
|
2009-10-13 22:24:47 +00:00
|
|
|
mssql_query(datastore['SQL'], true) if mssql_login_datastore
|
2009-01-12 05:18:05 +00:00
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
end
|