From e5201a2ecf678301b00d19ee65d7ada1501d2816 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Mon, 9 Mar 2020 15:53:38 +0200 Subject: [PATCH] Fixed bootloader creating multiple nodes bug --- monkey/monkey_island/cc/services/node.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/services/node.py b/monkey/monkey_island/cc/services/node.py index b45a12609..3ad0a270b 100644 --- a/monkey/monkey_island/cc/services/node.py +++ b/monkey/monkey_island/cc/services/node.py @@ -242,8 +242,7 @@ class NodeService: if is_local_ips(bootloader_telem['ips']): raise NodeCreationException("Bootloader ran on island, no need to create new node.") - new_node = mongo.db.node.find_one({"domain_name": bootloader_telem['hostname'], - "ip_addresses": bootloader_telem['ips']}) + new_node = mongo.db.node.find_one({"ip_addresses": {"$in": bootloader_telem['ips']}}) if new_node is None: new_node = NodeService.create_node_from_bootloader_telem(bootloader_telem, will_monkey_run) if bootloader_telem['tunnel']: