Skip to content

Commit 47dbabf

Browse files
committed
This #initialize method must take one argument
1 parent d51d632 commit 47dbabf

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

lib/metasploit/framework/login_scanner/ivanti_login.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ class Ivanti < HTTP
1616
PRIVATE_TYPES = [:password]
1717
REALM_KEY = nil
1818

19-
def initialize(scanner_config, admin=false)
20-
@admin = admin
21-
super(scanner_config)
22-
end
19+
attr_accessor :use_admin_endpoint
2320

2421
def check_setup
2522
request_params = {
@@ -138,7 +135,7 @@ def do_logout(cookies)
138135

139136
def do_login(username, password)
140137
protocol = ssl ? 'https' : 'http'
141-
peer = "#{host}:#{port}"
138+
peer = Rex::Socket.to_authority(host, port)
142139
user_req = create_user_request(username, password, protocol, peer)
143140
begin
144141
res = send_request(user_req)
@@ -178,7 +175,7 @@ def attempt_login(credential)
178175
service_name: 'ivanti'
179176
}
180177

181-
if @admin
178+
if @use_admin_endpoint
182179
login_result = do_admin_login(credential.public, credential.private)
183180
else
184181
login_result = do_login(credential.public, credential.private)

modules/auxiliary/scanner/ivanti/login_scanner.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ def get_scanner(ip)
5151
cred_details: cred_collection,
5252
stop_on_success: datastore['STOP_ON_SUCCESS'],
5353
bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
54-
connection_timeout: datastore['HttpClientTimeout'] || 5
54+
connection_timeout: datastore['HttpClientTimeout'] || 5,
55+
use_admin_endpoint: datastore['ADMIN']
5556
)
56-
return Metasploit::Framework::LoginScanner::Ivanti.new(configuration, datastore['ADMIN'])
57+
return Metasploit::Framework::LoginScanner::Ivanti.new(configuration)
5758
end
5859

5960
def process_credential(credential_data)

0 commit comments

Comments
 (0)