From 030b1c683e7c9d52c955903754af025794970670 Mon Sep 17 00:00:00 2001 From: Ace Pace Date: Mon, 7 Dec 2020 16:54:58 +0200 Subject: [PATCH] Monkey: Guard against exceptions while fingerprinting --- monkey/infection_monkey/monkey.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index a15a06edf..3a19e40ac 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -170,7 +170,11 @@ class InfectionMonkey(object): for finger in self._fingerprint: LOG.info("Trying to get OS fingerprint from %r with module %s", machine, finger.__class__.__name__) - finger.get_host_fingerprint(machine) + try: + finger.get_host_fingerprint(machine) + except BaseException as exc: + LOG.error("Failed to run fingerprinter %s, exception %s" % finger.__class__.__name__, + str(exc)) ScanTelem(machine).send()