From 0a770916cf5b13e69455ee7759a49de59a0a2611 Mon Sep 17 00:00:00 2001 From: Jing Ling Date: Thu, 20 Aug 2020 14:07:31 +0800 Subject: [PATCH] typos --- modules/autotake/github.py | 9 ++++++--- modules/banner.py | 4 ++-- modules/check/axfr.py | 9 ++++++--- modules/check/nsec.py | 1 - modules/crawl/archivecrawl.py | 3 +-- modules/crawl/commoncrawl.py | 2 +- modules/dnsquery/srv.py | 1 - modules/finder.py | 4 ++-- 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/modules/autotake/github.py b/modules/autotake/github.py index 32f7e92..b708d51 100644 --- a/modules/autotake/github.py +++ b/modules/autotake/github.py @@ -13,7 +13,9 @@ from config import settings HEADERS = { "Accept": "application/json, text/javascript, */*; q=0.01", "Accept-Language": "zh-CN,zh;q=0.9", - "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36", + "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) " + "AppleWebKit/537.36 (KHTML, like Gecko) " + "Chrome/63.0.3239.84 Safari/537.36", } @@ -73,8 +75,9 @@ def github_takeover(url): }, "content": cname_url64 } - html_url = 'https://api.github.com/repos/' + user + '/' + repo_name + '/contents/index.html' - url_url = 'https://api.github.com/repos/' + user + '/' + repo_name + '/contents/CNAME' + base_url = 'https://api.github.com/repos/' + html_url = base_url + user + '/' + repo_name + '/contents/index.html' + url_url = base_url + user + '/' + repo_name + '/contents/CNAME' html_r = requests.put(url=html_url, data=json.dumps(html_dict), headers=headers) # 上传index.html cname_r = requests.put(url=url_url, data=json.dumps(url_dict), diff --git a/modules/banner.py b/modules/banner.py index 772c2fc..25f51cd 100644 --- a/modules/banner.py +++ b/modules/banner.py @@ -388,8 +388,8 @@ class Condition(object): else: name = [] - while self.index < len( - self.condstr) and self.condstr[self.index] in self.allow_character: + while self.index < len(self.condstr) and self.condstr[self.index] \ + in self.allow_character: name.append(self.condstr[self.index]) self.index += 1 diff --git a/modules/check/axfr.py b/modules/check/axfr.py index 7e60fc6..55fb43d 100644 --- a/modules/check/axfr.py +++ b/modules/check/axfr.py @@ -33,14 +33,16 @@ class CheckAXFR(Module): :param server: domain server """ - logger.log('DEBUG', f'Trying to perform domain transfer in {server} of {self.domain}') + logger.log('DEBUG', f'Trying to perform domain transfer in {server} ' + f'of {self.domain}') try: xfr = dns.query.xfr(where=server, zone=self.domain, timeout=5.0, lifetime=10.0) zone = dns.zone.from_xfr(xfr) except Exception as e: logger.log('DEBUG', e.args) - logger.log('DEBUG', f'Domain transfer to server {server} of {self.domain} failed') + logger.log('DEBUG', f'Domain transfer to server {server} of ' + f'{self.domain} failed') return names = zone.nodes.keys() for name in names: @@ -50,7 +52,8 @@ class CheckAXFR(Module): record = zone[name].to_text(name) self.results.append(record) if self.results: - logger.log('DEBUG', f'Found the domain transfer record of {self.domain} on {server}') + logger.log('DEBUG', f'Found the domain transfer record of ' + f'{self.domain} on {server}') logger.log('DEBUG', '\n'.join(self.results)) self.results = [] diff --git a/modules/check/nsec.py b/modules/check/nsec.py index 0a6c190..952b648 100644 --- a/modules/check/nsec.py +++ b/modules/check/nsec.py @@ -24,7 +24,6 @@ class CheckNSEC(Module): subdomains = self.match_subdomains(record) subdomain = ''.join(subdomains) # 其实这里的subdomains的长度为1 也就是说只会有一个子域 self.subdomains.update(subdomains) - self.gen_record(subdomains, record) if subdomain == self.domain: # 当查出子域为主域 说明完成了一个循环 不再继续查询 break domain = subdomain diff --git a/modules/crawl/archivecrawl.py b/modules/crawl/archivecrawl.py index fb49c0c..eb4c7bf 100644 --- a/modules/crawl/archivecrawl.py +++ b/modules/crawl/archivecrawl.py @@ -26,8 +26,7 @@ class ArchiveCrawl(Crawl): for resp in cdx.iter(url, limit=limit): if resp.data.get('status') not in ['301', '302']: url = resp.data.get('url') - subdomains = self.match_subdomains(self.get_maindomain(domain), - url + resp.text) + subdomains = self.match_subdomains(domain, url + resp.text) self.subdomains.update(subdomains) def run(self): diff --git a/modules/crawl/commoncrawl.py b/modules/crawl/commoncrawl.py index 707033f..7979f41 100644 --- a/modules/crawl/commoncrawl.py +++ b/modules/crawl/commoncrawl.py @@ -26,7 +26,7 @@ class CommonCrawl(Crawl): for resp in tqdm(cdx.iter(url, limit=limit), total=limit): if resp.data.get('status') not in ['301', '302']: - subdomains = self.match_subdomains(self.get_maindomain(domain), resp.text) + subdomains = self.match_subdomains(domain, resp.text) self.subdomains.update(subdomains) def run(self): diff --git a/modules/dnsquery/srv.py b/modules/dnsquery/srv.py index c28d8e0..f21bf14 100644 --- a/modules/dnsquery/srv.py +++ b/modules/dnsquery/srv.py @@ -53,7 +53,6 @@ class BruteSRV(Module): record = str(item) subdomains = self.match_subdomains(record) self.subdomains.update(subdomains) - self.gen_record(subdomains, record) def run(self): """ diff --git a/modules/finder.py b/modules/finder.py index 57f5db9..668aff3 100644 --- a/modules/finder.py +++ b/modules/finder.py @@ -102,8 +102,8 @@ def filter_name(path, black_name): if path.endswith(name): return True black_ext = ['io.js', 'ui.js', 'fp.js', 'en.js', 'en-us,js', 'zh.js', 'zh-cn.js', - 'zh_cn.js', 'dev.js', 'min.js', 'umd.js', 'esm.js', 'all.js', 'cjs.js', 'prod.js', - 'slim.js', 'core.js', 'global.js', 'bundle.js', 'browser.js', + 'zh_cn.js', 'dev.js', 'min.js', 'umd.js', 'esm.js', 'all.js', 'cjs.js', + 'prod.js', 'slim.js', 'core.js', 'global.js', 'bundle.js', 'browser.js', 'brands.js', 'simple.js', 'common.js', 'development.js', 'banner.js', 'production.js'] for ext in black_ext: