1.漏洞测试

在您的zabbix的地址后面加上如下url:

jsrpc.php?type=&method=screen.get&timestamp=&pageFile=history.php&profileIdx=web.item.graph&profileIdx=+or+updatexml(,md5(0x11),)+or+=)%&updateProfile=true&period=&stime=&resourcetype=

我的地址如下:

http://10.192.1168.153/zabbix/jsrpc.php?type=9&method=screen.get&timestamp=1471403798083&pageFile=history.php&profileIdx=web.item.graph&profileIdx2=1+or+updatexml(1,md5(0x11),1)+or+1=1)%23&updateProfile=true&period=3600&stime=20160817050632&resourcetype=17

输出结果,如下表示漏洞存在:

<div class="flickerfreescreen" id="flickerfreescreen_1" data-timestamp="" style="position: relative;"></div><table class="msgerr" cellpadding="" cellspacing="" id="msg_messages" style="width: 100%;"><tr><td class="msg" colspan=""><ul class="messages"><li class="error">reset() expects parameter  to be array, null given [jsrpc.php: &rarr; CScreenHistory-&gt;get() &rarr; reset() in /var/www/html/zabbix/include/classes/screens/CScreenHistory.php:]</li><li class="error">Error in query [INSERT INTO profiles (profileid, userid, idx, value_int, type, idx2) VALUES (, , 'web.item.graph.period', '', ,  or updatexml(,md5(0x11),) or =)#)] [XPATH syntax error: 'ed733b8d10be225eceba344d533586']</li><li class="error">Error in query [INSERT INTO profiles (profileid, userid, idx, value_str, type, idx2) VALUES (, , 'web.item.graph.stime', '', ,  or updatexml(,md5(0x11),) or =)#)] [XPATH syntax error: 'ed733b8d10be225eceba344d533586']</li><li class="error">Error in query [INSERT INTO profiles (profileid, userid, idx, value_int, type, idx2) VALUES (, , 'web.item.graph.isnow', '', ,  or updatexml(,md5(0x11),) or =)#)] [XPATH syntax error: 'ed733b8d10be225eceba344d533586']</li></ul></td></tr></table>

2.修复方案

1).升级包链接地址[https://support.zabbix.com/browse/ZBX-11023](https://support.zabbix.com/browse/ZBX-11023)

2).暴力的修补方法是对CProfile类的flush方法中注入参数做强制整形转换即可 /var/www/html/zabbix/include/classes/user/CProfile.php:

 public static function flush() {
$result = false; if (self::$profiles !== null && self::$userDetails['userid'] > && self::isModified()) {
$result = true; foreach (self::$insert as $idx => $profile) {
foreach ($profile as $idx2 => $data) {
$result &= self::insertDB($idx, $data['value'], $data['type'],zbx_dbstr($idx2));
}
} ksort(self::$update);
foreach (self::$update as $idx => $profile) {
ksort($profile);
foreach ($profile as $idx2 => $data) {
//这里用intval($idx2)或者zbx_dbstr($idx2)替换原来的$idx2
$result &= self::updateDB($idx, $data['value'], $data['type'], zbx_dbstr($idx2));
}
}
} return $result;
}

修改后再用原漏洞测试Url,结果如下:

<div class="flickerfreescreen" id="flickerfreescreen_1" data-timestamp="" style="position: relative;"></div><table class="msgerr" cellpadding="" cellspacing="" id="msg_messages" style="width: 100%;"><tr><td class="msg" colspan=""><ul class="messages"><li class="error">reset() expects parameter  to be array, null given [jsrpc.php: &rarr; CScreenHistory-&gt;get() &rarr; reset() in /var/www/html/zabbix/include/classes/screens/CScreenHistory.php:]</li></ul></td></tr></table>

参考文档:

http://www.cnbraid.com/2016/08/18/zabbix303/

http://www.oschina.net/news/76236/zabbix-sql

http://seclists.org/fulldisclosure/2016/Aug/60

http://seclists.org/fulldisclosure/2016/Aug/79

