File tree Expand file tree Collapse file tree 6 files changed +20
-35
lines changed Expand file tree Collapse file tree 6 files changed +20
-35
lines changed Original file line number Diff line number Diff line change @@ -148,13 +148,11 @@ def do_login(user, pass)
148
148
149
149
good_response = (
150
150
res &&
151
- res . code == 200 &&
152
- res . headers . include? ( 'Set-Cookie' ) &&
153
- res . headers [ 'Set-Cookie' ] . include? ( 'sysauth' )
151
+ res . code == 200
154
152
)
155
153
156
154
if good_response
157
- sysauth_value = res . headers [ 'Set-Cookie' ] . match ( /((.*)[$ ])/ )
155
+ sysauth_value = res . get_cookies . scan ( /((.*)[$ ])/ ) . flatten [ 0 ] || ''
158
156
159
157
cookie1 = "#{ sysauth_value } ; " + "globalParams=%7B%22dashboard%22%3A%7B%22refresh_rate%22%3A%225%22%7D%2C%22#{ user } %22%3A%7B%22refresh_rate%22%3A%225%22%7D%7D"
160
158
@@ -181,8 +179,7 @@ def do_login(user, pass)
181
179
good_response = (
182
180
res &&
183
181
res . code == 200 &&
184
- res . headers . include? ( 'Set-Cookie' ) &&
185
- res . headers [ 'Set-Cookie' ] . include? ( 'stok=' )
182
+ res . get_cookies . scan ( /(stok=(.*))/ ) . flatten [ 0 ]
186
183
)
187
184
188
185
if good_response
@@ -196,10 +193,10 @@ def do_login(user, pass)
196
193
password : pass
197
194
)
198
195
199
- get_stok = res . headers [ 'Set-Cookie' ] . match ( / stok=(.*)/ )
196
+ get_stok = res . get_cookies . scan ( /( stok=(.*))/ ) || ''
200
197
if !get_stok . nil?
201
198
stok_value = get_stok [ 1 ]
202
- sysauth_value = res . headers [ 'Set-Cookie' ] . match ( /((.*)[$ ])/ )
199
+ sysauth_value = res . get_cookies . scan ( /((.*)[$ ])/ ) . flatten [ 0 ] || ''
203
200
204
201
cookie2 = "#{ sysauth_value } ; " + "globalParams=%7B%22dashboard%22%3A%7B%22refresh_rate%22%3A%225%22%7D%2C%22#{ user } %22%3A%7B%22refresh_rate%22%3A%225%22%7D%7D; userType=Installer; usernameType=installer; stok=" + "#{ stok_value } "
205
202
Original file line number Diff line number Diff line change @@ -141,13 +141,11 @@ def do_login(user, pass)
141
141
142
142
good_response = (
143
143
res &&
144
- res . code == 200 &&
145
- res . headers . include? ( 'Set-Cookie' ) &&
146
- res . headers [ 'Set-Cookie' ] . include? ( 'sysauth' )
144
+ res . code == 200
147
145
)
148
146
149
147
if good_response
150
- sysauth_value = res . headers [ 'Set-Cookie' ] . match ( /((.*)[$ ])/ )
148
+ sysauth_value = res . get_cookies . scan ( /((.*)[$ ])/ ) . flatten [ 0 ] || ''
151
149
152
150
cookie1 = "#{ sysauth_value } ; " + "globalParams=%7B%22dashboard%22%3A%7B%22refresh_rate%22%3A%225%22%7D%2C%22#{ user } %22%3A%7B%22refresh_rate%22%3A%225%22%7D%7D"
153
151
@@ -173,8 +171,7 @@ def do_login(user, pass)
173
171
good_response = (
174
172
res &&
175
173
res . code == 200 &&
176
- res . headers . include? ( 'Set-Cookie' ) &&
177
- res . headers [ 'Set-Cookie' ] . include? ( 'stok=' )
174
+ res . get_cookies . scan ( /(stok=(.*))/ ) . flatten [ 0 ]
178
175
)
179
176
180
177
if good_response
@@ -188,10 +185,10 @@ def do_login(user, pass)
188
185
password : pass
189
186
)
190
187
191
- get_stok = res . headers [ 'Set-Cookie' ] . match ( / stok=(.*)/ )
188
+ get_stok = res . get_cookies . scan ( /( stok=(.*))/ ) || ''
192
189
if !get_stok . nil?
193
190
stok_value = get_stok [ 1 ]
194
- sysauth_value = res . headers [ 'Set-Cookie' ] . match ( /((.*)[$ ])/ )
191
+ sysauth_value = res . get_cookies . scan ( /((.*)[$ ])/ ) . flatten [ 0 ] || ''
195
192
196
193
cookie2 = "#{ sysauth_value } ; " + "globalParams=%7B%22dashboard%22%3A%7B%22refresh_rate%22%3A%225%22%7D%2C%22#{ user } %22%3A%7B%22refresh_rate%22%3A%225%22%7D%7D; userType=Installer; usernameType=installer; stok=" + "#{ stok_value } "
197
194
Original file line number Diff line number Diff line change @@ -147,13 +147,11 @@ def do_login(user, pass)
147
147
148
148
good_response = (
149
149
res &&
150
- res . code == 200 &&
151
- res . headers . include? ( 'Set-Cookie' ) &&
152
- res . headers [ 'Set-Cookie' ] . include? ( 'sysauth' )
150
+ res . code == 200
153
151
)
154
152
155
153
if good_response
156
- sysauth_value = res . headers [ 'Set-Cookie' ] . match ( /((.*)[$ ])/ )
154
+ sysauth_value = res . get_cookies . scan ( /((.*)[$ ])/ ) . flatten [ 0 ] || ''
157
155
158
156
cookie1 = "#{ sysauth_value } ; " + "globalParams=%7B%22dashboard%22%3A%7B%22refresh_rate%22%3A%225%22%7D%2C%22#{ user } %22%3A%7B%22refresh_rate%22%3A%225%22%7D%7D"
159
157
@@ -179,9 +177,7 @@ def do_login(user, pass)
179
177
180
178
good_response = (
181
179
res &&
182
- res . code == 200 &&
183
- res . headers . include? ( 'Set-Cookie' ) &&
184
- res . headers [ 'Set-Cookie' ] . include? ( 'stok=' )
180
+ res . code == 200
185
181
)
186
182
187
183
if good_response
@@ -195,10 +191,10 @@ def do_login(user, pass)
195
191
password : pass
196
192
)
197
193
198
- get_stok = res . headers [ 'Set-Cookie' ] . match ( / stok=(.*)/ )
194
+ get_stok = res . get_cookies . scan ( /( stok=(.*))/ ) || ''
199
195
if !get_stok . nil?
200
196
stok_value = get_stok [ 1 ]
201
- sysauth_value = res . headers [ 'Set-Cookie' ] . match ( /((.*)[$ ])/ )
197
+ sysauth_value = res . get_cookies . scan ( /((.*)[$ ])/ ) . flatten [ 0 ] || ''
202
198
203
199
cookie2 = "#{ sysauth_value } ; " + "globalParams=%7B%22dashboard%22%3A%7B%22refresh_rate%22%3A%225%22%7D%2C%22#{ user } %22%3A%7B%22refresh_rate%22%3A%225%22%7D%7D; userType=Installer; usernameType=installer; stok=" + "#{ stok_value } "
204
200
Original file line number Diff line number Diff line change @@ -137,13 +137,11 @@ def do_login(user, pass)
137
137
138
138
good_response = (
139
139
res &&
140
- res . code == 200 &&
141
- res . headers . include? ( 'Set-Cookie' ) &&
142
- res . headers [ 'Set-Cookie' ] . include? ( 'sysauth' )
140
+ res . code == 200
143
141
)
144
142
145
143
if good_response
146
- sysauth_value = res . headers [ 'Set-Cookie' ] . match ( /((.*)[$ ])/ )
144
+ sysauth_value = res . get_cookies . scan ( /((.*)[$ ])/ ) . flatten [ 0 ] || ''
147
145
148
146
cookie1 = "#{ sysauth_value } ; " + "globalParams=%7B%22dashboard%22%3A%7B%22refresh_rate%22%3A%225%22%7D%2C%22#{ user } %22%3A%7B%22refresh_rate%22%3A%225%22%7D%7D"
149
147
@@ -168,9 +166,7 @@ def do_login(user, pass)
168
166
169
167
good_response = (
170
168
res &&
171
- res . code == 200 &&
172
- res . headers . include? ( 'Set-Cookie' ) &&
173
- res . headers [ 'Set-Cookie' ] . include? ( 'stok=' )
169
+ res . code == 200
174
170
)
175
171
176
172
if good_response
Original file line number Diff line number Diff line change 3
3
# Current source: https://github.com/rapid7/metasploit-framework
4
4
##
5
5
6
- require 'msf/core'
7
-
8
6
class MetasploitModule < Msf ::Exploit ::Remote
9
7
Rank = GreatRanking
10
8
Original file line number Diff line number Diff line change 8
8
require 'msf/core/post/file'
9
9
10
10
class MetasploitModule < Msf ::Exploit ::Local
11
+ Rank = NormalRanking
11
12
12
13
include Msf ::Post ::Windows ::Powershell
13
14
include Msf ::Exploit ::Powershell
@@ -26,7 +27,7 @@ def initialize(info = {})
26
27
The INTERVAL method will create an event filter that triggers the payload after the specified CALLBACK_INTERVAL. The LOGON
27
28
method will create an event filter that will trigger the payload after the system has an uptime of 4 minutes. The PROCESS
28
29
method will create an event filter that triggers the payload when the specified process is started. The WAITFOR method
29
- creates an event filter that utilises the microsoft binary waitfor.exe to wait for a signal specified by WAITFOR_TRIGGER
30
+ creates an event filter that utilises the Microsoft binary waitfor.exe to wait for a signal specified by WAITFOR_TRIGGER
30
31
before executing the payload. The signal can be sent from a windows host on a LAN utilising the waitfor.exe command
31
32
(note: requires target to have port 445 open). Additionally a custom command can be specified to run once the trigger is
32
33
activated using the advanced option CUSTOM_PS_COMMAND. This module requires administrator level privileges as well as a
You can’t perform that action at this time.
0 commit comments