Minor edits
parent
6bd09c142f
commit
3ab214e758
|
@ -157,39 +157,17 @@ class MetasploitModule < Msf::Auxiliary
|
||||||
return :abort
|
return :abort
|
||||||
end
|
end
|
||||||
|
|
||||||
if (res && res.code == 200 && res.body.include?('Firmware Version'))
|
if res && res.code == 200
|
||||||
fw_ver_dirty = res.body.match(/Firmware Version(.*)(.*)td/)
|
if res.body.include?('Firmware Version') || res.body.include?('Versione Firmware')
|
||||||
|
fw_ver = res.body.match(/Ver. (.*)[$<]/)[1]
|
||||||
|
|
||||||
if !fw_ver_dirty.nil?
|
if !fw_ver.nil?
|
||||||
fw_ver_clean = "#{fw_ver_dirty}".match(/Ver. (.*)[$<]/)[1]
|
print_good("#{rhost}:#{rport} - Firmware version #{fw_ver}...")
|
||||||
|
|
||||||
if !fw_ver_clean.nil?
|
|
||||||
print_good("#{rhost}:#{rport} - Firmware version #{fw_ver_clean}...")
|
|
||||||
|
|
||||||
report_cred(
|
report_cred(
|
||||||
ip: rhost,
|
ip: rhost,
|
||||||
port: rport,
|
port: rport,
|
||||||
service_name: "Carlo Gavazzi Energy Meter [Firmware ver #{fw_ver_clean}]",
|
service_name: "Carlo Gavazzi Energy Meter [Firmware ver #{fw_ver}]",
|
||||||
user: user,
|
|
||||||
password: pass
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if (res && res.code == 200 && res.body.include?('Versione Firmware Installata'))
|
|
||||||
fw_ver_dirty = res.body.match(/Ver. (.*)[$<]/)
|
|
||||||
|
|
||||||
if !fw_ver_dirty.nil?
|
|
||||||
fw_ver_clean = "#{fw_ver_dirty}".match(/[^Ver. ](.*)[^<]/)
|
|
||||||
|
|
||||||
if !fw_ver_clean.nil?
|
|
||||||
print_good("#{rhost}:#{rport} - Firmware version #{fw_ver_clean}...")
|
|
||||||
|
|
||||||
report_cred(
|
|
||||||
ip: rhost,
|
|
||||||
port: rport,
|
|
||||||
service_name: "Carlo Gavazzi Energy Meter [Firmware ver #{fw_ver_clean}]",
|
|
||||||
user: user,
|
user: user,
|
||||||
password: pass
|
password: pass
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue