From 5189f138d790f56af33db5dfa239a63317d5f9a1 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 5 Dec 2010 23:18:16 +0000 Subject: [PATCH] increasing socket timeout in case of time based checks --- lib/controller/checks.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index 3f23b1a6f..bf29d0105 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -347,6 +347,11 @@ def checkSqlInjection(place, parameter, value): # In case of time-based blind or stacked queries # SQL injections elif method == "time": + # Store old value of socket timeout + pushValue(socket.getdefaulttimeout()) + # Set socket timeout to 2 minutes as some + # time based checks can take awhile + socket.setdefaulttimeout(120) # Perform the test's request and check how long # it takes to get the response back start = time.time() @@ -358,6 +363,8 @@ def checkSqlInjection(place, parameter, value): logger.info(infoMsg) injectable = True + # Restore old value of socket timeout + socket.setdefaulttimeout(popValue()) # Restore page template if where == 2: