0x00 环境准备

五指CMS官网:https://www.wuzhicms.com/

网站源码版本:五指CMS v4.1.0 UTF-8 开源版

程序源码下载:https://www.wuzhicms.com/download/

测试网站首页:

0x01 代码分析

1、漏洞文件位置:/coreframe/app/promote/admin/index.php 第42-60行:

  1. public function search() {
  2. $siteid = get_cookie('siteid');
  3. $page = isset($GLOBALS['page']) ? intval($GLOBALS['page']) : 1;
  4. $page = max($page,1);
  5. $fieldtype = $GLOBALS['fieldtype'];
  6. $keywords = $GLOBALS['keywords'];
  7. if($fieldtype=='place') {
  8. $where = "`siteid`='$siteid' AND `name` LIKE '%$keywords%'";
  9. $result = $this->db->get_list('promote_place', $where, '*', 0, 50,$page,'pid ASC');
  10. 10.         $pages = $this->db->pages;
  11. 11.         $total = $this->db->number;
  12. 12.         include $this->template('listingplace');
  13. 13.     } else {
  14. 14.         $where = "`siteid`='$siteid' AND `$fieldtype` LIKE '%$keywords%'";
  15. 15.         $result = $this->db->get_list('promote',$where, '*', 0, 20,$page,'id DESC');
  16. 16.         $pages = $this->db->pages;
  17. 17.         $total = $this->db->number;
  18. 18.         include $this->template('listing');
  19. 19.     }

这段函数将获取到的keywords参数拼接到SQL语句,然后带入数据库执行,导致程序在实现上存在SQL注入漏洞,攻击者可利用该漏洞获取数据库敏感信息。

0x02 漏洞利用

1、构造url链接,使用SQLMAP可获取数据库敏感数据。

Payload:

http://127.0.0.1/index.php?m=promote&f=index&v=search&_su=wuzhicms&fieldtype=place&keywords=1111%'*%23

0x03 修复建议

使用参数化查询可有效避免SQL注入

最后

欢迎关注个人微信公众号:Bypass--,每周原创一篇技术干货。 

【代码审计】五指CMS_v4.1.0 后台存在SQL注入漏洞分析的更多相关文章

  1. Beescms_v4.0 sql注入漏洞分析

    Beescms_v4.0 sql注入漏洞分析 一.漏洞描述 Beescms v4.0由于后台登录验证码设计缺陷以及代码防护缺陷导致存在bypass全局防护的SQL注入. 二.漏洞环境搭建 1.官方下载 ...

  2. PHPCMS \phpcms\modules\member\index.php 用户登陆SQL注入漏洞分析

    catalog . 漏洞描述 . 漏洞触发条件 . 漏洞影响范围 . 漏洞代码分析 . 防御方法 . 攻防思考 1. 漏洞描述2. 漏洞触发条件 0x1: POC http://localhost/p ...

  3. 【代码审计】五指CMS_v4.1.0 copyfrom.php 页面存在SQL注入漏洞分析

      0x00 环境准备 五指CMS官网:https://www.wuzhicms.com/ 网站源码版本:五指CMS v4.1.0 UTF-8 开源版 程序源码下载:https://www.wuzhi ...

  4. 【代码审计】iZhanCMS_v2.1 后台存在多个SQL注入漏洞分析

      0x00 环境准备 iZhanCMS官网:http://www.izhancms.com 网站源码版本:爱站CMS(zend6.0) V2.1 程序源码下载:http://www.izhancms ...

  5. 【代码审计】iCMS_v7.0.7 admincp.app.php页面存在SQL注入漏洞分析

      0x00 环境准备 iCMS官网:https://www.icmsdev.com 网站源码版本:iCMS-v7.0.7 程序源码下载:https://www.icmsdev.com/downloa ...

  6. 【代码审计】iCMS_v7.0.7 apps.admincp.php页面存在SQL注入漏洞分析

      0x00 环境准备 iCMS官网:https://www.icmsdev.com 网站源码版本:iCMS-v7.0.7 程序源码下载:https://www.icmsdev.com/downloa ...

  7. 【代码审计】iCMS_v7.0.7 keywords.admincp.php页面存在SQL注入漏洞分析

      0x00 环境准备 iCMS官网:https://www.icmsdev.com 网站源码版本:iCMS-v7.0.7 程序源码下载:https://www.icmsdev.com/downloa ...

  8. 【代码审计】iZhanCMS_v2.1 前台IndexController.php页面存在SQL注入 漏洞分析

      0x00 环境准备 iZhanCMS官网:http://www.izhancms.com 网站源码版本:爱站CMS(zend6.0) V2.1 程序源码下载:http://www.izhancms ...

  9. 【代码审计】iZhanCMS_v2.1 前台GoodsController.php页面存在SQL注入漏洞分析

      0x00 环境准备 iZhanCMS官网:http://www.izhancms.com 网站源码版本:爱站CMS(zend6.0) V2.1 程序源码下载:http://www.izhancms ...

随机推荐

  1. 迭代函数:zip、enumerate,list解析

    #encoding:utf-8 """ 并行迭代: zip enumerate 获取元素及下标 list解析 iter """ #zip # ...

  2. Spring 3.1 M1: Unified Property Management(转)

    In the first two posts of this series, I described the bean definition profiles feature, and how it ...

  3. 在AngularJS中使用谷歌地图把当前位置显示出来

    如何使用谷歌地图把当前位置显示出来呢? --在html5中,为我们提供了navigator.geolocation.getCurrentPosition(f1, f2)函数,f1是定位成功调用的函数, ...

  4. OUI启动时的小错误PRVF-0002

    [oracle@bys3 database]$ Starting Oracle Universal Installer... Checking Temp space: must be greater ...

  5. android: 在android studio中使用retrolambda的步骤

    找了各种说明,包括retrolambda官方文档都没有试成功 最后在这个链接中找到答案:http://blog.csdn.net/qq_26819733/article/details/5222565 ...

  6. postgre 导出单表和导入

    pg除了可以通过dump的方式导入和导出.如果只是导出数据,可以直接使用copy 导出 COPY user TO '/tmp/data/test.csv' WITH csv; COPY user(na ...

  7. 未解决:长字符串含…

    用reduce拼了一个超长sql语句,大约65000字符,运行通不过,报错: OperationalError: (1054, "Unknown column 'nan' in 'field ...

  8. grid - 显式网格

    显式网格布局包含:行.列 列 grid-template-columns page { color: #fff; } .grid { padding:1%; display: grid; grid-g ...

  9. Microsoft/Git-Credential-Manager-for-Mac-and-Linux

    纠正Mac上的错误: Fatal: java.lang.Error encountered. Details: unexpected errorfatal: credential helper '!/ ...

  10. javascript验证QQ号、邮箱和手机号码

    //验证QQ号码5-11位 function isQQ(qq) { var filter = /^\s*[.0-9]{5,11}\s*$/; if (!filter.test(qq)) { retur ...