From 9daefc9eeeb3af56046e0cd4daa4f8bf7a5f2a7b Mon Sep 17 00:00:00 2001 From: Jing Ling Date: Sat, 28 Dec 2019 13:53:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9B=E5=BA=A6=E6=9D=A1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oneforall/aiobrute.py | 12 +++++------- oneforall/common/request.py | 4 +--- oneforall/common/resolve.py | 4 +--- oneforall/takeover.py | 1 - 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/oneforall/aiobrute.py b/oneforall/aiobrute.py index 93a0ba9..55c3e9c 100644 --- a/oneforall/aiobrute.py +++ b/oneforall/aiobrute.py @@ -253,10 +253,8 @@ class AIOBrute(Module): = detect_wildcard(domain) tasks = self.gen_tasks(domain) logger.log('INFOR', f'正在爆破{domain}的域名') - for task in tqdm.tqdm(tasks, - desc='Progress', - smoothing=1.0, - ncols=True): + for task in tqdm.tqdm(tasks, total=len(tasks), + desc='Progress'): async with aiomp.Pool(processes=self.process, initializer=init_worker, childconcurrency=self.coroutine) as pool: @@ -343,6 +341,6 @@ def do(domain, result): # 统一入口名字 方便多线程调用 if __name__ == '__main__': - fire.Fire(AIOBrute) - # result_queue = queue.Queue() - # do('example.com', result_queue) + # fire.Fire(AIOBrute) + result_queue = queue.Queue() + do('jd.com', result_queue) diff --git a/oneforall/common/request.py b/oneforall/common/request.py index 7a97504..1030c7f 100644 --- a/oneforall/common/request.py +++ b/oneforall/common/request.py @@ -198,9 +198,7 @@ async def bulk_get_request(datas, port): futures = asyncio.as_completed(tasks) for future in tqdm.tqdm(futures, total=len(tasks), - desc='Progress', - smoothing=1.0, - ncols=True): + desc='Progress'): await future logger.log('INFOR', f'完成异步进行子域的GET请求') diff --git a/oneforall/common/resolve.py b/oneforall/common/resolve.py index 48d016f..b4fbcb2 100644 --- a/oneforall/common/resolve.py +++ b/oneforall/common/resolve.py @@ -95,9 +95,7 @@ async def bulk_query_a(datas): futures = asyncio.as_completed(tasks) for future in tqdm.tqdm(futures, total=len(tasks), - desc='Progress', - smoothing=1.0, - ncols=True): + desc='Progress'): await future # await asyncio.wait(tasks) # 等待所有task完成 logger.log('INFOR', '完成异步查询子域的A记录') diff --git a/oneforall/takeover.py b/oneforall/takeover.py index 16f59d4..c853daa 100644 --- a/oneforall/takeover.py +++ b/oneforall/takeover.py @@ -122,7 +122,6 @@ class Takeover(Module): bar = tqdm() bar.total = len(self.subdomains) bar.desc = 'Progress' - bar.ncols = True while True: done = bar.total - self.subdomainq.qsize() bar.n = done