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/mysql.rb
Views: 1904
1
# -*- coding: binary -*-
2
3
require 'rex/post/mysql'
4
5
class Msf::Sessions::MySQL < Msf::Sessions::Sql
6
7
# @param[Rex::IO::Stream] rstream
8
# @param [Hash] opts
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::MySQL::Ui::Console.new(self)
14
super(rstream, opts)
15
end
16
17
# @param [Hash] datastore
18
# @param [nil] handler
19
# @return [String]
20
def bootstrap(datastore = {}, handler = nil)
21
session = self
22
session.init_ui(user_input, user_output)
23
24
@info = "MySQL #{datastore['USERNAME']} @ #{client.peerinfo}"
25
end
26
27
# @return [String] The type of the session
28
def self.type
29
'mysql'
30
end
31
32
# @return [Boolean] Can the session clean up after itself
33
def self.can_cleanup_files
34
false
35
end
36
37
# @return [String] The session description
38
def desc
39
'MySQL'
40
end
41
end
42
43