mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-01-23 06:39:02 +00:00
sqlmap 0.6.3-rc1:
* Minor enhancement to be able to specify the number of seconds to wait between each HTTP request. * Minor bug fix to handle session.error and session.timeout in HTTP requests. * Updated documentation.
This commit is contained in:
@@ -402,6 +402,9 @@ def __cleanupOptions():
|
||||
if conf.user:
|
||||
conf.user = conf.user.replace(" ", "")
|
||||
|
||||
if conf.delay:
|
||||
conf.delay = float(conf.delay)
|
||||
|
||||
|
||||
def __setConfAttributes():
|
||||
"""
|
||||
@@ -488,7 +491,7 @@ def __saveCmdline():
|
||||
if value == None:
|
||||
if datatype == "boolean":
|
||||
value = "False"
|
||||
elif datatype == "integer":
|
||||
elif datatype in ( "integer", "float" ):
|
||||
if option == "threads":
|
||||
value = "1"
|
||||
else:
|
||||
|
||||
@@ -40,6 +40,7 @@ optDict = {
|
||||
"aCred": "string",
|
||||
"proxy": "string",
|
||||
"threads": "integer",
|
||||
"delay": "float",
|
||||
},
|
||||
|
||||
"Injection": {
|
||||
|
||||
@@ -30,7 +30,7 @@ import sys
|
||||
|
||||
|
||||
# sqlmap version and site
|
||||
VERSION = "0.6.2"
|
||||
VERSION = "0.6.3-rc1"
|
||||
VERSION_STRING = "sqlmap/%s" % VERSION
|
||||
SITE = "http://sqlmap.sourceforge.net"
|
||||
|
||||
|
||||
@@ -89,6 +89,10 @@ def cmdLineParser():
|
||||
help="Maximum number of concurrent HTTP "
|
||||
"requests (default 1)")
|
||||
|
||||
request.add_option("--delay", dest="delay", type="float",
|
||||
help="Delay in seconds between each HTTP request")
|
||||
|
||||
|
||||
# Injection options
|
||||
injection = OptionGroup(parser, "Injection")
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
import md5
|
||||
import re
|
||||
import socket
|
||||
import time
|
||||
import urllib2
|
||||
import urlparse
|
||||
|
||||
@@ -156,7 +158,7 @@ class Connect:
|
||||
status = e.msg
|
||||
responseHeaders = e.info()
|
||||
|
||||
except urllib2.URLError, e:
|
||||
except (urllib2.URLError, socket.error), _:
|
||||
warnMsg = "unable to connect to the target url"
|
||||
|
||||
if conf.googleDork:
|
||||
@@ -168,6 +170,18 @@ class Connect:
|
||||
warnMsg += " or proxy"
|
||||
raise sqlmapConnectionException, warnMsg
|
||||
|
||||
except socket.timeout, _:
|
||||
warnMsg = "connection timed out to the target url"
|
||||
|
||||
if conf.googleDork:
|
||||
warnMsg += ", skipping to next url"
|
||||
logger.warn(warnMsg)
|
||||
|
||||
return None
|
||||
else:
|
||||
warnMsg += " or proxy"
|
||||
raise sqlmapConnectionException, warnMsg
|
||||
|
||||
parsePage(page)
|
||||
responseMsg += "(%s - %d):\n" % (status, code)
|
||||
|
||||
@@ -178,6 +192,9 @@ class Connect:
|
||||
|
||||
logger.log(8, responseMsg)
|
||||
|
||||
if conf.delay != None and isinstance(conf.delay, (int, float)) and conf.delay > 0:
|
||||
time.sleep(conf.delay)
|
||||
|
||||
return page
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user