From 15027ef82e071a1566f220ccdf4f6968b29deff4 Mon Sep 17 00:00:00 2001 From: Jing Ling Date: Fri, 14 Aug 2020 00:49:33 +0800 Subject: [PATCH 1/2] typo --- common/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/utils.py b/common/utils.py index 38693b6..9058ff0 100644 --- a/common/utils.py +++ b/common/utils.py @@ -606,14 +606,14 @@ def check_version(local): try: resp = requests.get(url=api, headers=header, proxies=proxy, timeout=timeout, verify=verify) - json = resp.json() - latest = json['tag_name'] + resp_json = resp.json() + latest = resp_json['tag_name'] except Exception as e: logger.log('ERROR', 'An error occurred while checking the latest version') logger.log('ERROR', e.args) return if latest > local: - change = json.get("body") + change = resp_json.get("body") logger.log('ALERT', f'The current version is {local} ' f'but the latest version is {latest}') logger.log('ALERT', f'The {latest} version mainly has the following changes') From fedf0daf76da5609219c52bb45b31d1072e61c32 Mon Sep 17 00:00:00 2001 From: Jing Ling Date: Fri, 14 Aug 2020 01:49:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/datasets/qianxun.py | 5 ++++- modules/datasets/sitedossier.py | 2 +- modules/datasets/spyse_api.py | 2 +- modules/datasets/wzpc.py | 2 ++ modules/datasets/ximcx.py | 6 +----- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/datasets/qianxun.py b/modules/datasets/qianxun.py index df9149a..c1aa096 100644 --- a/modules/datasets/qianxun.py +++ b/modules/datasets/qianxun.py @@ -25,7 +25,10 @@ class QianXun(Query): url = f'https://www.dnsscan.cn/dns.html?' \ f'keywords={self.domain}&page={num}' resp = self.post(url, data) - self.subdomains = self.collect_subdomains(resp) + subdomains = self.match_subdomains(resp) + if not subdomains: # 没有发现子域名则停止查询 + break + self.subdomains = self.subdomains.union(subdomains) if '
' not in resp.text: break if '
  • »
  • ' in resp.text: diff --git a/modules/datasets/sitedossier.py b/modules/datasets/sitedossier.py index fc2de44..728815b 100644 --- a/modules/datasets/sitedossier.py +++ b/modules/datasets/sitedossier.py @@ -23,7 +23,7 @@ class SiteDossier(Query): url = f'{self.addr}{self.domain}/{self.page_num}' resp = self.get(url) subdomains = self.match_subdomains(resp) - if not subdomains: # 搜索没有发现子域名则停止搜索 + if not subdomains: # 没有发现子域名则停止查询 break self.subdomains = self.subdomains.union(subdomains) # 搜索页面没有出现下一页时停止搜索 diff --git a/modules/datasets/spyse_api.py b/modules/datasets/spyse_api.py index 2c1730d..bb634ca 100644 --- a/modules/datasets/spyse_api.py +++ b/modules/datasets/spyse_api.py @@ -27,7 +27,7 @@ class SpyseAPI(Query): return json = resp.json() subdomains = self.match_subdomains(str(json)) - if not subdomains: # 搜索没有发现子域名则停止搜索 + if not subdomains: # 没有发现子域名则停止查询 break self.subdomains = self.subdomains.union(subdomains) offset += limit diff --git a/modules/datasets/wzpc.py b/modules/datasets/wzpc.py index 3c84ad9..9db0dcf 100644 --- a/modules/datasets/wzpc.py +++ b/modules/datasets/wzpc.py @@ -32,6 +32,8 @@ class WZPCQuery(Query): if not resp: break subdomains = self.match_subdomains(resp.text) + if not subdomains: # 没有发现子域名则停止查询 + break self.subdomains = self.subdomains.union(subdomains) if not subdomains: break diff --git a/modules/datasets/ximcx.py b/modules/datasets/ximcx.py index 7ddf768..641b99b 100644 --- a/modules/datasets/ximcx.py +++ b/modules/datasets/ximcx.py @@ -17,11 +17,7 @@ class Ximcx(Query): self.proxy = self.get_proxy(self.source) data = {'domain': self.domain} resp = self.post(self.addr, data=data) - if not resp: - return - json = resp.json() - subdomains = self.match_subdomains(str(json)) - self.subdomains = self.subdomains.union(subdomains) + self.subdomains = self.collect_subdomains(resp) def run(self): """