Skip to content

Commit

Permalink
Land #18848, Add Proxies support to creating a session with mssql_login
Browse files Browse the repository at this point in the history
  • Loading branch information
cgranleese-r7 committed Feb 19, 2024
2 parents 2cc8281 + bc6bf1c commit 3be5988
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
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

0 comments on commit 3be5988

Please sign in to comment.