From 70d32678038b0f7e2afc3f5fd9d017b5b7838e5b Mon Sep 17 00:00:00 2001 From: Jing Ling Date: Fri, 13 Dec 2019 01:43:14 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9fd0253 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: OneForAll test + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install coverage + pip install -r requirements.txt + - name: Lint with flake8 + run: | + pip install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pip install pytest + pytest + - name: Test with example + run: | + coverage run oneforall/example.py From 30bc74a9a97cd5db061e6e815eaf6d014e0c33a6 Mon Sep 17 00:00:00 2001 From: Jing Ling Date: Fri, 13 Dec 2019 01:46:54 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=B3=A8=E9=87=8Apytest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9fd0253..65d71ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install coverage pip install -r requirements.txt - name: Lint with flake8 run: | @@ -25,10 +24,11 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pip install pytest - pytest +# - name: Test with pytest +# run: | +# pip install pytest +# pytest - name: Test with example run: | + pip install coverage coverage run oneforall/example.py From ce43bd75de779c86f5ebb41274f5f3f2aa0290eb Mon Sep 17 00:00:00 2001 From: shmilylty Date: Tue, 17 Dec 2019 11:55:38 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=B8=8D=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E5=AD=90=E5=9F=9F=E6=8E=A5=E7=AE=A1=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 2 +- README.md | 2 +- oneforall/oneforall.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.en.md b/README.en.md index fbd2245..8ce0073 100644 --- a/README.en.md +++ b/README.en.md @@ -206,7 +206,7 @@ The OneForAll command line interface is based on [Fire](https://github.com/googl --format=FORMAT Export format (default xls) --takeover=TAKEOVER - Check subdomain takeover (default True) + Check subdomain takeover (default False) --show=SHOW Terminal display exported data (default False) ``` diff --git a/README.md b/README.md index 5034b25..aa36703 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ OneForAll命令行界面基于[Fire](https://github.com/google/python-fire/)实 --format=FORMAT 导出格式(默认xls) --takeover=TAKEOVER - 检查子域接管(默认True) + 检查子域接管(默认False) --show=SHOW 终端显示导出数据(默认False) ``` diff --git a/oneforall/oneforall.py b/oneforall/oneforall.py index d3b4be5..759b18a 100644 --- a/oneforall/oneforall.py +++ b/oneforall/oneforall.py @@ -70,11 +70,11 @@ class OneForAll(object): :param str port: 请求验证子域的端口范围(默认只探测80端口) :param int valid: 导出子域的有效性(默认1) :param str format: 导出格式(默认csv) - :param bool takeover: 检查子域接管(默认True) + :param bool takeover: 检查子域接管(默认False) :param bool show: 终端显示导出数据(默认False) """ def __init__(self, target, brute=None, dns=None, req=None, port='default', - valid=1, format='csv', takeover=True, show=False): + valid=1, format='csv', takeover=False, show=False): self.target = target self.port = port self.domains = set() From 05d281521d84f7d87089ffeb6e08e0728f58459f Mon Sep 17 00:00:00 2001 From: shmilylty Date: Tue, 17 Dec 2019 17:43:17 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oneforall/modules/search/baidu.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/oneforall/modules/search/baidu.py b/oneforall/modules/search/baidu.py index 7daea44..514b204 100644 --- a/oneforall/modules/search/baidu.py +++ b/oneforall/modules/search/baidu.py @@ -15,18 +15,19 @@ class Baidu(Search): def redirect_match(self, domain, html): """ + 获取跳转地址并传递地址进行跳转head请求 - :param domain: - :param html: - :return: + :param domain: 域名 + :param html: 响应体 + :return: 子域 """ bs = BeautifulSoup(html, features='lxml') subdomains_all = set() # 获取搜索结果中所有的跳转URL地址 for find_res in bs.find_all('a', {'class': 'c-showurl'}): url = find_res.get('href') - subdomain = self.match_location(domain, url) - subdomains_all = subdomains_all.union(subdomain) + subdomains = self.match_location(domain, url) + subdomains_all = subdomains_all.union(subdomains) return subdomains_all def search(self, domain, filtered_subdomain='', full_search=False): @@ -43,7 +44,8 @@ class Baidu(Search): self.header = self.get_header() self.proxy = self.get_proxy(self.source) query = 'site:' + domain + filtered_subdomain - params = {'wd': query, 'pn': self.page_num, + params = {'wd': query, + 'pn': self.page_num, 'rn': self.per_page_num} resp = self.get(self.addr, params) if not resp: @@ -73,9 +75,7 @@ class Baidu(Search): 类执行入口 """ self.begin() - self.search(self.domain, full_search=True) - # 排除同一子域搜索结果过多的子域以发现新的子域 for statement in self.filter(self.domain, self.subdomains): self.search(self.domain, filtered_subdomain=statement) @@ -106,4 +106,4 @@ def do(domain): # 统一入口名字 方便多线程调用 if __name__ == '__main__': - do('example.com') + do('huayunshuzi.com') From 6a22a3aed987a218d4e78dd8d71237b63909dc7f Mon Sep 17 00:00:00 2001 From: shmilylty Date: Tue, 17 Dec 2019 18:47:15 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oneforall/modules/check/cdx.py | 13 ++++----- oneforall/modules/check/csp.py | 44 ++++++++++++++++++------------ oneforall/modules/check/robots.py | 17 ++++-------- oneforall/modules/check/sitemap.py | 18 +++++------- 4 files changed, 45 insertions(+), 47 deletions(-) diff --git a/oneforall/modules/check/cdx.py b/oneforall/modules/check/cdx.py index 4bdecdd..e4e48d7 100644 --- a/oneforall/modules/check/cdx.py +++ b/oneforall/modules/check/cdx.py @@ -24,16 +24,15 @@ class CheckCDX(Module): f'https://{self.domain}/crossdomain.xml', f'http://www.{self.domain}/crossdomain.xml', f'https://www.{self.domain}/crossdomain.xml'] - response = None for url in urls: self.header = self.get_header() self.proxy = self.get_proxy(self.source) - response = self.get(url) - if response: - break - if not response: - return - self.subdomains = utils.match_subdomain(self.domain, response.text) + response = self.get(url, check=False) + if not response: + return + if response and len(response.content): + self.subdomains = utils.match_subdomain(self.domain, + response.text) def run(self): """ diff --git a/oneforall/modules/check/csp.py b/oneforall/modules/check/csp.py index e8b9073..eb92686 100644 --- a/oneforall/modules/check/csp.py +++ b/oneforall/modules/check/csp.py @@ -12,38 +12,46 @@ class CheckCSP(Module): """ 检查内容安全策略收集子域名 """ - def __init__(self, domain, header): Module.__init__(self) self.domain = self.register(domain) self.module = 'Check' self.source = 'ContentSecurityPolicy' - self.header = header + self.csp_header = header + + def grab_header(self): + """ + 抓取请求头 + + :return: 请求头 + """ + csp_header = dict() + urls = [f'http://{self.domain}', + f'https://{self.domain}', + f'http://www.{self.domain}', + f'https://www.{self.domain}'] + for url in urls: + self.header = self.get_header() + self.proxy = self.get_proxy(self.source) + response = self.get(url, check=False) + if response: + csp_header = response.headers + break + return csp_header def check(self): """ 正则匹配响应头中的内容安全策略字段以发现子域名 """ - if not self.header: - urls = [f'http://{self.domain}', - f'https://{self.domain}', - f'http://www.{self.domain}', - f'https://www.{self.domain}'] - response = None - for url in urls: - self.header = self.get_header() - self.proxy = self.get_proxy(self.source) - response = self.get(url) - if response: - break - if not response: - return - self.header = response.headers + if not self.csp_header: + self.csp_header = self.grab_header() csp = self.header.get('Content-Security-Policy') + if not self.csp_header: + logger.log('DEBUG', f'获取{self.domain}域的请求头失败') + return if not csp: logger.log('DEBUG', f'{self.domain}域的响应头不存在内容安全策略字段') return - logger.log('DEBUG', f'{self.domain}域的响应头存在内容安全策略字段') self.subdomains = utils.match_subdomain(self.domain, csp) def run(self): diff --git a/oneforall/modules/check/robots.py b/oneforall/modules/check/robots.py index 3ff3cea..1c87719 100644 --- a/oneforall/modules/check/robots.py +++ b/oneforall/modules/check/robots.py @@ -1,18 +1,14 @@ """ 检查内容安全策略收集子域名收集子域名 """ -import requests - from common.module import Module from common import utils -from config import logger class CheckRobots(Module): """ 检查robots.txt收集子域名 """ - def __init__(self, domain): Module.__init__(self) self.domain = self.register(domain) @@ -27,16 +23,15 @@ class CheckRobots(Module): f'https://{self.domain}/robots.txt', f'http://www.{self.domain}/robots.txt', f'https://www.{self.domain}/robots.txt'] - response = None for url in urls: self.header = self.get_header() self.proxy = self.get_proxy(self.source) - response = self.get(url, allow_redirects=False) - if response: - break - if not response: - return - self.subdomains = utils.match_subdomain(self.domain, response.text) + response = self.get(url, check=False, allow_redirects=False) + if not response: + return + if response and len(response.content): + self.subdomains = utils.match_subdomain(self.domain, + response.text) def run(self): """ diff --git a/oneforall/modules/check/sitemap.py b/oneforall/modules/check/sitemap.py index 1d74a71..54db09f 100644 --- a/oneforall/modules/check/sitemap.py +++ b/oneforall/modules/check/sitemap.py @@ -1,18 +1,14 @@ """ 检查内容安全策略收集子域名收集子域名 """ -import requests - from common.module import Module from common import utils -from config import logger class CheckRobots(Module): """ 检查sitemap收集子域名 """ - def __init__(self, domain): Module.__init__(self) self.domain = self.register(domain) @@ -39,17 +35,17 @@ class CheckRobots(Module): f'https://{self.domain}/sitemap_index.xml', f'http://www.{self.domain}/sitemap_index.xml', f'https://www.{self.domain}/sitemap_index.xml'] - response = None for url in urls: self.header = self.get_header() self.proxy = self.get_proxy(self.source) self.timeout = 10 - response = self.get(url, allow_redirects=False) - if response: - break - if not response: - return - self.subdomains = utils.match_subdomain(self.domain, response.text) + response = self.get(url, check=False, allow_redirects=False) + if not response: + return + if response and len(response.content): + self.subdomains = utils.match_subdomain(self.domain, + response.text) + def run(self): """ From 05141046bdffad2bec473c0d68689b416192daa3 Mon Sep 17 00:00:00 2001 From: shmilylty Date: Tue, 17 Dec 2019 18:49:53 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=B8=8D=E8=BF=9B=E8=A1=8C=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oneforall/common/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oneforall/common/search.py b/oneforall/common/search.py index 422c505..eb19fa9 100644 --- a/oneforall/common/search.py +++ b/oneforall/common/search.py @@ -47,7 +47,7 @@ class Search(Module): :return: 匹配的子域 :rtype set """ - resp = self.head(url, allow_redirects=False) + resp = self.head(url, check=False, allow_redirects=False) if not resp: return set() location = resp.headers.get('location') From 6f4fd16cdbf21ec64cb92e1f8c776d653ac2f0fb Mon Sep 17 00:00:00 2001 From: shmilylty Date: Tue, 17 Dec 2019 18:50:36 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E8=AF=B7=E6=B1=82=E6=97=B6=E5=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oneforall/modules/certificates/censys_api.py | 2 -- oneforall/modules/certificates/certspotter.py | 2 -- oneforall/modules/certificates/crtsh.py | 2 -- oneforall/modules/certificates/entrust.py | 2 -- oneforall/modules/certificates/google.py | 2 -- oneforall/modules/certificates/spyse_api.py | 2 -- oneforall/modules/datasets/binaryedge_api.py | 2 -- oneforall/modules/datasets/bufferover.py | 2 -- oneforall/modules/datasets/cebaidu.py | 2 -- oneforall/modules/datasets/chinaz.py | 2 -- oneforall/modules/datasets/chinaz_api.py | 2 -- oneforall/modules/datasets/circl_api.py | 2 -- oneforall/modules/datasets/dnsdb_api.py | 2 -- oneforall/modules/datasets/dnsdumpster.py | 2 -- oneforall/modules/datasets/ip138.py | 2 -- oneforall/modules/datasets/passivedns_api.py | 2 -- oneforall/modules/datasets/riddler.py | 2 -- oneforall/modules/datasets/securitytrails_api.py | 2 -- oneforall/modules/datasets/sitedossier.py | 2 -- oneforall/modules/datasets/ximcx.py | 2 -- oneforall/modules/intelligence/alienvault.py | 3 --- oneforall/modules/intelligence/threatminer.py | 3 --- oneforall/modules/intelligence/virustotal.py | 3 --- 23 files changed, 49 deletions(-) diff --git a/oneforall/modules/certificates/censys_api.py b/oneforall/modules/certificates/censys_api.py index af1d09b..ead4ba9 100644 --- a/oneforall/modules/certificates/censys_api.py +++ b/oneforall/modules/certificates/censys_api.py @@ -1,4 +1,3 @@ -import time import config from common.query import Query from config import logger @@ -38,7 +37,6 @@ class CensysAPI(Query): self.subdomains = self.subdomains.union(subdomains) pages = json.get('metadata').get('pages') for page in range(2, pages + 1): - time.sleep(self.delay) data['page'] = page resp = self.post(self.addr, json=data, auth=(self.id, self.secret)) if not resp: diff --git a/oneforall/modules/certificates/certspotter.py b/oneforall/modules/certificates/certspotter.py index 8e7274c..84acf7c 100644 --- a/oneforall/modules/certificates/certspotter.py +++ b/oneforall/modules/certificates/certspotter.py @@ -1,4 +1,3 @@ -import time from common import utils from common.query import Query @@ -15,7 +14,6 @@ class CertSpotter(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) params = {'domain': self.domain, diff --git a/oneforall/modules/certificates/crtsh.py b/oneforall/modules/certificates/crtsh.py index 2f2943c..38b470a 100644 --- a/oneforall/modules/certificates/crtsh.py +++ b/oneforall/modules/certificates/crtsh.py @@ -1,4 +1,3 @@ -import time from common import utils from common.query import Query @@ -15,7 +14,6 @@ class Crtsh(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) params = {'q': f'%.{self.domain}', 'output': 'json'} diff --git a/oneforall/modules/certificates/entrust.py b/oneforall/modules/certificates/entrust.py index 9943a5f..ab3e82c 100644 --- a/oneforall/modules/certificates/entrust.py +++ b/oneforall/modules/certificates/entrust.py @@ -1,4 +1,3 @@ -import time from common import utils from common.query import Query @@ -15,7 +14,6 @@ class Entrust(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) params = {'fields': 'subjectDN', diff --git a/oneforall/modules/certificates/google.py b/oneforall/modules/certificates/google.py index cbacedb..5f11a7d 100644 --- a/oneforall/modules/certificates/google.py +++ b/oneforall/modules/certificates/google.py @@ -1,4 +1,3 @@ -import time from common import utils from common.query import Query @@ -16,7 +15,6 @@ class Google(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) params = {'include_expired': 'true', diff --git a/oneforall/modules/certificates/spyse_api.py b/oneforall/modules/certificates/spyse_api.py index a2b829b..01c52f0 100644 --- a/oneforall/modules/certificates/spyse_api.py +++ b/oneforall/modules/certificates/spyse_api.py @@ -1,4 +1,3 @@ -import time import config from common import utils from common.query import Query @@ -19,7 +18,6 @@ class SpyseAPI(Query): """ page_num = 1 while True: - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) params = {'domain': self.domain, diff --git a/oneforall/modules/datasets/binaryedge_api.py b/oneforall/modules/datasets/binaryedge_api.py index 14ea737..05d5e95 100644 --- a/oneforall/modules/datasets/binaryedge_api.py +++ b/oneforall/modules/datasets/binaryedge_api.py @@ -1,4 +1,3 @@ -import time import config from common.query import Query @@ -16,7 +15,6 @@ class BinaryEdgeAPI(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.header.update({'X-Key': self.api}) self.proxy = self.get_proxy(self.source) diff --git a/oneforall/modules/datasets/bufferover.py b/oneforall/modules/datasets/bufferover.py index f3f3f7d..72b2d7f 100644 --- a/oneforall/modules/datasets/bufferover.py +++ b/oneforall/modules/datasets/bufferover.py @@ -1,4 +1,3 @@ -import time import cloudscraper from common.query import Query from config import logger @@ -16,7 +15,6 @@ class BufferOver(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) # 绕过cloudFlare验证 scraper = cloudscraper.create_scraper() scraper.interpreter = 'js2py' diff --git a/oneforall/modules/datasets/cebaidu.py b/oneforall/modules/datasets/cebaidu.py index c6eb567..44ed6d4 100644 --- a/oneforall/modules/datasets/cebaidu.py +++ b/oneforall/modules/datasets/cebaidu.py @@ -1,4 +1,3 @@ -import time from common.query import Query @@ -14,7 +13,6 @@ class CeBaidu(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) params = {'site_address': self.domain} diff --git a/oneforall/modules/datasets/chinaz.py b/oneforall/modules/datasets/chinaz.py index 8de56be..f054338 100644 --- a/oneforall/modules/datasets/chinaz.py +++ b/oneforall/modules/datasets/chinaz.py @@ -1,4 +1,3 @@ -import time from common.query import Query @@ -14,7 +13,6 @@ class Chinaz(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) self.addr = self.addr + self.domain diff --git a/oneforall/modules/datasets/chinaz_api.py b/oneforall/modules/datasets/chinaz_api.py index d26541c..9ca8637 100644 --- a/oneforall/modules/datasets/chinaz_api.py +++ b/oneforall/modules/datasets/chinaz_api.py @@ -1,4 +1,3 @@ -import time import config from common.query import Query @@ -16,7 +15,6 @@ class ChinazAPI(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) params = {'key': self.api, 'domainName': self.domain} diff --git a/oneforall/modules/datasets/circl_api.py b/oneforall/modules/datasets/circl_api.py index 54c413a..2aa9345 100644 --- a/oneforall/modules/datasets/circl_api.py +++ b/oneforall/modules/datasets/circl_api.py @@ -1,4 +1,3 @@ -import time import config from common.query import Query @@ -17,7 +16,6 @@ class CirclAPI(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) resp = self.get(self.addr + self.domain, auth=(self.user, self.pwd)) diff --git a/oneforall/modules/datasets/dnsdb_api.py b/oneforall/modules/datasets/dnsdb_api.py index 2c010cb..c513933 100644 --- a/oneforall/modules/datasets/dnsdb_api.py +++ b/oneforall/modules/datasets/dnsdb_api.py @@ -1,4 +1,3 @@ -import time import config from common import utils from common.query import Query @@ -17,7 +16,6 @@ class DNSdbAPI(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.header.update({'X-API-Key': self.api}) self.proxy = self.get_proxy(self.source) diff --git a/oneforall/modules/datasets/dnsdumpster.py b/oneforall/modules/datasets/dnsdumpster.py index 0f91beb..58d0723 100644 --- a/oneforall/modules/datasets/dnsdumpster.py +++ b/oneforall/modules/datasets/dnsdumpster.py @@ -1,4 +1,3 @@ -import time from common import utils from common.query import Query @@ -15,7 +14,6 @@ class DNSdumpster(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.header.update({'Referer': 'https://dnsdumpster.com'}) self.proxy = self.get_proxy(self.source) diff --git a/oneforall/modules/datasets/ip138.py b/oneforall/modules/datasets/ip138.py index e54945c..dca8f0c 100644 --- a/oneforall/modules/datasets/ip138.py +++ b/oneforall/modules/datasets/ip138.py @@ -1,4 +1,3 @@ -import time from common.query import Query @@ -14,7 +13,6 @@ class IP138(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) data = {'domain': self.domain} diff --git a/oneforall/modules/datasets/passivedns_api.py b/oneforall/modules/datasets/passivedns_api.py index cc02dd8..83c075c 100644 --- a/oneforall/modules/datasets/passivedns_api.py +++ b/oneforall/modules/datasets/passivedns_api.py @@ -1,4 +1,3 @@ -import time import config from common.query import Query @@ -16,7 +15,6 @@ class PassiveDnsAPI(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.header.update({'X-AuthToken': self.token}) self.proxy = self.get_proxy(self.source) diff --git a/oneforall/modules/datasets/riddler.py b/oneforall/modules/datasets/riddler.py index fff7e50..6e7ed00 100644 --- a/oneforall/modules/datasets/riddler.py +++ b/oneforall/modules/datasets/riddler.py @@ -1,4 +1,3 @@ -import time from common.query import Query @@ -14,7 +13,6 @@ class Riddler(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) params = {'q': 'pld:' + self.domain} diff --git a/oneforall/modules/datasets/securitytrails_api.py b/oneforall/modules/datasets/securitytrails_api.py index d1e1e7b..b44fbb3 100644 --- a/oneforall/modules/datasets/securitytrails_api.py +++ b/oneforall/modules/datasets/securitytrails_api.py @@ -1,4 +1,3 @@ -import time import config from common.query import Query @@ -17,7 +16,6 @@ class SecurityTrailsAPI(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) params = {'apikey': self.api} diff --git a/oneforall/modules/datasets/sitedossier.py b/oneforall/modules/datasets/sitedossier.py index 87d84f0..c122564 100644 --- a/oneforall/modules/datasets/sitedossier.py +++ b/oneforall/modules/datasets/sitedossier.py @@ -1,4 +1,3 @@ -import time from common.query import Query @@ -19,7 +18,6 @@ class SiteDossier(Query): 向接口查询子域并做子域匹配 """ while True: - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) url = f'{self.addr}{self.domain}/{self.page_num}' diff --git a/oneforall/modules/datasets/ximcx.py b/oneforall/modules/datasets/ximcx.py index e00af40..943b6ca 100644 --- a/oneforall/modules/datasets/ximcx.py +++ b/oneforall/modules/datasets/ximcx.py @@ -1,4 +1,3 @@ -import time from common.query import Query @@ -14,7 +13,6 @@ class Ximcx(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) data = {'domain': self.domain} diff --git a/oneforall/modules/intelligence/alienvault.py b/oneforall/modules/intelligence/alienvault.py index 599c61f..a7eeeee 100644 --- a/oneforall/modules/intelligence/alienvault.py +++ b/oneforall/modules/intelligence/alienvault.py @@ -1,5 +1,3 @@ -import time - from common.query import Query @@ -14,7 +12,6 @@ class AlienVault(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) diff --git a/oneforall/modules/intelligence/threatminer.py b/oneforall/modules/intelligence/threatminer.py index b729d38..cc06eab 100644 --- a/oneforall/modules/intelligence/threatminer.py +++ b/oneforall/modules/intelligence/threatminer.py @@ -1,5 +1,3 @@ -import time - from common.query import Query @@ -15,7 +13,6 @@ class ThreatMiner(Query): """ 向接口查询子域并做子域匹配 """ - time.sleep(self.delay) self.header = self.get_header() self.proxy = self.get_proxy(self.source) params = {'e': 'subdomains_container', diff --git a/oneforall/modules/intelligence/virustotal.py b/oneforall/modules/intelligence/virustotal.py index 31b3c48..6f27eec 100644 --- a/oneforall/modules/intelligence/virustotal.py +++ b/oneforall/modules/intelligence/virustotal.py @@ -1,5 +1,3 @@ -import time - from common.query import Query ''' @@ -21,7 +19,6 @@ class VirusTotal(Query): """ next_cursor = '' while True: - time.sleep(self.delay) self.header = self.get_header() self.header.update({'Referer': 'https://www.virustotal.com/', 'TE': 'Trailers'})