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