Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Proxies support to creating a session with mssql_login #18848

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/metasploit/framework/login_scanner/mssql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def attempt_login(credential)
}

begin
client = Rex::Proto::MSSQL::Client.new(framework_module, framework, host, port)
client = Rex::Proto::MSSQL::Client.new(framework_module, framework, host, port, proxies)
if client.mssql_login(credential.public, credential.private, '', credential.realm)
result_options[:status] = Metasploit::Model::Login::Status::SUCCESSFUL
if use_client_as_proof
Expand Down
3 changes: 2 additions & 1 deletion lib/rex/proto/mssql/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Client
# @return [Integer] The delay between sending packets
attr_accessor :send_delay

def initialize(framework_module, framework, rhost, rport = 1433)
def initialize(framework_module, framework, rhost, rport = 1433, proxies = nil)
@framework_module = framework_module
@framework = framework
@connection_timeout = framework_module.datastore['ConnectTimeout'] || 30
Expand All @@ -60,6 +60,7 @@ def initialize(framework_module, framework, rhost, rport = 1433)
@domain_controller_rhost = framework_module.datastore['DomainControllerRhost'] || ''
@rhost = rhost
@rport = rport
@proxies = proxies
end

#
Expand Down
1 change: 1 addition & 0 deletions modules/auxiliary/scanner/mssql/mssql_login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def initialize
}
)
register_options([
Opt::Proxies,
OptBool.new('TDSENCRYPTION', [ true, 'Use TLS/SSL for TDS data "Force Encryption"', false]),
OptBool.new('CreateSession', [false, 'Create a new session for every successful login', false])
])
Expand Down
2 changes: 1 addition & 1 deletion modules/auxiliary/scanner/mysql/mysql_login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def run_host(ip)
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'],
Expand Down