加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cdn.py 1.54 KB
一键复制 编辑 原始数据 按行查看 历史
phantomer 提交于 2016-03-01 22:53 . update
# 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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化