修复只启用部分模块不能使用问题

This commit is contained in:
Jing Ling
2021-01-16 16:33:15 +08:00
parent 9ee1203aab
commit 1f62caa4f4
2 changed files with 5 additions and 5 deletions
+2 -3
View File
@@ -30,10 +30,9 @@ result_save_path = None # 子域结果保存文件路径(默认None)
# 收集模块设置
save_module_result = False # 保存各模块发现结果为json文件(默认False)
enable_all_module = True # 启用所有收集模块(默认True)
enable_partial_module = [] # 启用部分收集模块 必须禁用enable_all_module才能生效
enable_partial_module = ['modules.search.baidu'] # 启用部分收集模块 必须禁用enable_all_module才能生效
# 只使用ask和baidu搜索引擎收集子域的示例
# enable_partial_module = [('modules.search', 'ask')
# ('modules.search', 'baidu')]
# enable_partial_module = ['modules.search.ask', 'modules.search.baidu']
# 爆破模块设置
brute_concurrent_num = 2000 # 爆破时并发查询数量(默认2000,最大推荐10000)
+3 -2
View File
@@ -23,7 +23,7 @@ class Collect(object):
module_path = settings.module_dir.joinpath(module)
for path in module_path.rglob('*.py'):
import_module = f'modules.{module}.{path.stem}'
self.modules.append([import_module, path.stem])
self.modules.append(import_module)
else:
self.modules = settings.enable_partial_module
@@ -31,7 +31,8 @@ class Collect(object):
"""
Import do function
"""
for module, name in self.modules:
for module in self.modules:
name = module.split('.')[-1]
import_object = importlib.import_module(module)
func = getattr(import_object, 'run')
self.collect_funcs.append([func, name])