File tree Expand file tree Collapse file tree 1 file changed +6
-28
lines changed
modules/auxiliary/scanner/http Expand file tree Collapse file tree 1 file changed +6
-28
lines changed Original file line number Diff line number Diff line change @@ -157,39 +157,17 @@ def do_login(user, pass)
157
157
return :abort
158
158
end
159
159
160
- if ( res && res . code == 200 && res . body . include? ( 'Firmware Version' ) )
161
- fw_ver_dirty = res . body . match ( /Firmware Version(.*)(.*)td/ )
160
+ if res && res . code == 200
161
+ if res . body . include? ( 'Firmware Version' ) || res . body . include? ( 'Versione Firmware' )
162
+ fw_ver = res . body . match ( /Ver. (.*)[$<]/ ) [ 1 ]
162
163
163
- if !fw_ver_dirty . nil?
164
- fw_ver_clean = "#{ fw_ver_dirty } " . match ( /Ver. (.*)[$<]/ ) [ 1 ]
165
-
166
- if !fw_ver_clean . nil?
167
- print_good ( "#{ rhost } :#{ rport } - Firmware version #{ fw_ver_clean } ..." )
168
-
169
- report_cred (
170
- ip : rhost ,
171
- port : rport ,
172
- service_name : "Carlo Gavazzi Energy Meter [Firmware ver #{ fw_ver_clean } ]" ,
173
- user : user ,
174
- password : pass
175
- )
176
- end
177
- end
178
- end
179
-
180
- if ( res && res . code == 200 && res . body . include? ( 'Versione Firmware Installata' ) )
181
- fw_ver_dirty = res . body . match ( /Ver. (.*)[$<]/ )
182
-
183
- if !fw_ver_dirty . nil?
184
- fw_ver_clean = "#{ fw_ver_dirty } " . match ( /[^Ver. ](.*)[^<]/ )
185
-
186
- if !fw_ver_clean . nil?
187
- print_good ( "#{ rhost } :#{ rport } - Firmware version #{ fw_ver_clean } ..." )
164
+ if !fw_ver . nil?
165
+ print_good ( "#{ rhost } :#{ rport } - Firmware version #{ fw_ver } ..." )
188
166
189
167
report_cred (
190
168
ip : rhost ,
191
169
port : rport ,
192
- service_name : "Carlo Gavazzi Energy Meter [Firmware ver #{ fw_ver_clean } ]" ,
170
+ service_name : "Carlo Gavazzi Energy Meter [Firmware ver #{ fw_ver } ]" ,
193
171
user : user ,
194
172
password : pass
195
173
)
You can’t perform that action at this time.
0 commit comments