From c8e2de62240ac714a54a692fde99743ae86c6c22 Mon Sep 17 00:00:00 2001 From: Daniel Goldberg Date: Wed, 27 Nov 2019 13:56:37 +0200 Subject: [PATCH] Avoid mutable default parameter. --- monkey/infection_monkey/exploit/shellshock.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/exploit/shellshock.py b/monkey/infection_monkey/exploit/shellshock.py index f65974dbd..0da543a69 100644 --- a/monkey/infection_monkey/exploit/shellshock.py +++ b/monkey/infection_monkey/exploit/shellshock.py @@ -172,10 +172,13 @@ class ShellShockExploiter(HostExploiter): LOG.info("File %s exists on remote host" % file_path) return resp - def attempt_exploit(self, url, attacks=_attacks): + def attempt_exploit(self, url, attacks=None): # Flag used to identify whether the exploit has successfully caused the # server to return a useful response + if not attacks: + attacks = self._attacks + LOG.debug("Attack Flag is: %s" % self.success_flag) LOG.debug("Trying exploit for %s" % url)