From b529bf25f46245fb0b202746da4870e9a43fcc0b Mon Sep 17 00:00:00 2001 From: JrD <421273918@qq.com> Date: Thu, 3 Sep 2020 17:39:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DDNS=E6=9D=83=E5=A8=81?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E8=A7=A3=E6=9E=90=E6=B7=B7=E4=B9=B1?= =?UTF-8?q?=E6=88=96=E8=80=85=E8=A7=A3=E6=9E=90=E5=88=B0CDN=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- brute.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/brute.py b/brute.py index 04a7040..9337b0a 100644 --- a/brute.py +++ b/brute.py @@ -303,6 +303,7 @@ def collect_wildcard_record(domain, authoritative_ns): resolver.cache = None # 不使用DNS缓存 ips = set() ttl = int() + ttls_check = list() ips_stat = dict() ips_check = list() while True: @@ -317,12 +318,18 @@ def collect_wildcard_record(domain, authoritative_ns): continue # 每5次查询检查结果列表 如果都没结果则结束查询 ips_check.append(ip) + ttls_check.append(ttl) if len(ips_check) == 5: if not any(ips_check): logger.log('ALERT', 'The query ends because there are ' 'no results for 5 consecutive queries.') break ips_check = list() + if len(ttls_check) == 5 and len(set(ttls_check)) == 5: + logger.log('ALERT', 'The query ends because there are ' + '5 different TTL results for 5 consecutive queries.') + ips, ttl = set(), int() + break if ip is None: continue ips.update(ip)