From 2e2193041799f15d52b2a48ad7e1d3d05b214bdd Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Fri, 3 Apr 2020 21:03:03 +0300 Subject: [PATCH] Fixed bug where bootloader telem creates a second node after monkey finishes --- monkey/monkey_island/cc/services/node.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/monkey/monkey_island/cc/services/node.py b/monkey/monkey_island/cc/services/node.py index 3ad0a270b..6104b279f 100644 --- a/monkey/monkey_island/cc/services/node.py +++ b/monkey/monkey_island/cc/services/node.py @@ -243,6 +243,12 @@ class NodeService: raise NodeCreationException("Bootloader ran on island, no need to create new node.") new_node = mongo.db.node.find_one({"ip_addresses": {"$in": bootloader_telem['ips']}}) + # Temporary workaround to not create a node after monkey finishes + monkey_node = mongo.db.monkey.find_one({"ip_addresses": {"$in": bootloader_telem['ips']}}) + if monkey_node: + # Don't create new node, monkey node is already present + return monkey_node + if new_node is None: new_node = NodeService.create_node_from_bootloader_telem(bootloader_telem, will_monkey_run) if bootloader_telem['tunnel']: