From 02d81771a94196c18788195018335e117c3ab7b4 Mon Sep 17 00:00:00 2001 From: vakarisz Date: Fri, 25 Feb 2022 17:13:19 +0200 Subject: [PATCH] Island: remove remaining references to "creds" property of monkey --- monkey/monkey_island/cc/resources/monkey.py | 3 --- monkey/monkey_island/cc/services/node.py | 9 --------- 2 files changed, 12 deletions(-) diff --git a/monkey/monkey_island/cc/resources/monkey.py b/monkey/monkey_island/cc/resources/monkey.py index ae8493398..b32ecbb83 100644 --- a/monkey/monkey_island/cc/resources/monkey.py +++ b/monkey/monkey_island/cc/resources/monkey.py @@ -69,7 +69,6 @@ class Monkey(flask_restful.Resource): def post(self, **kw): with agent_killing_mutex: monkey_json = json.loads(request.data) - monkey_json["creds"] = [] monkey_json["dead"] = False if "keepalive" in monkey_json: monkey_json["keepalive"] = dateutil.parser.parse(monkey_json["keepalive"]) @@ -163,8 +162,6 @@ class Monkey(flask_restful.Resource): EdgeService.update_all_dst_nodes( old_dst_node_id=node_id, new_dst_node_id=new_monkey_id ) - for creds in existing_node["creds"]: - NodeService.add_credentials_to_monkey(new_monkey_id, creds) mongo.db.node.remove({"_id": node_id}) return {"id": new_monkey_id} diff --git a/monkey/monkey_island/cc/services/node.py b/monkey/monkey_island/cc/services/node.py index 79c3408bf..74fb1b091 100644 --- a/monkey/monkey_island/cc/services/node.py +++ b/monkey/monkey_island/cc/services/node.py @@ -202,7 +202,6 @@ class NodeService: "ip_addresses": [ip_address], "domain_name": domain_name, "exploited": False, - "creds": [], "os": {"type": "unknown", "version": "unknown"}, } ) @@ -318,14 +317,6 @@ class NodeService: def is_monkey_finished_running(): return NodeService.is_any_monkey_exists() and not NodeService.is_any_monkey_alive() - @staticmethod - def add_credentials_to_monkey(monkey_id, creds): - mongo.db.monkey.update({"_id": monkey_id}, {"$push": {"creds": creds}}) - - @staticmethod - def add_credentials_to_node(node_id, creds): - mongo.db.node.update({"_id": node_id}, {"$push": {"creds": creds}}) - @staticmethod def get_node_or_monkey_by_ip(ip_address): node = NodeService.get_node_by_ip(ip_address)