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. 【noip 2009】 乌龟棋 记忆化搜索&动规

    题目背景 小明过生日的时候,爸爸送给他一副乌龟棋当作礼物. 题目描述 乌龟棋的棋盘是一行N个格子,每个格子上一个分数(非负整数).棋盘第1格是唯一的起点,第N格是终点,游戏要求玩家控制一个乌龟棋子从起 ...

  2. vs2015 动态链接库问题

    问题: 最近要用vs2015编写一个动态链接库,生成动态链接库后,换到另一台windows下发现无法使用. 使用depends检查发现原因是缺少 MSVCP140.DLL等动态链接库. 解决: 将编译 ...

  3. java-6数组

    一. 请编写一个程序将一个整数转换为汉字读法字符串.比如"1123"转换为"一千一百二十三".更进一步,能否将数字表示的金额改为"汉字表达?比如将&q ...

  4. React实例----一个表单验证比较复杂的页面

    前言:这阵子看了两本CSS的书~对于CSS层叠,定位,继承等机制基本上都了解了,就想着自己写几个页面~正好自己就写了写CSS样式,然后用React渲染出来~ 闲话不多说,简单说一说这个页面,希望能对大 ...

  5. JavaScript中国象棋程序(7) - 置换表

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

  6. MS office2010 ppt自动放映的设置方法

    在菜单“幻灯片放映”-“排练时间”,进入演示,然后设置每张幻灯片需要等待的时间后,手动切换到下一张(如图),一直放映结束,会提示你是否保存排练时间.然后在菜单“幻灯片放映”-“设置放映方式”,里面选择 ...

  7. Linux下软件设成系统服务运行

    将软件的启动脚本copy到/etc/init.d/soft_name             chmod 777 soft_name   设置服务开机启动   chkconfig soft_name ...

  8. WPF - 监听判断键盘组合键的按下

    对于键盘事件PreviewKeyDown.PreviewKeyUp.KeyDown.KeyUp,在其中检查当次事件是哪个按键触发的很简单,只需要判断KeyEventArgs类型的事件参数e的Key属性 ...

  9. 警惕一大波银行类木马正在靠近,新型BankBot木马解析

    背景 来自安全公司Dr.Web的研究人员说,最近一个未命名的Android银行木马源代码在地下黑客论坛遭到了泄露.就在近期,阿里聚安全检测到大量新型BankBot家族木马,木马伪装成Good Weat ...

  10. mfc---获取当前时间

    CTime t = CTime::GetCurrentTime(); CString strTime = t.format("%Y/&m%d" %h:%M:%S);