Files
BLEN/poc/CtCMS_赤兔CMS/Get_Banner/poc.py
openx-org 8a6bd53d07 11
2022-01-04 17:24:54 +08:00

78 lines
3.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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
"CreateDate" : "2021-06-09", # POC创建时间
"UpdateDate" : "2021-06-09", # POC创建时间
"PocDesc" : """
笔者在审这个cms的时候顺手写的
之所以写两个url是因为cms有两套路由方式因此两个url其实指向的是同一份文件
""", # POC描述写更新描述没有就不写
"name" : "赤兔CMS banner识别插件", # 漏洞名称
"VulnID" : "Blen-2021-0001", # 漏洞编号以CVE为主若无CVE使用CNVD若无CNVD留空即可
"AppName" : "赤兔CMS", # 漏洞应用名称
"AppVersion" : "", # 漏洞应用版本
"VulnDate" : "2021-06-09", # 漏洞公开的时间,不知道就写今天格式xxxx-xx-xx
"VulnDesc" : """
这不是漏洞检测脚本是一个名为赤兔的cms的识别插件
""", # 漏洞简要描述
"fofa-dork":"""
app="ctcms"
""", # fofa搜索语句
"example" : "https://47.56.204.124:443", # 存在漏洞的演示url写一个就可以了
"exp_img" : "", # 先不管
}
def _verify(self):
"""
返回vuln
存在漏洞vuln = [True,html_source] # html_source就是页面源码
不存在漏洞vuln = [False,""]
"""
vuln = [False,""]
url0 = self.target + "/index.php?c=index&m=short" # url自己按需调整
url1 = self.target + "/index.php/index/short" # url自己按需调整
headers = {"User-Agent":get_random_ua(),
"Connection":"close",
# "Content-Type": "application/x-www-form-urlencoded",
}
try:
"""
检测逻辑漏洞存在则修改vuln值为True漏洞不存在则不动
"""
req0 = requests.get(url0,headers = headers , proxies = self.proxy ,timeout = self.timeout,verify = False)
if "[InternetShortcut]" in req0.text and "IDList=" in req0.text and req0.status_code == 200 :
vuln = [True,req0.text]
else:
req1 = requests.get(url1,headers = headers , proxies = self.proxy ,timeout = self.timeout,verify = False)
if "[InternetShortcut]" in req1.text and "IDList=" in req1.text and req1.status_code == 200 :
vuln = [True,req1.text]
# 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()