Zabbix 2.2.x, 3.0.x SQL注射漏洞修复方法的更多相关文章

  1. DT6.0关于SQL注入漏洞修复问题

    阿里云安全平台提示:Destoon SQL注入,关于: Destoon的/mobile/guestbook.php中$do->add($post);这行代码对参数$post未进行正确转义,导致黑 ...

  2. Zabbix的前台SQL注射漏洞利用

    今年8月份Map在wooyun上发了个Zabbix某前台SQL注射漏洞 ,11月份才公开. 漏洞详情大约是这样的: 在zabbix前端存在一个SQL注射漏洞,由于zabbix前台可以在zabbix的s ...

  3. SQL注入漏洞解决方法

    本文只指针编码层次的SQL注入漏洞解决方法,例子代码是以java为主. 1,参数化的预编译查询语句 不安全例子 String query = "SELECT account_balance ...

  4. 关于ECSHOP中sql注入漏洞修复

    标签:ecshop sql注入漏洞修复 公司部署了一个ecshop网站用于做网上商城使用,部署在阿里云服务器上,第二天收到阿里云控制台发来的告警信息,发现ecshop网站目录下文件sql注入漏洞以及程 ...

  5. 网站sql注入漏洞修复方案之metinfo 6.1.0系列

    近日,我们SINE安全对metinfo进行网站安全检测发现,metinfo米拓建站系统存在高危的sql注入漏洞,攻击者可以利用该漏洞对网站的代码进行sql注入攻击,伪造恶意的sql非法语句,对网站的数 ...

  6. HBase2.0 meta信息丢失的修复方法

    在HBase入库日志中发现有一个表入库失败,检查HBase服务端后发现该表的meta信息丢失了: 而HDFS上的region还在: 而HBCK工具不支持HBase2.0版本,只好自己写一个修复工具.网 ...

  7. Joomla!3.7.0 Core SQL注入漏洞动态调试草稿

    参考joolma的mvc框架讲解:http://www.360doc.com/content/11/1219/18/1372409_173441270.shtml 从这个页面开始下断点:Joomla_ ...

  8. joomla 3.7.0 (CVE-2017-8917) SQL注入漏洞

    影响版本: 3.7.0 poc http://192.168.49.2:8080/index.php?option=com_fields&view=fields&layout=moda ...

  9. sql注入数据库修复方法

    1.第一种情况是 需要将指定的 注入字符串全部替换掉(仅替换注入的字符串为空) declare @delStr nvarchar(500) set @delStr='<script src=ht ...

随机推荐

  1. echarts 显示下载按钮,echarts 自定义按钮,echarts 添加按钮

    echarts 显示下载按钮,echarts 自定义按钮,echarts 添加按钮 >>>>>>>>>>>>>>&g ...

  2. 虚拟机网络配置详解(NAT、桥接、Hostonly)

    VirtualBox中有四种网络连接方式: NAT Bridged Adapter Internal Host-only Adapter VMWare中有三种,其实它跟VMWare的网络连接方式都是一 ...

  3. cmake的两个命令: option 和 configure_file

    本节要讨论的是cmake的两个命令: option 和 configure_file option 选项,让你可以根据选项值进行条件编译. configure_file 配置文件,让你可以在代码文件中 ...

  4. HDU 2520 我是菜鸟,我怕谁

    我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  5. 三层——c#版

    首先,向大家通知一个好消息--我的三层终于实现了!!!这两天,一直在调一个bug一直链接不上数据库,弄得我死的心都有了.就在昨天,当我把一个","改成了":"后 ...

  6. python实现多变量线性回归(Linear Regression with Multiple Variables)

    本文介绍如何使用python实现多变量线性回归,文章参考NG的视频和黄海广博士的笔记 现在对房价模型增加更多的特征,例如房间数楼层等,构成一个含有多个变量的模型,模型中的特征为( x1,x2,..., ...

  7. Codeforces 719B Anatoly and Cockroaches

    B. Anatoly and Cockroaches time limit per test:1 second memory limit per test:256 megabytes input:st ...

  8. JavaScript中国象棋程序(2) - 校验棋子走法

    "JavaScript中国象棋程序" 这一系列教程将带你从头使用JavaScript编写一个中国象棋程序.这是教程的第2节. 这一系列共有9个部分: 0.JavaScript中国象 ...

  9. [Linux] PHP程序员玩转Linux系列-搭建代码开发环境

    1.PHP程序员玩转Linux系列-怎么安装使用CentOS 2.PHP程序员玩转Linux系列-lnmp环境的搭建 有些同学可能觉得我写的都是啥yum安装的,随便配置一下而已,没啥技术含量,我的目的 ...

  10. WP8.1开发中关于如何显示.gif格式动态格式图片方法

    这几天又遇到个问题,就是如何显示动态图片,本来以为和显示静态图片一样,谁知不行,在网上一查才知道WP8.1不支持.gif格式动态图片的显示: 后来又在MSDN论坛上查找,也有人问类似的问题,后来就大概 ...