mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-08 13:41:29 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2382d2654e | ||
|
|
4cdc3af585 | ||
|
|
212f28d1ad | ||
|
|
e1f7690de4 | ||
|
|
7e425d4c9b |
@@ -271,15 +271,18 @@ def checkSqlInjection(place, parameter, value):
|
|||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if kb.dbmsFilter and not intersect(payloadDbms, kb.dbmsFilter, True):
|
elif kb.dbmsFilter and not intersect(payloadDbms, kb.dbmsFilter, True):
|
||||||
debugMsg = "skipping test '%s' because " % title
|
debugMsg = "skipping test '%s' because " % title
|
||||||
debugMsg += "its declared DBMS is different than provided"
|
debugMsg += "its declared DBMS is different than provided"
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
elif kb.reduceTests == False:
|
||||||
|
pass
|
||||||
|
|
||||||
# Skip DBMS-specific test if it does not match the
|
# Skip DBMS-specific test if it does not match the
|
||||||
# previously identified DBMS (via DBMS-specific payload)
|
# previously identified DBMS (via DBMS-specific payload)
|
||||||
if injection.dbms and not intersect(payloadDbms, injection.dbms, True):
|
elif injection.dbms and not intersect(payloadDbms, injection.dbms, True):
|
||||||
debugMsg = "skipping test '%s' because " % title
|
debugMsg = "skipping test '%s' because " % title
|
||||||
debugMsg += "its declared DBMS is different than identified"
|
debugMsg += "its declared DBMS is different than identified"
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
@@ -287,7 +290,7 @@ def checkSqlInjection(place, parameter, value):
|
|||||||
|
|
||||||
# Skip DBMS-specific test if it does not match the
|
# Skip DBMS-specific test if it does not match the
|
||||||
# previously identified DBMS (via DBMS-specific error message)
|
# previously identified DBMS (via DBMS-specific error message)
|
||||||
if kb.reduceTests and not intersect(payloadDbms, kb.reduceTests, True):
|
elif kb.reduceTests and not intersect(payloadDbms, kb.reduceTests, True):
|
||||||
debugMsg = "skipping test '%s' because the heuristic " % title
|
debugMsg = "skipping test '%s' because the heuristic " % title
|
||||||
debugMsg += "tests showed that the back-end DBMS "
|
debugMsg += "tests showed that the back-end DBMS "
|
||||||
debugMsg += "could be '%s'" % unArrayizeValue(kb.reduceTests)
|
debugMsg += "could be '%s'" % unArrayizeValue(kb.reduceTests)
|
||||||
|
|||||||
@@ -3708,7 +3708,7 @@ def getSortedInjectionTests():
|
|||||||
if test.stype == PAYLOAD.TECHNIQUE.UNION:
|
if test.stype == PAYLOAD.TECHNIQUE.UNION:
|
||||||
retVal = SORT_ORDER.LAST
|
retVal = SORT_ORDER.LAST
|
||||||
|
|
||||||
elif "details" in test and "dbms" in test.details:
|
elif "details" in test and "dbms" in (test.details or {}):
|
||||||
if intersect(test.details.dbms, Backend.getIdentifiedDbms()):
|
if intersect(test.details.dbms, Backend.getIdentifiedDbms()):
|
||||||
retVal = SORT_ORDER.SECOND
|
retVal = SORT_ORDER.SECOND
|
||||||
else:
|
else:
|
||||||
@@ -4693,7 +4693,7 @@ def findPageForms(content, url, raise_=False, addToTargets=False):
|
|||||||
else:
|
else:
|
||||||
url = urldecode(request.get_full_url(), kb.pageEncoding)
|
url = urldecode(request.get_full_url(), kb.pageEncoding)
|
||||||
method = request.get_method()
|
method = request.get_method()
|
||||||
data = request.data
|
data = unArrayizeValue(request.data)
|
||||||
data = urldecode(data, kb.pageEncoding, spaceplus=False)
|
data = urldecode(data, kb.pageEncoding, spaceplus=False)
|
||||||
|
|
||||||
if not data and method and method.upper() == HTTPMETHOD.POST:
|
if not data and method and method.upper() == HTTPMETHOD.POST:
|
||||||
|
|||||||
@@ -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.6.8.0"
|
VERSION = "1.6.9.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)
|
||||||
|
|||||||
@@ -161,7 +161,11 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
|
|||||||
infoMsg = "starting %d threads" % numThreads
|
infoMsg = "starting %d threads" % numThreads
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
_threadFunction()
|
_threadFunction()
|
||||||
|
except (SqlmapUserQuitException, SqlmapSkipTargetException):
|
||||||
|
pass
|
||||||
|
finally:
|
||||||
return
|
return
|
||||||
|
|
||||||
kb.multiThreadMode = True
|
kb.multiThreadMode = True
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ class HTTPSConnection(_http_client.HTTPSConnection):
|
|||||||
Connection class that enables usage of newer SSL protocols.
|
Connection class that enables usage of newer SSL protocols.
|
||||||
|
|
||||||
Reference: http://bugs.python.org/msg128686
|
Reference: http://bugs.python.org/msg128686
|
||||||
|
|
||||||
|
NOTE: use https://check-tls.akamaized.net/ to check if (e.g.) TLS/SNI is working properly
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@@ -61,7 +63,7 @@ class HTTPSConnection(_http_client.HTTPSConnection):
|
|||||||
|
|
||||||
# Reference(s): https://docs.python.org/2/library/ssl.html#ssl.SSLContext
|
# Reference(s): https://docs.python.org/2/library/ssl.html#ssl.SSLContext
|
||||||
# https://www.mnot.net/blog/2014/12/27/python_2_and_tls_sni
|
# https://www.mnot.net/blog/2014/12/27/python_2_and_tls_sni
|
||||||
if re.search(r"\A[\d.]+\Z", conf.hostname or "") is None and kb.tlsSNI.get(conf.hostname) is not False and hasattr(ssl, "SSLContext"):
|
if re.search(r"\A[\d.]+\Z", self.host or "") is None and kb.tlsSNI.get(self.host) is not False and hasattr(ssl, "SSLContext"):
|
||||||
for protocol in (_ for _ in _protocols if _ >= ssl.PROTOCOL_TLSv1):
|
for protocol in (_ for _ in _protocols if _ >= ssl.PROTOCOL_TLSv1):
|
||||||
try:
|
try:
|
||||||
sock = create_sock()
|
sock = create_sock()
|
||||||
@@ -73,7 +75,7 @@ class HTTPSConnection(_http_client.HTTPSConnection):
|
|||||||
_contexts[protocol].set_ciphers("DEFAULT@SECLEVEL=1")
|
_contexts[protocol].set_ciphers("DEFAULT@SECLEVEL=1")
|
||||||
except ssl.SSLError:
|
except ssl.SSLError:
|
||||||
pass
|
pass
|
||||||
result = _contexts[protocol].wrap_socket(sock, do_handshake_on_connect=True, server_hostname=conf.hostname)
|
result = _contexts[protocol].wrap_socket(sock, do_handshake_on_connect=True, server_hostname=self.host)
|
||||||
if result:
|
if result:
|
||||||
success = True
|
success = True
|
||||||
self.sock = result
|
self.sock = result
|
||||||
@@ -86,8 +88,8 @@ class HTTPSConnection(_http_client.HTTPSConnection):
|
|||||||
self._tunnel_host = None
|
self._tunnel_host = None
|
||||||
logger.debug("SSL connection error occurred for '%s' ('%s')" % (_lut[protocol], getSafeExString(ex)))
|
logger.debug("SSL connection error occurred for '%s' ('%s')" % (_lut[protocol], getSafeExString(ex)))
|
||||||
|
|
||||||
if kb.tlsSNI.get(conf.hostname) is None:
|
if kb.tlsSNI.get(self.host) is None:
|
||||||
kb.tlsSNI[conf.hostname] = success
|
kb.tlsSNI[self.host] = success
|
||||||
|
|
||||||
if not success:
|
if not success:
|
||||||
for protocol in _protocols:
|
for protocol in _protocols:
|
||||||
|
|||||||
Reference in New Issue
Block a user