From 03ad75b0432259e419d8c9926a49e07e74e1b8c9 Mon Sep 17 00:00:00 2001
From: VakarisZ <vakarisz@yahoo.com>
Date: Tue, 11 Dec 2018 09:44:21 +0200
Subject: [PATCH] Now break the loop as soon as we encounter timeout

---
 monkey/infection_monkey/exploit/shellshock.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/monkey/infection_monkey/exploit/shellshock.py b/monkey/infection_monkey/exploit/shellshock.py
index 23880589a..a98cbda50 100644
--- a/monkey/infection_monkey/exploit/shellshock.py
+++ b/monkey/infection_monkey/exploit/shellshock.py
@@ -210,7 +210,7 @@ class ShellShockExploiter(HostExploiter):
                 reqs.append(requests.head(u, verify=False, timeout=TIMEOUT))
             except requests.Timeout:
                 timeout = True
-                continue
+                break
         if timeout:
             LOG.debug("Some connections timed out while sending request to potentially vulnerable urls.")
         valid_resps = [req for req in reqs if req and req.status_code == requests.codes.ok]