Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
certcc-ghbot committed Feb 4, 2025
2 parents 312161c + f22295b commit 910fffd
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion lib/metasploit/framework/login_scanner/ivanti_login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,34 @@ module LoginScanner
# - Admin Login
class Ivanti < HTTP

DEFAULT_SSL_PORT = 443
LIKELY_PORTS = [443]
LIKELY_SERVICE_NAMES = [
'Ivanti Connect Secure'
]
PRIVATE_TYPES = [:password]
REALM_KEY = nil

def initialize(scanner_config, admin)
@admin = admin
super(scanner_config)
end

def check_setup
request_params = {
'method' => 'GET',
'uri' => normalize_uri('/dana-na/auth/url_default/welcome.cgi')
}

res = send_request(request_params)

if res && res.code == 200 && res.body&.include?('Ivanti Connect Secure')
return false
end

'Application might not be Ivanti Connect Secure, please check'
end

def create_admin_request(username, password, token, protocol, peer)
{
'method' => 'POST',
Expand Down Expand Up @@ -73,6 +96,8 @@ def do_admin_login(username, password)
return { status: ::Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: 'Unable to connect to the Ivanti service' } if res.nil?
return { status: ::Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: "Received an unexpected status code: #{res.code}" } if res.code != 302

return { status: ::Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: 'Unexpected response' } if !res.headers&.key?('location')

return { status: ::Metasploit::Model::Login::Status::SUCCESSFUL, proof: res.to_s } if res.headers['location'] == '/dana-na/auth/url_admin/welcome.cgi?p=admin%2Dconfirm'

if res.headers['location'] == '/dana-admin/misc/admin.cgi'
Expand Down Expand Up @@ -122,7 +147,7 @@ def do_login(username, password)
end
return { status: ::Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: 'Unable to connect to the Ivanti service' } if res.nil?
return { status: ::Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: "Received an unexpected status code: #{res.code}" } if res.code != 302
return { status: ::Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: 'Unexpected response' } if res.blank?
return { status: ::Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: 'Unexpected response' } if !res.headers&.key?('location')

if res.headers['location'] == '/dana-na/auth/url_default/welcome.cgi?p=ip%2Dblocked'
sleep(2 * 60) # 2 minutes
Expand Down

0 comments on commit 910fffd

Please sign in to comment.