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. JAVA中浮点数显示

    //Java小数点后留两位 double num1 =11; double num2 =21; String num3 =""; //函数可以确定十进制数的显示格式:百分数,限定小 ...

  2. Asp.Net MVC学习总结(一)——Asp.Net MVC简单入门

    一.MVC简单入门 1.1.MVC概念 视图(View) 代表用户交互界面,对于Web应用来说,可以概括为HTML界面,但有可能为XHTML.XML和Applet. 模型(Model) 表示用户对其数 ...

  3. Java编程测试_类的使用

    package test; class A { private static int i; // Static, Private Attribute private static int j; // ...

  4. python数据结构(一)------序列

    数据结构是通过某种方式(例如对元素进行编号)组织在一起的数据元素的集合:在Python中,最基本的数据结构是序列(sequence),序列中的每个元素被分配一个序列号--即元素的位置,也称为索引. p ...

  5. vpn服务搭建

    先安装pptpd服务,就是VPN连接的软件模块. 输入:yum install ppp iptables pptpd 安装完成之后 A:编辑pptpd.conf: 输入:vim /etc/pptpd. ...

  6. 前端基本知识(三):JS的闭包理解

    JS闭包的理解 一.变量的作用域 二.如何从外部读取局部变量 三.什么是闭包 四.深入理解闭包 五.闭包的用途 六.使用闭包注意情况 七.JavaScript的垃圾回收机制 八.一些思考题 一.变量作 ...

  7. 学好UI你必须要掌握这些技术

    转自:http://blog.sina.com.cn/s/blog_15da22ed10102x0gx.html ui设计现在已经是设计行业中的瞩目之星,无论在PC端.移动端还是游戏上都是大放异彩. ...

  8. jpush 延迟推送的栗子

    这个 推送是上个月做的, 上线之后没有问题,所以,我就把 这个整套代码 整理一哈,方便以后使用. 首先需求是这样的:  在比赛结束后的 10 钟 开始给 参加比赛的球员  发送消息,告诉他们比赛的信息 ...

  9. MyBatis的类型自定义映射

    背景 利用MyBatis将数据库的时间类型映射成Java8的时间类型,引申对不同类型的自定义映射 实现方法 1.实现MyBatis中TypeHandler接口 @MappedTypes(value = ...

  10. TokuDB性能测试报告

    一 .背景介绍 近年来,TokuDB作为MySQL的大数据(Big Data)存储引擎受到人们的普遍关注.其架构的核心基于一种新的叫做分形树(Fractal Trees)的索引数据结构,该结构是缓存无 ...