Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

Port scanning timeouts.

smicallef5fd38c025de2
diff --git a/modules/sfp_portscan_basic.py b/modules/sfp_portscan_basic.py
index c4d1239e..057d5fe4 100644
--- a/modules/sfp_portscan_basic.py
+++ b/modules/sfp_portscan_basic.py
@@ -85,6 +85,7 @@ class sfp_portscan_basic(SpiderFootPlugin):
def tryPort(self, ip, port):
try:
sock = socket.create_connection((ip, port), self.opts['timeout'])
+ sock.settimeout(self.opts['timeout'])
self.portResults[ip + ":" + str(port)] = True
except Exception as e:
self.portResults[ip + ":" + str(port)] = False
@@ -97,6 +98,8 @@ class sfp_portscan_basic(SpiderFootPlugin):
sock.close()
return
+ sock.close()
+
def tryPortWrapper(self, ip, portList):
self.portResults = dict()
running = True