summaryrefslogtreecommitdiff
path: root/agent
diff options
context:
space:
mode:
authorshihaoyue <[email protected]>2024-06-23 14:59:02 +0800
committershihaoyue <[email protected]>2024-06-23 14:59:02 +0800
commita26acf272f5b2bf0a123aaab67a9a4cc97a0719d (patch)
tree86d611f319827b6f893b31e02f1e2aed1453fb43 /agent
parent1ef2840676be92dfd7454e700e27e31f28eed3e7 (diff)
切换数据库
Diffstat (limited to 'agent')
-rw-r--r--agent/apps/script.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/agent/apps/script.py b/agent/apps/script.py
index 7777feb..682e065 100644
--- a/agent/apps/script.py
+++ b/agent/apps/script.py
@@ -18,8 +18,7 @@ executor = ThreadPoolExecutor(5)
BASE_PATH = "./apps/code/"
# config
config = {}
-with open("./config.yaml", "r") as f:
- config = yaml.safe_load(f)
+
@bp.post('/')
@bp.doc("渗透任务参数接收接口", "返回任务执行状态")
@@ -63,6 +62,8 @@ tasks_lock = threading.Lock()
def execute_command(cmd, job_id, stop_event):
+ with open("./config.yaml", "r") as f:
+ config = yaml.safe_load(f)
server_url = config['server']
try:
proc = subprocess.Popen(cmd,