mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 20:51:31 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1740f6332e | ||
|
|
e0ec2fcdbd | ||
|
|
c629374858 | ||
|
|
6caba631a8 |
@@ -16,6 +16,7 @@ import codecs
|
|||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
from lib.core.bigarray import BigArray
|
from lib.core.bigarray import BigArray
|
||||||
from lib.core.compat import xrange
|
from lib.core.compat import xrange
|
||||||
@@ -334,6 +335,10 @@ def getUnicode(value, encoding=None, noneToNull=False):
|
|||||||
True
|
True
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Best position for --time-limit mechanism
|
||||||
|
if conf.get("timeLimit") and kb.get("startTime") and (time.time() - kb.startTime > conf.timeLimit):
|
||||||
|
raise SystemExit
|
||||||
|
|
||||||
if noneToNull and value is None:
|
if noneToNull and value is None:
|
||||||
return NULL
|
return NULL
|
||||||
|
|
||||||
|
|||||||
@@ -2171,6 +2171,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
|
|||||||
kb.smokeMode = False
|
kb.smokeMode = False
|
||||||
kb.reduceTests = None
|
kb.reduceTests = None
|
||||||
kb.sslSuccess = False
|
kb.sslSuccess = False
|
||||||
|
kb.startTime = time.time()
|
||||||
kb.stickyDBMS = False
|
kb.stickyDBMS = False
|
||||||
kb.suppressResumeInfo = False
|
kb.suppressResumeInfo = False
|
||||||
kb.tableFrom = None
|
kb.tableFrom = None
|
||||||
|
|||||||
@@ -239,6 +239,7 @@ optDict = {
|
|||||||
"skipWaf": "boolean",
|
"skipWaf": "boolean",
|
||||||
"testFilter": "string",
|
"testFilter": "string",
|
||||||
"testSkip": "string",
|
"testSkip": "string",
|
||||||
|
"timeLimit": "float",
|
||||||
"webRoot": "string",
|
"webRoot": "string",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ from thirdparty import six
|
|||||||
from thirdparty.six import unichr as _unichr
|
from thirdparty.six import unichr as _unichr
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.7.9.0"
|
VERSION = "1.7.10.0"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|||||||
@@ -736,6 +736,9 @@ def cmdLineParser(argv=None):
|
|||||||
general.add_argument("--test-skip", dest="testSkip",
|
general.add_argument("--test-skip", dest="testSkip",
|
||||||
help="Skip tests by payloads and/or titles (e.g. BENCHMARK)")
|
help="Skip tests by payloads and/or titles (e.g. BENCHMARK)")
|
||||||
|
|
||||||
|
general.add_argument("--time-limit", dest="timeLimit", type=float,
|
||||||
|
help="Run with a time limit in seconds (e.g. 3600)")
|
||||||
|
|
||||||
general.add_argument("--web-root", dest="webRoot",
|
general.add_argument("--web-root", dest="webRoot",
|
||||||
help="Web server document root directory (e.g. \"/var/www\")")
|
help="Web server document root directory (e.g. \"/var/www\")")
|
||||||
|
|
||||||
|
|||||||
@@ -641,7 +641,7 @@ class Connect(object):
|
|||||||
responseHeaders = conn.info()
|
responseHeaders = conn.info()
|
||||||
responseHeaders[URI_HTTP_HEADER] = conn.geturl() if hasattr(conn, "geturl") else url
|
responseHeaders[URI_HTTP_HEADER] = conn.geturl() if hasattr(conn, "geturl") else url
|
||||||
|
|
||||||
if hasattr(conn, "redurl"):
|
if getattr(conn, "redurl", None) is not None:
|
||||||
responseHeaders[HTTP_HEADER.LOCATION] = conn.redurl
|
responseHeaders[HTTP_HEADER.LOCATION] = conn.redurl
|
||||||
|
|
||||||
responseHeaders = patchHeaders(responseHeaders)
|
responseHeaders = patchHeaders(responseHeaders)
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ def _goInferenceProxy(expression, fromUser=False, batch=False, unpack=True, char
|
|||||||
|
|
||||||
stopLimit = 1
|
stopLimit = 1
|
||||||
|
|
||||||
elif (not count or int(count) == 0):
|
elif not isNumPosStrValue(count):
|
||||||
if not count:
|
if not count:
|
||||||
warnMsg = "the SQL query provided does not "
|
warnMsg = "the SQL query provided does not "
|
||||||
warnMsg += "return any output"
|
warnMsg += "return any output"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ See the file 'LICENSE' for copying permission
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import io
|
import io
|
||||||
|
import re
|
||||||
import time
|
import time
|
||||||
import types
|
import types
|
||||||
|
|
||||||
@@ -71,6 +72,7 @@ class SmartRedirectHandler(_urllib.request.HTTPRedirectHandler):
|
|||||||
def http_error_302(self, req, fp, code, msg, headers):
|
def http_error_302(self, req, fp, code, msg, headers):
|
||||||
start = time.time()
|
start = time.time()
|
||||||
content = None
|
content = None
|
||||||
|
forceRedirect = False
|
||||||
redurl = self._get_header_redirect(headers) if not conf.ignoreRedirects else None
|
redurl = self._get_header_redirect(headers) if not conf.ignoreRedirects else None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -111,12 +113,18 @@ class SmartRedirectHandler(_urllib.request.HTTPRedirectHandler):
|
|||||||
redurl = _urllib.parse.urljoin(req.get_full_url(), redurl)
|
redurl = _urllib.parse.urljoin(req.get_full_url(), redurl)
|
||||||
|
|
||||||
self._infinite_loop_check(req)
|
self._infinite_loop_check(req)
|
||||||
self._ask_redirect_choice(code, redurl, req.get_method())
|
if conf.scope:
|
||||||
|
if not re.search(conf.scope, redurl, re.I):
|
||||||
|
redurl = None
|
||||||
|
else:
|
||||||
|
forceRedirect = True
|
||||||
|
else:
|
||||||
|
self._ask_redirect_choice(code, redurl, req.get_method())
|
||||||
except ValueError:
|
except ValueError:
|
||||||
redurl = None
|
redurl = None
|
||||||
result = fp
|
result = fp
|
||||||
|
|
||||||
if redurl and kb.choices.redirect == REDIRECTION.YES:
|
if redurl and (kb.choices.redirect == REDIRECTION.YES or forceRedirect):
|
||||||
parseResponse(content, headers)
|
parseResponse(content, headers)
|
||||||
|
|
||||||
req.headers[HTTP_HEADER.HOST] = getHostHeader(redurl)
|
req.headers[HTTP_HEADER.HOST] = getHostHeader(redurl)
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ def errorUse(expression, dump=False):
|
|||||||
|
|
||||||
stopLimit = 1
|
stopLimit = 1
|
||||||
|
|
||||||
elif (not count or int(count) == 0):
|
elif not isNumPosStrValue(count):
|
||||||
if not count:
|
if not count:
|
||||||
warnMsg = "the SQL query provided does not "
|
warnMsg = "the SQL query provided does not "
|
||||||
warnMsg += "return any output"
|
warnMsg += "return any output"
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ def unionUse(expression, unpack=True, dump=False):
|
|||||||
|
|
||||||
stopLimit = 1
|
stopLimit = 1
|
||||||
|
|
||||||
elif (not count or int(count) == 0):
|
elif not isNumPosStrValue(count):
|
||||||
if not count:
|
if not count:
|
||||||
warnMsg = "the SQL query provided does not "
|
warnMsg = "the SQL query provided does not "
|
||||||
warnMsg += "return any output"
|
warnMsg += "return any output"
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ uFrom =
|
|||||||
# Column values to use for UNION query SQL injection.
|
# Column values to use for UNION query SQL injection.
|
||||||
# Valid: string
|
# Valid: string
|
||||||
# Example: NULL,1,*,NULL
|
# Example: NULL,1,*,NULL
|
||||||
uChar =
|
uValues =
|
||||||
|
|
||||||
# Domain name used for DNS exfiltration attack.
|
# Domain name used for DNS exfiltration attack.
|
||||||
# Valid: string
|
# Valid: string
|
||||||
@@ -820,12 +820,15 @@ skipWaf = False
|
|||||||
# Default: sqlmap
|
# Default: sqlmap
|
||||||
tablePrefix = sqlmap
|
tablePrefix = sqlmap
|
||||||
|
|
||||||
# Select tests by payloads and/or titles (e.g. ROW)
|
# Select tests by payloads and/or titles (e.g. ROW).
|
||||||
testFilter =
|
testFilter =
|
||||||
|
|
||||||
# Skip tests by payloads and/or titles (e.g. BENCHMARK)
|
# Skip tests by payloads and/or titles (e.g. BENCHMARK).
|
||||||
testSkip =
|
testSkip =
|
||||||
|
|
||||||
|
# Run with a time limit in seconds (e.g. 3600).
|
||||||
|
timeLimit =
|
||||||
|
|
||||||
# Web server document root directory (e.g. "/var/www").
|
# Web server document root directory (e.g. "/var/www").
|
||||||
webRoot =
|
webRoot =
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user