CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/msf/base/sessions/mssql.rb
Views: 1904
1
# -*- coding:binary -*-
2
3
require 'rex/post/mssql'
4
5
class Msf::Sessions::MSSQL < Msf::Sessions::Sql
6
7
attr_reader :framework
8
9
def initialize(rstream, opts = {})
10
@client = opts.fetch(:client)
11
self.platform = opts.fetch(:platform)
12
self.arch = opts.fetch(:arch)
13
self.console = ::Rex::Post::MSSQL::Ui::Console.new(self, opts)
14
15
super(rstream, opts)
16
end
17
18
def bootstrap(datastore = {}, handler = nil)
19
session = self
20
session.init_ui(user_input, user_output)
21
22
@info = "MSSQL #{datastore['USERNAME']} @ #{@peer_info}"
23
end
24
25
# Returns the type of session.
26
#
27
def self.type
28
'mssql'
29
end
30
31
def self.can_cleanup_files
32
false
33
end
34
35
#
36
# Returns the session description.
37
#
38
def desc
39
'MSSQL'
40
end
41
end
42
43