Zabbix 2.2.x, 3.0.x SQL注射漏洞修复方法
1.漏洞测试
在您的zabbix的地址后面加上如下url:
jsrpc.php?type=&method=screen.get×tamp=&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×tamp=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: → CScreenHistory->get() → 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: → CScreenHistory->get() → 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注射漏洞修复方法的更多相关文章
- DT6.0关于SQL注入漏洞修复问题
阿里云安全平台提示:Destoon SQL注入,关于: Destoon的/mobile/guestbook.php中$do->add($post);这行代码对参数$post未进行正确转义,导致黑 ...
- Zabbix的前台SQL注射漏洞利用
今年8月份Map在wooyun上发了个Zabbix某前台SQL注射漏洞 ,11月份才公开. 漏洞详情大约是这样的: 在zabbix前端存在一个SQL注射漏洞,由于zabbix前台可以在zabbix的s ...
- SQL注入漏洞解决方法
本文只指针编码层次的SQL注入漏洞解决方法,例子代码是以java为主. 1,参数化的预编译查询语句 不安全例子 String query = "SELECT account_balance ...
- 关于ECSHOP中sql注入漏洞修复
标签:ecshop sql注入漏洞修复 公司部署了一个ecshop网站用于做网上商城使用,部署在阿里云服务器上,第二天收到阿里云控制台发来的告警信息,发现ecshop网站目录下文件sql注入漏洞以及程 ...
- 网站sql注入漏洞修复方案之metinfo 6.1.0系列
近日,我们SINE安全对metinfo进行网站安全检测发现,metinfo米拓建站系统存在高危的sql注入漏洞,攻击者可以利用该漏洞对网站的代码进行sql注入攻击,伪造恶意的sql非法语句,对网站的数 ...
- HBase2.0 meta信息丢失的修复方法
在HBase入库日志中发现有一个表入库失败,检查HBase服务端后发现该表的meta信息丢失了: 而HDFS上的region还在: 而HBCK工具不支持HBase2.0版本,只好自己写一个修复工具.网 ...
- Joomla!3.7.0 Core SQL注入漏洞动态调试草稿
参考joolma的mvc框架讲解:http://www.360doc.com/content/11/1219/18/1372409_173441270.shtml 从这个页面开始下断点:Joomla_ ...
- 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 ...
- sql注入数据库修复方法
1.第一种情况是 需要将指定的 注入字符串全部替换掉(仅替换注入的字符串为空) declare @delStr nvarchar(500) set @delStr='<script src=ht ...
随机推荐
- 使用JAVA开发微信公众平台(一)——环境搭建与开发接入
一. 初始微信公众平台 微信公众平台,即我们平时所说的"公众号",曾用名"官方平台"."媒体平台",但最终命名为"公众平台&quo ...
- wap网页、微信内嵌网页在手机端页面窗口尺寸如何不缩放
如何让wap网页.微信内嵌网页内容(尺寸和文字)在手机端页面窗口尺寸不被强制缩放 在head中加入: <meta http-equiv="Content-Type" cont ...
- python3 UnicodeEncodeError: 'gbk' codec can't encode character '\uff70' in position 75267: illegal multibyte sequence
当你爬出想要的数据了,却发现中文是乱码的时候?请你计算下你内心的阴影面积 ! 菊个栗子: #!/usr/bin/env python3# -*- coding: utf-8 -*-import ioi ...
- iOS 设置#ffff 这种颜色
UI给图的时候给的是#f2f2f2 让我设置.没有你要的rgb. 所以只能自行解决封装了代码 HexColors.h #import "TargetConditionals.h" ...
- AngularJS2环境配置
所使用到的文件目录结构如下所示: 1. 创建配置文件: 1.1. 创建目录: mkdir angular-quickstart cd angular-quickstart 1.2. 载入 ...
- KVO的概述与使用
一,概述 KVO,即:Key-Value Observing,它提供一种机制,当指定的对象的属性被修改后,则对象就会接受到通知.简单的说就是每次指定的被观察的对象的属性被修改后,KVO就会自动通知 ...
- 关于H5里的API,上传图片预览功能
FileReader:读取本地图片文件并显示 写在开头 之前公司要求做一个H5页面,功能是照相和选择相册相片,并且能在屏幕上预览.然后我就傻里吧唧的各种找插件,因为有些插件不适配手机的型号,安卓机基本 ...
- Docker存储驱动之Btrfs简介
简介 Btrfs是下一代的copy-on-write文件系统,它支持很多高级特性,使其更加适合Docker.Btrfs合并在内核主线中,并且它的on-disk-format也逐渐稳定了.不过,它的很多 ...
- php弱类型语言中的类型判断
1.php一个数字和一个字符串进行比较或者进行运算时,PHP会把字符串转换成数字再进行比较.PHP转换的规则的是:若字符串以数字开头,则取开头数字作为转换结果,若无则输出0. 例如:123abc转换后 ...
- 2017-2-22 if语句 if语句的嵌套 以及课堂练习 经典猜拳游戏,闰年判断,输出当前时间的天数等
(一)if语句 1.格式 if(){ }else if() { } 注意:如果if后面不写花括号,只执行下面第一句 (二)语句1:顺序语句 2:循环语句 3:分支语句 课后练习: 1.猜拳游戏(用 ...