代码拉取完成,页面将自动刷新
# encoding: utf-8
import sys
reload(sys)
sys.path.append("../../")
sys.setdefaultencoding('utf-8')
import json
from utils.misc import *
from utils.plugin.blacklist import Blacklist
class Resolver_17ce(object):
"""docstring for Resolver_17ce"""
def __init__(self, domain):
super(Resolver_17ce, self).__init__()
self.domain = domain
self.server = 'http://www.17ce.com'
self.iplist = []
def run(self):
tid = self.get_tid()
if tid is not None:
url = '{0}/apis/ajaxfresh?callback=&tid={1}&num=0&ajax_over=0'.format(
self.server, tid)
for ip in self.parser(self.get_content(url)):
self.iplist.append(ip)
def get_tid(self):
url = '{0}/apis/dns?callback=&url={1}&curl=&rt=1&nocache=0&host=&referer=&cookie=&agent=&speed=&pingcount=&pingsize=&area[]=0&area[]=1&area[]=2&area[]=3&&isp[]=0&isp[]=1&isp[]=2&isp[]=6&isp[]=7&isp[]=8&isp[]=4'.format(
self.server, self.domain)
_regex = re.search('","tid":"(.*?)","pre":""', self.get_content(url))
return _regex.group(1) if _regex else None
def parser(self, content):
_regex = re.compile(r'(?<=\[\{\"srcip\"\:\").*?(?=\",\"ipfrom\")', re.DOTALL)
ips = _regex.findall(content)
for item in list(set(ips)):
yield item
def get_content(self, url):
response = http_request_get(url).content
return response if response is not None else ''
resolver = Resolver_17ce('www.wooyun.org')
resolver.run()
print resolver.iplist
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。