From 6150c6fcc0c5b7152342dce1f9d2e13d95da96d9 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Sun, 24 Dec 2017 18:28:01 +0200 Subject: [PATCH] Fix bug where machine was popped out --- monkey_island/cc/resources/telemetry.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monkey_island/cc/resources/telemetry.py b/monkey_island/cc/resources/telemetry.py index 7b3a6e616..ade4f6734 100644 --- a/monkey_island/cc/resources/telemetry.py +++ b/monkey_island/cc/resources/telemetry.py @@ -1,5 +1,6 @@ import json import traceback +import copy from datetime import datetime import dateutil @@ -108,7 +109,7 @@ class Telemetry(flask_restful.Resource): @staticmethod def process_exploit_telemetry(telemetry_json): edge = Telemetry.get_edge_by_scan_or_exploit_telemetry(telemetry_json) - new_exploit = telemetry_json['data'] + new_exploit = copy.deepcopy(telemetry_json['data']) new_exploit.pop('machine') new_exploit['timestamp'] = telemetry_json['timestamp'] @@ -131,7 +132,7 @@ class Telemetry(flask_restful.Resource): @staticmethod def process_scan_telemetry(telemetry_json): edge = Telemetry.get_edge_by_scan_or_exploit_telemetry(telemetry_json) - data = telemetry_json['data']['machine'] + data = copy.deepcopy(telemetry_json['data']['machine']) ip_address = data.pop("ip_addr") new_scan = \ {