From 46487be05d5d6cc185f4af095025dbfab0cea950 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 7 Feb 2022 12:55:57 -0500 Subject: [PATCH] Agent: Handle new fingerprinters config format in IPScanner --- monkey/infection_monkey/master/ip_scanner.py | 4 ++-- .../unit_tests/infection_monkey/master/test_ip_scanner.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/monkey/infection_monkey/master/ip_scanner.py b/monkey/infection_monkey/master/ip_scanner.py index c78b2e2f9..67520054e 100644 --- a/monkey/infection_monkey/master/ip_scanner.py +++ b/monkey/infection_monkey/master/ip_scanner.py @@ -95,8 +95,8 @@ class IPScanner: fingerprint_data = {} for f in interruptable_iter(fingerprinters, stop): - fingerprint_data[f] = self._puppet.fingerprint( - f, ip, ping_scan_data, port_scan_data, {} + fingerprint_data[f["name"]] = self._puppet.fingerprint( + f["name"], ip, ping_scan_data, port_scan_data, f["options"] ) return fingerprint_data diff --git a/monkey/tests/unit_tests/infection_monkey/master/test_ip_scanner.py b/monkey/tests/unit_tests/infection_monkey/master/test_ip_scanner.py index 59bb6bf77..c6aa0d532 100644 --- a/monkey/tests/unit_tests/infection_monkey/master/test_ip_scanner.py +++ b/monkey/tests/unit_tests/infection_monkey/master/test_ip_scanner.py @@ -30,7 +30,12 @@ def scan_config(): "icmp": { "timeout_ms": 1000, }, - "fingerprinters": {"HTTPFinger", "SMBFinger", "SSHFinger"}, + "fingerprinters": [ + {"name": "HTTPFinger", "options": {}}, + {"name": "SMBFinger", "options": {}}, + {"name": "SSHFinger", "options": {}}, + ] + }