Land #18854, Add Proxies support to creating a session with mysql_login
This commit is contained in:
commit
c2a217efcd
|
@ -37,9 +37,9 @@ module Metasploit
|
|||
begin
|
||||
# manage our behind the scenes socket. Close any existing one and open a new one
|
||||
disconnect if self.sock
|
||||
connect
|
||||
self.sock = connect
|
||||
|
||||
mysql_conn = ::Mysql.connect(host, credential.public, credential.private, '', port, sock)
|
||||
mysql_conn = ::Mysql.connect(host, credential.public, credential.private, '', port, io: self.sock)
|
||||
|
||||
rescue ::SystemCallError, Rex::ConnectionError => e
|
||||
result_options.merge!({
|
||||
|
|
|
@ -23,6 +23,7 @@ module Rex
|
|||
# The mysql client context
|
||||
self.session = session
|
||||
self.client = session.client
|
||||
self.client.socket ||= self.client.io
|
||||
prompt = "%undMySQL @ #{client.socket.peerinfo} (#{database_name})%clr"
|
||||
history_manager = Msf::Config.mysql_session_history
|
||||
super(prompt, '>', history_manager, nil, :mysql)
|
||||
|
|
|
@ -71,7 +71,7 @@ class MetasploitModule < Msf::Auxiliary
|
|||
scanner = Metasploit::Framework::LoginScanner::MySQL.new(
|
||||
host: ip,
|
||||
port: rport,
|
||||
proxies: datastore['PROXIES'],
|
||||
proxies: datastore['Proxies'],
|
||||
cred_details: cred_collection,
|
||||
stop_on_success: datastore['STOP_ON_SUCCESS'],
|
||||
bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
|
||||
|
@ -183,7 +183,7 @@ class MetasploitModule < Msf::Auxiliary
|
|||
def session_setup(result, client)
|
||||
return unless (result && client)
|
||||
|
||||
rstream = client.socket
|
||||
rstream = client.socket || client.io
|
||||
|
||||
my_session = Msf::Sessions::MySQL.new(rstream, { client: client })
|
||||
merging = {
|
||||
|
|
Loading…
Reference in New Issue