mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
修复aiobrute中没有传semaphore参数问题
This commit is contained in:
@@ -14,6 +14,7 @@ import queue
|
|||||||
import secrets
|
import secrets
|
||||||
import signal
|
import signal
|
||||||
import time
|
import time
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
import aiomultiprocess
|
import aiomultiprocess
|
||||||
import exrex
|
import exrex
|
||||||
@@ -209,6 +210,7 @@ class AIOBrute(Module):
|
|||||||
self.enable_wildcard, self.wildcard_ips, self.wildcard_ttl = detect_wildcard(domain)
|
self.enable_wildcard, self.wildcard_ips, self.wildcard_ttl = detect_wildcard(domain)
|
||||||
tasks = self.gen_tasks(domain)
|
tasks = self.gen_tasks(domain)
|
||||||
logger.log('INFOR', f'正在爆破{domain}的域名')
|
logger.log('INFOR', f'正在爆破{domain}的域名')
|
||||||
|
sem = asyncio.Semaphore(utils.get_semaphore())
|
||||||
for task in tqdm.tqdm(tasks, desc='Progress', smoothing=1.0, ncols=True):
|
for task in tqdm.tqdm(tasks, desc='Progress', smoothing=1.0, ncols=True):
|
||||||
async with aiomultiprocess.Pool(processes=self.processes, initializer=init_worker,
|
async with aiomultiprocess.Pool(processes=self.processes, initializer=init_worker,
|
||||||
childconcurrency=self.coroutine) as pool:
|
childconcurrency=self.coroutine) as pool:
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ def aiodns_resolver():
|
|||||||
timeout=config.resolver_timeout)
|
timeout=config.resolver_timeout)
|
||||||
|
|
||||||
|
|
||||||
async def aiodns_query_a(hostname, semaphore):
|
async def aiodns_query_a(hostname, semaphore=None):
|
||||||
"""
|
"""
|
||||||
异步查询A记录
|
异步查询A记录
|
||||||
|
|
||||||
@@ -47,6 +47,8 @@ async def aiodns_query_a(hostname, semaphore):
|
|||||||
:param semaphore: 并发查询数量
|
:param semaphore: 并发查询数量
|
||||||
:return: 主机名或查询结果或查询异常
|
:return: 主机名或查询结果或查询异常
|
||||||
"""
|
"""
|
||||||
|
if semaphore is None:
|
||||||
|
semaphore = utils.get_semaphore()
|
||||||
async with semaphore:
|
async with semaphore:
|
||||||
resolver = aiodns_resolver()
|
resolver = aiodns_resolver()
|
||||||
answers = await resolver.query(hostname, 'A')
|
answers = await resolver.query(hostname, 'A')
|
||||||
|
|||||||
Reference in New Issue
Block a user