This commit is contained in:
Jing Ling
2020-08-08 18:00:36 +08:00
parent 69ce692ff1
commit 4f462fcd60
76 changed files with 177 additions and 207 deletions
-2
View File
@@ -518,8 +518,6 @@ class Brute(Module):
if self.fuzz: if self.fuzz:
fuzz_subdomains = gen_fuzz_subdomains(self.place, self.rule) fuzz_subdomains = gen_fuzz_subdomains(self.place, self.rule)
dict_set = dict_set.union(fuzz_subdomains) dict_set = dict_set.union(fuzz_subdomains)
# logger.log('INFOR', f'正在去重爆破字典')
# dict_set = utils.uniq_dict_list(dict_set)
count = len(dict_set) count = len(dict_set)
logger.log('INFOR', f'Dictionary size: {count}') logger.log('INFOR', f'Dictionary size: {count}')
if count > 10000000: if count > 10000000:
-3
View File
@@ -1,6 +1,3 @@
#!/usr/bin/env python3
# coding=utf-8
""" """
SQLite database initialization and operation SQLite database initialization and operation
""" """
-2
View File
@@ -1,4 +1,3 @@
# coding=utf-8
""" """
Module base class Module base class
""" """
@@ -11,7 +10,6 @@ import requests
from config.log import logger from config.log import logger
from config import settings from config import settings
from common import utils from common import utils
from common.domain import Domain
from common.database import Database from common.database import Database
lock = threading.Lock() lock = threading.Lock()
-2
View File
@@ -16,8 +16,6 @@ def get_limit_conn():
limit_open_conn = settings.limit_open_conn limit_open_conn = settings.limit_open_conn
if limit_open_conn is None: # 默认情况 if limit_open_conn is None: # 默认情况
limit_open_conn = utils.get_semaphore() limit_open_conn = utils.get_semaphore()
elif not isinstance(limit_open_conn, int): # 如果传入不是数字的情况
limit_open_conn = utils.get_semaphore()
return limit_open_conn return limit_open_conn
-1
View File
@@ -4,7 +4,6 @@ import json
from config.log import logger from config.log import logger
from config import settings from config import settings
from common import utils from common import utils
from common.database import Database
from common.ipasn import IPAsnInfo from common.ipasn import IPAsnInfo
from common.ipgeo import IpGeoInfo from common.ipgeo import IpGeoInfo
from common.ipreg import IpRegInfo from common.ipreg import IpRegInfo
-3
View File
@@ -1,7 +1,4 @@
import re
from config import settings from config import settings
from config.log import logger
from common.module import Module from common.module import Module
+1 -2
View File
@@ -572,8 +572,7 @@ def check_pre():
if version < '3.6': if version < '3.6':
logger.log('FATAL', 'OneForAll requires Python 3.6 or higher') logger.log('FATAL', 'OneForAll requires Python 3.6 or higher')
exit(1) exit(1)
if system == 'Windows' and implementation == 'CPython': if system == 'Windows' and implementation == 'CPython' and version < '3.8':
if version < '3.8':
logger.log('FATAL', 'OneForAll requires Python 3.8 ' logger.log('FATAL', 'OneForAll requires Python 3.8 '
'or higher when running on Windows') 'or higher when running on Windows')
exit(1) exit(1)
+2 -2
View File
@@ -58,7 +58,7 @@ class CensysAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -69,4 +69,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -37,7 +37,7 @@ class CertSpotter(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -49,4 +49,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -35,7 +35,7 @@ class Crtsh(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -46,4 +46,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -38,7 +38,7 @@ class Google(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -49,4 +49,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+3 -3
View File
@@ -83,7 +83,7 @@ class CheckAXFR(Module):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -94,5 +94,5 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('ZoneTransfer.me') run('ZoneTransfer.me')
# do('example.com') # run('example.com')
+2 -2
View File
@@ -44,7 +44,7 @@ class CheckCDX(Module):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -55,4 +55,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -46,7 +46,7 @@ class CheckCert(Module):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -57,4 +57,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -65,7 +65,7 @@ class CheckCSP(Module):
self.save_db() self.save_db()
def do(domain, header=None): # 统一入口名字 方便多线程调用 def run(domain, header=None):
""" """
类统一调用入口 类统一调用入口
@@ -78,4 +78,4 @@ def do(domain, header=None): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
resp = requests.get('https://content-security-policy.com/') resp = requests.get('https://content-security-policy.com/')
do('google-analytics.com', dict(resp.headers)) run('google-analytics.com', dict(resp.headers))
+2 -2
View File
@@ -42,7 +42,7 @@ class CheckNSEC(Module):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -53,4 +53,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('iana.org') run('iana.org')
+2 -2
View File
@@ -43,7 +43,7 @@ class CheckRobots(Module):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -54,4 +54,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('qq.com') run('qq.com')
+2 -2
View File
@@ -48,7 +48,7 @@ class CheckRobots(Module):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -59,4 +59,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('qq.com') run('qq.com')
+1 -1
View File
@@ -48,7 +48,7 @@ class Collect(object):
""" """
for package, name in self.modules: for package, name in self.modules:
import_object = importlib.import_module('.' + name, package) import_object = importlib.import_module('.' + name, package)
func = getattr(import_object, 'do') func = getattr(import_object, 'run')
self.collect_funcs.append([func, name]) self.collect_funcs.append([func, name])
def run(self): def run(self):
+2 -2
View File
@@ -47,7 +47,7 @@ class ArchiveCrawl(Crawl):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -58,4 +58,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -46,7 +46,7 @@ class CommonCrawl(Crawl):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -57,4 +57,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -39,7 +39,7 @@ class BinaryEdgeAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -50,4 +50,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -42,7 +42,7 @@ class BufferOver(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -53,4 +53,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -35,7 +35,7 @@ class CeBaidu(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -46,4 +46,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -35,7 +35,7 @@ class Chinaz(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -46,4 +46,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -39,7 +39,7 @@ class ChinazAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -50,4 +50,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -39,7 +39,7 @@ class CirclAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -50,4 +50,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -113,7 +113,7 @@ class CloudFlareAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
class call entrance class call entrance
@@ -124,4 +124,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -40,7 +40,7 @@ class DNSdbAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -52,4 +52,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -42,7 +42,7 @@ class DNSdumpster(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -54,4 +54,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -37,7 +37,7 @@ class HackerTarget(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -48,4 +48,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -35,7 +35,7 @@ class IP138(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -46,4 +46,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+3 -4
View File
@@ -39,9 +39,8 @@ class IPv4InfoAPI(Query):
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
# 不直接使用subdomains是因为可能里面会出现不符合标准的子域名 # 不直接使用subdomains是因为可能里面会出现不符合标准的子域名
subdomains = json.get('Subdomains') subdomains = json.get('Subdomains')
if subdomains: if subdomains and len(subdomains) < 300:
# ipv4info子域查询接口每次最多返回300个 用来判断是否还有下一页 # ipv4info子域查询接口每次最多返回300个 用来判断是否还有下一页
if len(subdomains) < 300:
break break
page += 1 page += 1
if page >= 50: # ipv4info子域查询接口最多允许查询50页 if page >= 50: # ipv4info子域查询接口最多允许查询50页
@@ -61,7 +60,7 @@ class IPv4InfoAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -72,4 +71,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -73,7 +73,7 @@ class NetCraft(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -84,4 +84,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -41,7 +41,7 @@ class PassiveDnsAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -52,4 +52,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -50,7 +50,7 @@ class PhoneBook(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -61,4 +61,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('freebuf.com') run('freebuf.com')
+2 -2
View File
@@ -47,7 +47,7 @@ class QianXun(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -58,4 +58,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -35,7 +35,7 @@ class RapidDNS(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -46,4 +46,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -35,7 +35,7 @@ class Riddler(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -46,4 +46,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -49,7 +49,7 @@ class Robtex(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -60,4 +60,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -43,7 +43,7 @@ class SecurityTrailsAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -54,4 +54,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -46,7 +46,7 @@ class SiteDossier(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -57,4 +57,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -49,7 +49,7 @@ class SpyseAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -60,4 +60,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -34,7 +34,7 @@ class Sublist3r(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -45,4 +45,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -41,7 +41,7 @@ class ThreatCrowd(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -52,4 +52,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('mi.com') run('mi.com')
+3 -3
View File
@@ -51,7 +51,7 @@ class WZPCQuery(Query):
self.save_db() self.save_db()
def do(domain): def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -62,5 +62,5 @@ def do(domain):
if __name__ == '__main__': if __name__ == '__main__':
do('sc.gov.cn') run('sc.gov.cn')
do('bkzy.org') run('bkzy.org')
+2 -2
View File
@@ -36,7 +36,7 @@ class Ximcx(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -47,4 +47,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -21,7 +21,7 @@ class QueryMX(Lookup):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -32,4 +32,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('cuit.edu.cn') run('cuit.edu.cn')
+2 -2
View File
@@ -21,7 +21,7 @@ class QueryNS(Lookup):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -32,4 +32,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('cuit.edu.cn') run('cuit.edu.cn')
+2 -2
View File
@@ -21,7 +21,7 @@ class QuerySOA(Lookup):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -32,4 +32,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('cuit.edu.cn') run('cuit.edu.cn')
+2 -2
View File
@@ -21,7 +21,7 @@ class QuerySPF(Lookup):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -32,4 +32,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('qq.com') run('qq.com')
+3 -3
View File
@@ -80,7 +80,7 @@ class BruteThread(threading.Thread):
self.names_que.task_done() self.names_que.task_done()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -91,5 +91,5 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('zonetransfer.me') run('zonetransfer.me')
# do('example.com') # run('example.com')
+2 -2
View File
@@ -21,7 +21,7 @@ class QueryTXT(Lookup):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -32,4 +32,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('cuit.edu.cn') run('cuit.edu.cn')
+2 -2
View File
@@ -44,7 +44,7 @@ class AlienVault(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -55,4 +55,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -42,7 +42,7 @@ class RiskIQ(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -53,4 +53,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -39,7 +39,7 @@ class ThreatBookAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -50,4 +50,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -36,7 +36,7 @@ class ThreatMiner(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -47,4 +47,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -57,7 +57,7 @@ class VirusTotal(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -68,4 +68,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -41,7 +41,7 @@ class VirusTotalAPI(Query):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -52,4 +52,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+4 -5
View File
@@ -33,9 +33,8 @@ class Ask(Search):
subdomains = self.match_subdomains(resp.text, fuzzy=False) subdomains = self.match_subdomains(resp.text, fuzzy=False)
if not subdomains: if not subdomains:
break break
if not full_search: if not full_search and subdomains.issubset(self.subdomains):
# 搜索中发现搜索出的结果有完全重复的结果就停止搜索 # 在全搜索过程中发现搜索出的结果有完全重复的结果就停止搜索
if subdomains.issubset(self.subdomains):
break break
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
self.page_num += 1 self.page_num += 1
@@ -67,7 +66,7 @@ class Ask(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -78,4 +77,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+4 -6
View File
@@ -8,7 +8,6 @@ class Baidu(Search):
Search.__init__(self) Search.__init__(self)
self.module = 'Search' self.module = 'Search'
self.source = 'BaiduSearch' self.source = 'BaiduSearch'
self.init = 'https://www.baidu.com/'
self.addr = 'https://www.baidu.com/s' self.addr = 'https://www.baidu.com/s'
self.domain = domain self.domain = domain
self.limit_num = 750 # 限制搜索条数 self.limit_num = 750 # 限制搜索条数
@@ -56,9 +55,8 @@ class Baidu(Search):
subdomains = self.match_subdomains(resp.text, fuzzy=False) subdomains = self.match_subdomains(resp.text, fuzzy=False)
if not subdomains: # 搜索没有发现子域名则停止搜索 if not subdomains: # 搜索没有发现子域名则停止搜索
break break
if not full_search: if not full_search and subdomains.issubset(self.subdomains):
# 搜索中发现搜索出的结果有完全重复的结果就停止搜索 # 在全搜索过程中发现搜索出的结果有完全重复的结果就停止搜索
if subdomains.issubset(self.subdomains):
break break
# 合并搜索子域名搜索结果 # 合并搜索子域名搜索结果
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
@@ -94,7 +92,7 @@ class Baidu(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -105,4 +103,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('mi.com') run('mi.com')
+4 -5
View File
@@ -39,9 +39,8 @@ class Bing(Search):
subdomains = self.match_subdomains(resp.text, fuzzy=False) subdomains = self.match_subdomains(resp.text, fuzzy=False)
if not subdomains: # 搜索没有发现子域名则停止搜索 if not subdomains: # 搜索没有发现子域名则停止搜索
break break
if not full_search: if not full_search and subdomains.issubset(self.subdomains):
# 搜索中发现搜索出的结果有完全重复的结果就停止搜索 # 在全搜索过程中发现搜索出的结果有完全重复的结果就停止搜索
if subdomains.issubset(self.subdomains):
break break
# 合并搜索子域名搜索结果 # 合并搜索子域名搜索结果
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
@@ -78,7 +77,7 @@ class Bing(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -89,4 +88,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+5 -7
View File
@@ -9,8 +9,7 @@ class BingAPI(Search):
self.domain = domain self.domain = domain
self.module = 'Search' self.module = 'Search'
self.source = 'BingAPISearch' self.source = 'BingAPISearch'
self.addr = 'https://api.cognitive.microsoft.com/' \ self.addr = 'https://api.cognitive.microsoft.com/bing/v7.0/search'
'bing/v7.0/search'
self.id = api.bing_api_id self.id = api.bing_api_id
self.key = api.bing_api_key self.key = api.bing_api_key
self.limit_num = 1000 # 必应同一个搜索关键词限制搜索条数 self.limit_num = 1000 # 必应同一个搜索关键词限制搜索条数
@@ -40,9 +39,8 @@ class BingAPI(Search):
subdomains = self.match_subdomains(resp.text) subdomains = self.match_subdomains(resp.text)
if not subdomains: # 搜索没有发现子域名则停止搜索 if not subdomains: # 搜索没有发现子域名则停止搜索
break break
if not full_search: if not full_search and subdomains.issubset(self.subdomains):
# 搜索中发现搜索出的结果有完全重复的结果就停止搜索 # 在全搜索过程中发现搜索出的结果有完全重复的结果就停止搜索
if subdomains.issubset(self.subdomains):
break break
# 合并搜索子域名搜索结果 # 合并搜索子域名搜索结果
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
@@ -78,7 +76,7 @@ class BingAPI(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -89,4 +87,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -60,7 +60,7 @@ class FoFa(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -71,4 +71,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+4 -5
View File
@@ -37,9 +37,8 @@ class Gitee(Search):
subdomains = self.match_subdomains(soup.text, fuzzy=False) subdomains = self.match_subdomains(soup.text, fuzzy=False)
if not subdomains: if not subdomains:
break break
if not full_search: if not full_search and subdomains.issubset(self.subdomains):
# 搜索中发现搜索出的结果有完全重复的结果就停止搜索 # 在全搜索中发现搜索出的结果有完全重复的结果就停止搜索
if subdomains.issubset(self.subdomains):
break break
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
if '<li class="disabled"><a href="###">' in resp.text: if '<li class="disabled"><a href="###">' in resp.text:
@@ -60,7 +59,7 @@ class Gitee(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -71,4 +70,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('qq.com') run('qq.com')
+2 -2
View File
@@ -92,7 +92,7 @@ class GithubAPI(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -103,4 +103,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('exmaple.com') run('exmaple.com')
+4 -4
View File
@@ -43,8 +43,8 @@ class Google(Search):
subdomains = self.match_subdomains(resp.text, fuzzy=False) subdomains = self.match_subdomains(resp.text, fuzzy=False)
if not subdomains: if not subdomains:
break break
if not full_search: if not full_search and subdomains.issubset(self.subdomains):
if subdomains.issubset(self.subdomains): # 在全搜索中发现搜索出的结果有完全重复的结果就停止搜索
break break
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
page_num += per_page_num page_num += per_page_num
@@ -80,7 +80,7 @@ class Google(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -91,4 +91,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+4 -4
View File
@@ -38,8 +38,8 @@ class GoogleAPI(Search):
subdomains = self.match_subdomains(resp.text) subdomains = self.match_subdomains(resp.text)
if not subdomains: if not subdomains:
break break
if not full_search: if not full_search and subdomains.issubset(self.subdomains):
if subdomains.issubset(self.subdomains): # 在全搜索过程中发现搜索出的结果有完全重复的结果就停止搜索
break break
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
self.page_num += self.per_page_num self.page_num += self.per_page_num
@@ -74,7 +74,7 @@ class GoogleAPI(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -85,4 +85,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('mi.com') run('mi.com')
+2 -2
View File
@@ -46,7 +46,7 @@ class ShodanAPI(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -57,4 +57,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+4 -5
View File
@@ -34,9 +34,8 @@ class So(Search):
subdomains = self.match_subdomains(resp.text, fuzzy=False) subdomains = self.match_subdomains(resp.text, fuzzy=False)
if not subdomains: if not subdomains:
break break
if not full_search: if not full_search and subdomains.issubset(self.subdomains):
# 搜索中发现搜索出的结果有完全重复的结果就停止搜索 # 在全搜索过程中发现搜索出的结果有完全重复的结果就停止搜索
if subdomains.issubset(self.subdomains):
break break
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
page_num += 1 page_num += 1
@@ -73,7 +72,7 @@ class So(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -84,4 +83,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+4 -5
View File
@@ -31,9 +31,8 @@ class Sogou(Search):
subdomains = self.match_subdomains(resp.text, fuzzy=False) subdomains = self.match_subdomains(resp.text, fuzzy=False)
if not subdomains: if not subdomains:
break break
if not full_search: if not full_search and subdomains.issubset(self.subdomains):
# 搜索中发现搜索出的结果有完全重复的结果就停止搜索 # 在全搜索过程中发现搜索出的结果有完全重复的结果就停止搜索
if subdomains.issubset(self.subdomains):
break break
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
self.page_num += 1 self.page_num += 1
@@ -71,7 +70,7 @@ class Sogou(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -82,4 +81,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+4 -5
View File
@@ -39,9 +39,8 @@ class Yahoo(Search):
subdomains = self.match_subdomains(text, fuzzy=False) subdomains = self.match_subdomains(text, fuzzy=False)
if not subdomains: # 搜索没有发现子域名则停止搜索 if not subdomains: # 搜索没有发现子域名则停止搜索
break break
if not full_search: if not full_search and subdomains.issubset(self.subdomains):
# 搜索中发现搜索出的结果有完全重复的结果就停止搜索 # 在全搜索过程中发现搜索出的结果有完全重复的结果就停止搜索
if subdomains.issubset(self.subdomains):
break break
# 合并搜索子域名搜索结果 # 合并搜索子域名搜索结果
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
@@ -78,7 +77,7 @@ class Yahoo(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -89,4 +88,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+4 -5
View File
@@ -39,9 +39,8 @@ class Yandex(Search):
subdomains = self.match_subdomains(resp.text, fuzzy=False) subdomains = self.match_subdomains(resp.text, fuzzy=False)
if not subdomains: # 搜索没有发现子域名则停止搜索 if not subdomains: # 搜索没有发现子域名则停止搜索
break break
if not full_search: if not full_search and subdomains.issubset(self.subdomains):
# 搜索中发现搜索出的结果有完全重复的结果就停止搜索 # 在全搜索过程中发现搜索出的结果有完全重复的结果就停止搜索
if subdomains.issubset(self.subdomains):
break break
# 合并搜索子域名搜索结果 # 合并搜索子域名搜索结果
self.subdomains = self.subdomains.union(subdomains) self.subdomains = self.subdomains.union(subdomains)
@@ -78,7 +77,7 @@ class Yandex(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -89,4 +88,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('example.com') run('example.com')
+2 -2
View File
@@ -72,7 +72,7 @@ class ZoomEyeAPI(Search):
self.save_db() self.save_db()
def do(domain): # 统一入口名字 方便多线程调用 def run(domain):
""" """
类统一调用入口 类统一调用入口
@@ -83,4 +83,4 @@ def do(domain): # 统一入口名字 方便多线程调用
if __name__ == '__main__': if __name__ == '__main__':
do('mi.com') run('mi.com')
-2
View File
@@ -285,5 +285,3 @@ class OneForAll(object):
if __name__ == '__main__': if __name__ == '__main__':
fire.Fire(OneForAll) fire.Fire(OneForAll)
# OneForAll('example.com').run()
# OneForAll('./domains.txt').run()
+1 -3
View File
@@ -166,6 +166,4 @@ class Takeover(Module):
if __name__ == '__main__': if __name__ == '__main__':
fire.Fire(Takeover) fire.Fire(Takeover)
# takeover = Takeover('www.example.com')
# takeover = Takeover('./subdomains.txt')
# takeover.run()