increasing socket timeout in case of time based checks

This commit is contained in:
Miroslav Stampar 2010-12-05 23:18:16 +00:00
parent 17449754fe
commit 5189f138d7

View File

@ -347,6 +347,11 @@ def checkSqlInjection(place, parameter, value):
# In case of time-based blind or stacked queries # In case of time-based blind or stacked queries
# SQL injections # SQL injections
elif method == "time": 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 # Perform the test's request and check how long
# it takes to get the response back # it takes to get the response back
start = time.time() start = time.time()
@ -358,6 +363,8 @@ def checkSqlInjection(place, parameter, value):
logger.info(infoMsg) logger.info(infoMsg)
injectable = True injectable = True
# Restore old value of socket timeout
socket.setdefaulttimeout(popValue())
# Restore page template # Restore page template
if where == 2: if where == 2: