Skip to content

Commit 2d8e3c7

Browse files
committed
Minor edits
1 parent 3ab214e commit 2d8e3c7

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

modules/auxiliary/scanner/http/gavazzi_em_login_loot.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ def is_app_carlogavazzi?
6969
return false
7070
end
7171

72-
if (res && res.code == 200 && (res.body.include?('Accedi') || res.body.include?('Gavazzi') || res.body.include?('styleVMUC.css') || res.body.include?('VMUC')))
72+
good_response = (
73+
res &&
74+
res.code == 200 &&
75+
res.body.include?('Accedi') || res.body.include?('Gavazzi') || res.body.include?('styleVMUC.css') || res.body.include?('VMUC')
76+
)
77+
78+
if good_response
7379
vprint_good("#{rhost}:#{rport} - Running Carlo Gavazzi VMU-C Web Management portal...")
7480
return true
7581
else
@@ -138,7 +144,14 @@ def do_login(user, pass)
138144
return :abort
139145
end
140146

141-
if (res && ((res.code == 200 && (res.body.include?('Login in progress') || res.body.include?('Login in corso')) && res.body.match(/id="error" value="2"/)) || (res.code == 302 && res.headers['Location'] == 'disclaimer.php')))
147+
good_response = (
148+
res &&
149+
res.code == 200 &&
150+
res.body.include?('Login in progress') || res.body.include?('Login in corso') &&
151+
res.body.match(/id="error" value="2"/) || (res.code == 302 && res.headers['Location'] == 'disclaimer.php')
152+
)
153+
154+
if good_response
142155
print_good("SUCCESSFUL LOGIN - #{rhost}:#{rport} - #{user.inspect}:#{pass.inspect}")
143156

144157
# Extract firmware version

0 commit comments

Comments
 (0)