root / modules / auxiliary / admin / mssql / mssql_sql.rb @ master
History | View | Annotate | Download (1.1 kB)
| 1 |
##
|
|---|---|
| 2 |
# $Id$
|
| 3 |
##
|
| 4 |
|
| 5 |
##
|
| 6 |
# This file is part of the Metasploit Framework and may be subject to
|
| 7 |
# redistribution and commercial restrictions. Please see the Metasploit
|
| 8 |
# web site for more information on licensing and terms of use.
|
| 9 |
# http://metasploit.com/
|
| 10 |
##
|
| 11 |
|
| 12 |
require 'msf/core'
|
| 13 |
|
| 14 |
|
| 15 |
class Metasploit3 < Msf::Auxiliary |
| 16 |
|
| 17 |
include Msf::Exploit::Remote::MSSQL |
| 18 |
|
| 19 |
def initialize(info = {}) |
| 20 |
super(update_info(info,
|
| 21 |
'Name' => 'Microsoft SQL Server Generic Query', |
| 22 |
'Description' => %q{ |
| 23 |
This module will allow for simple SQL statements to be executed against a |
| 24 |
MSSQL/MSDE instance given the appropiate credentials. |
| 25 |
},
|
| 26 |
'Author' => [ 'tebo <tebo [at] attackresearch [dot] com>' ], |
| 27 |
'License' => MSF_LICENSE, |
| 28 |
'Version' => '$Revision$', |
| 29 |
'References' =>
|
| 30 |
[ |
| 31 |
[ 'URL', 'http://www.attackresearch.com' ], |
| 32 |
[ 'URL', 'http://msdn.microsoft.com/en-us/library/cc448435(PROT.10).aspx'], |
| 33 |
] |
| 34 |
)) |
| 35 |
|
| 36 |
register_options( |
| 37 |
[ |
| 38 |
OptString.new('SQL', [ false, 'The SQL query to execute', 'select @@version']), |
| 39 |
], self.class)
|
| 40 |
end
|
| 41 |
|
| 42 |
def run |
| 43 |
mssql_query(datastore['SQL'], true) if mssql_login_datastore |
| 44 |
disconnect |
| 45 |
end
|
| 46 |
end
|