Skip to content

Commit e710701

Browse files
committed
Made msftidy.rb happy
...untested with the set-cookie 'fix'
1 parent 524373b commit e710701

File tree

6 files changed

+20
-35
lines changed

6 files changed

+20
-35
lines changed

modules/auxiliary/scanner/http/epmp1000_cmd_exec.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,11 @@ def do_login(user, pass)
148148

149149
good_response = (
150150
res &&
151-
res.code == 200 &&
152-
res.headers.include?('Set-Cookie') &&
153-
res.headers['Set-Cookie'].include?('sysauth')
151+
res.code == 200
154152
)
155153

156154
if good_response
157-
sysauth_value = res.headers['Set-Cookie'].match(/((.*)[$ ])/)
155+
sysauth_value = res.get_cookies.scan(/((.*)[$ ])/).flatten[0] || ''
158156

159157
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"
160158

@@ -181,8 +179,7 @@ def do_login(user, pass)
181179
good_response = (
182180
res &&
183181
res.code == 200 &&
184-
res.headers.include?('Set-Cookie') &&
185-
res.headers['Set-Cookie'].include?('stok=')
182+
res.get_cookies.scan(/(stok=(.*))/).flatten[0]
186183
)
187184

188185
if good_response
@@ -196,10 +193,10 @@ def do_login(user, pass)
196193
password: pass
197194
)
198195

199-
get_stok = res.headers['Set-Cookie'].match(/stok=(.*)/)
196+
get_stok = res.get_cookies.scan(/(stok=(.*))/) || ''
200197
if !get_stok.nil?
201198
stok_value = get_stok[1]
202-
sysauth_value = res.headers['Set-Cookie'].match(/((.*)[$ ])/)
199+
sysauth_value = res.get_cookies.scan(/((.*)[$ ])/).flatten[0] || ''
203200

204201
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}"
205202

modules/auxiliary/scanner/http/epmp1000_dump_config.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,11 @@ def do_login(user, pass)
141141

142142
good_response = (
143143
res &&
144-
res.code == 200 &&
145-
res.headers.include?('Set-Cookie') &&
146-
res.headers['Set-Cookie'].include?('sysauth')
144+
res.code == 200
147145
)
148146

149147
if good_response
150-
sysauth_value = res.headers['Set-Cookie'].match(/((.*)[$ ])/)
148+
sysauth_value = res.get_cookies.scan(/((.*)[$ ])/).flatten[0] || ''
151149

152150
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"
153151

@@ -173,8 +171,7 @@ def do_login(user, pass)
173171
good_response = (
174172
res &&
175173
res.code == 200 &&
176-
res.headers.include?('Set-Cookie') &&
177-
res.headers['Set-Cookie'].include?('stok=')
174+
res.get_cookies.scan(/(stok=(.*))/).flatten[0]
178175
)
179176

180177
if good_response
@@ -188,10 +185,10 @@ def do_login(user, pass)
188185
password: pass
189186
)
190187

191-
get_stok = res.headers['Set-Cookie'].match(/stok=(.*)/)
188+
get_stok = res.get_cookies.scan(/(stok=(.*))/) || ''
192189
if !get_stok.nil?
193190
stok_value = get_stok[1]
194-
sysauth_value = res.headers['Set-Cookie'].match(/((.*)[$ ])/)
191+
sysauth_value = res.get_cookies.scan(/((.*)[$ ])/).flatten[0] || ''
195192

196193
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}"
197194

modules/auxiliary/scanner/http/epmp1000_dump_hashes.rb

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,11 @@ def do_login(user, pass)
147147

148148
good_response = (
149149
res &&
150-
res.code == 200 &&
151-
res.headers.include?('Set-Cookie') &&
152-
res.headers['Set-Cookie'].include?('sysauth')
150+
res.code == 200
153151
)
154152

155153
if good_response
156-
sysauth_value = res.headers['Set-Cookie'].match(/((.*)[$ ])/)
154+
sysauth_value = res.get_cookies.scan(/((.*)[$ ])/).flatten[0] || ''
157155

158156
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"
159157

@@ -179,9 +177,7 @@ def do_login(user, pass)
179177

180178
good_response = (
181179
res &&
182-
res.code == 200 &&
183-
res.headers.include?('Set-Cookie') &&
184-
res.headers['Set-Cookie'].include?('stok=')
180+
res.code == 200
185181
)
186182

187183
if good_response
@@ -195,10 +191,10 @@ def do_login(user, pass)
195191
password: pass
196192
)
197193

198-
get_stok = res.headers['Set-Cookie'].match(/stok=(.*)/)
194+
get_stok = res.get_cookies.scan(/(stok=(.*))/) || ''
199195
if !get_stok.nil?
200196
stok_value = get_stok[1]
201-
sysauth_value = res.headers['Set-Cookie'].match(/((.*)[$ ])/)
197+
sysauth_value = res.get_cookies.scan(/((.*)[$ ])/).flatten[0] || ''
202198

203199
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}"
204200

modules/auxiliary/scanner/http/epmp1000_web_login.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,11 @@ def do_login(user, pass)
137137

138138
good_response = (
139139
res &&
140-
res.code == 200 &&
141-
res.headers.include?('Set-Cookie') &&
142-
res.headers['Set-Cookie'].include?('sysauth')
140+
res.code == 200
143141
)
144142

145143
if good_response
146-
sysauth_value = res.headers['Set-Cookie'].match(/((.*)[$ ])/)
144+
sysauth_value = res.get_cookies.scan(/((.*)[$ ])/).flatten[0] || ''
147145

148146
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"
149147

@@ -168,9 +166,7 @@ def do_login(user, pass)
168166

169167
good_response = (
170168
res &&
171-
res.code == 200 &&
172-
res.headers.include?('Set-Cookie') &&
173-
res.headers['Set-Cookie'].include?('stok=')
169+
res.code == 200
174170
)
175171

176172
if good_response

modules/exploits/windows/http/dupscts_bof.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

6-
require 'msf/core'
7-
86
class MetasploitModule < Msf::Exploit::Remote
97
Rank = GreatRanking
108

modules/exploits/windows/local/wmi_persistence.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
require 'msf/core/post/file'
99

1010
class MetasploitModule < Msf::Exploit::Local
11+
Rank = NormalRanking
1112

1213
include Msf::Post::Windows::Powershell
1314
include Msf::Exploit::Powershell
@@ -26,7 +27,7 @@ def initialize(info = {})
2627
The INTERVAL method will create an event filter that triggers the payload after the specified CALLBACK_INTERVAL. The LOGON
2728
method will create an event filter that will trigger the payload after the system has an uptime of 4 minutes. The PROCESS
2829
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
3031
before executing the payload. The signal can be sent from a windows host on a LAN utilising the waitfor.exe command
3132
(note: requires target to have port 445 open). Additionally a custom command can be specified to run once the trigger is
3233
activated using the advanced option CUSTOM_PS_COMMAND. This module requires administrator level privileges as well as a

0 commit comments

Comments
 (0)