Land #18854, Add Proxies support to creating a session with mysql_login

This commit is contained in:
cgranleese-r7 2024-02-19 14:27:22 +00:00 committed by GitHub
commit c2a217efcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View File

@ -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!({

View File

@ -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)

View File

@ -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 = {