Skip to content

Commit 8628c05

Browse files
committed
🎨quickscan支持拉取自定义工具
1 parent 493d455 commit 8628c05

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

client/node/quicktask/toolloader.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,20 @@ def load_tools(args):
5353
else:
5454
tool_tasks = QuickScan.get_scan_tasks(languages, labels, {})
5555
tool_names = [task['task_name'] for task in tool_tasks]
56+
57+
custom_tools = []
58+
for tool_name in tool_names:
59+
try:
60+
__import__("tool." + tool_name)
61+
except ModuleNotFoundError:
62+
# 记录自定义工具列表
63+
custom_tools.append(tool_name)
64+
except:
65+
LogPrinter.exception("encounter error.")
66+
pass
67+
5668
LogPrinter.info("Initing other tools ...")
57-
ToolLoader(tool_names=tool_names, task_list=tool_tasks, include_common=False).git_load_tools(print_enable=False)
69+
ToolLoader(tool_names=tool_names, task_list=tool_tasks, custom_tools=custom_tools, include_common=False).git_load_tools(print_enable=False)
5870

5971

6072
if __name__ == '__main__':

0 commit comments

Comments
 (0)