mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-27 00:20:07 +03:00
Merge c2cd94fcaa
into 6ae0d0f54e
This commit is contained in:
commit
fc62acd744
|
@ -4665,7 +4665,7 @@ def findPageForms(content, url, raise_=False, addToTargets=False):
|
||||||
return self._url
|
return self._url
|
||||||
|
|
||||||
if not content:
|
if not content:
|
||||||
errMsg = "can't parse forms as the page content appears to be blank"
|
errMsg = "can't parse forms as the page content appears to be blank for '%s'" % url
|
||||||
if raise_:
|
if raise_:
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -153,7 +153,7 @@ class Connect(object):
|
||||||
def _getPageProxy(**kwargs):
|
def _getPageProxy(**kwargs):
|
||||||
try:
|
try:
|
||||||
if (len(inspect.stack()) > sys.getrecursionlimit() // 2): # Note: https://github.com/sqlmapproject/sqlmap/issues/4525
|
if (len(inspect.stack()) > sys.getrecursionlimit() // 2): # Note: https://github.com/sqlmapproject/sqlmap/issues/4525
|
||||||
warnMsg = "unable to connect to the target URL"
|
warnMsg = "unable to connect to the target URL '%s'" % url
|
||||||
raise SqlmapConnectionException(warnMsg)
|
raise SqlmapConnectionException(warnMsg)
|
||||||
except (TypeError, UnicodeError):
|
except (TypeError, UnicodeError):
|
||||||
pass
|
pass
|
||||||
|
@ -797,7 +797,7 @@ class Connect(object):
|
||||||
if ignoreTimeout:
|
if ignoreTimeout:
|
||||||
return None if not conf.ignoreTimeouts else "", None, None
|
return None if not conf.ignoreTimeouts else "", None, None
|
||||||
else:
|
else:
|
||||||
warnMsg = "unable to connect to the target URL (%d - %s)" % (ex.code, _http_client.responses[ex.code])
|
warnMsg = "unable to connect to the target URL '%s' (%d - %s)" % (url, ex.code, _http_client.responses[ex.code])
|
||||||
if threadData.retriesCount < conf.retries and not kb.threadException:
|
if threadData.retriesCount < conf.retries and not kb.threadException:
|
||||||
warnMsg += ". sqlmap is going to retry the request"
|
warnMsg += ". sqlmap is going to retry the request"
|
||||||
logger.critical(warnMsg)
|
logger.critical(warnMsg)
|
||||||
|
@ -808,7 +808,7 @@ class Connect(object):
|
||||||
else:
|
else:
|
||||||
raise SqlmapConnectionException(warnMsg)
|
raise SqlmapConnectionException(warnMsg)
|
||||||
else:
|
else:
|
||||||
debugMsg = "got HTTP error code: %d ('%s')" % (code, status)
|
debugMsg = "got HTTP error code: %d ('%s') on '%s'" % (code, status, url)
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
|
|
||||||
except (_urllib.error.URLError, socket.error, socket.timeout, _http_client.HTTPException, struct.error, binascii.Error, ProxyError, SqlmapCompressionException, WebSocketException, TypeError, ValueError, OverflowError, AttributeError, OSError, AssertionError, KeyError):
|
except (_urllib.error.URLError, socket.error, socket.timeout, _http_client.HTTPException, struct.error, binascii.Error, ProxyError, SqlmapCompressionException, WebSocketException, TypeError, ValueError, OverflowError, AttributeError, OSError, AssertionError, KeyError):
|
||||||
|
@ -833,12 +833,12 @@ class Connect(object):
|
||||||
warnMsg = "invalid URL address used (%s)" % repr(url)
|
warnMsg = "invalid URL address used (%s)" % repr(url)
|
||||||
raise SqlmapSyntaxException(warnMsg)
|
raise SqlmapSyntaxException(warnMsg)
|
||||||
elif any(_ in tbMsg for _ in ("forcibly closed", "Connection is already closed", "ConnectionAbortedError")):
|
elif any(_ in tbMsg for _ in ("forcibly closed", "Connection is already closed", "ConnectionAbortedError")):
|
||||||
warnMsg = "connection was forcibly closed by the target URL"
|
warnMsg = "connection was forcibly closed by the target URL '%s'" % url
|
||||||
elif "timed out" in tbMsg:
|
elif "timed out" in tbMsg:
|
||||||
if kb.testMode and kb.testType not in (None, PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED):
|
if kb.testMode and kb.testType not in (None, PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED):
|
||||||
singleTimeWarnMessage("there is a possibility that the target (or WAF/IPS) is dropping 'suspicious' requests")
|
singleTimeWarnMessage("there is a possibility that the target (or WAF/IPS) is dropping 'suspicious' requests")
|
||||||
kb.droppingRequests = True
|
kb.droppingRequests = True
|
||||||
warnMsg = "connection timed out to the target URL"
|
warnMsg = "connection timed out to the target URL '%s'" % url
|
||||||
elif "Connection reset" in tbMsg:
|
elif "Connection reset" in tbMsg:
|
||||||
if not conf.disablePrecon:
|
if not conf.disablePrecon:
|
||||||
singleTimeWarnMessage("turning off pre-connect mechanism because of connection reset(s)")
|
singleTimeWarnMessage("turning off pre-connect mechanism because of connection reset(s)")
|
||||||
|
@ -847,9 +847,9 @@ class Connect(object):
|
||||||
if kb.testMode:
|
if kb.testMode:
|
||||||
singleTimeWarnMessage("there is a possibility that the target (or WAF/IPS) is resetting 'suspicious' requests")
|
singleTimeWarnMessage("there is a possibility that the target (or WAF/IPS) is resetting 'suspicious' requests")
|
||||||
kb.droppingRequests = True
|
kb.droppingRequests = True
|
||||||
warnMsg = "connection reset to the target URL"
|
warnMsg = "connection reset to the target URL '%s'" % url
|
||||||
elif "URLError" in tbMsg or "error" in tbMsg:
|
elif "URLError" in tbMsg or "error" in tbMsg:
|
||||||
warnMsg = "unable to connect to the target URL"
|
warnMsg = "unable to connect to the target URL '%s'" % url
|
||||||
match = re.search(r"Errno \d+\] ([^>\n]+)", tbMsg)
|
match = re.search(r"Errno \d+\] ([^>\n]+)", tbMsg)
|
||||||
if match:
|
if match:
|
||||||
warnMsg += " ('%s')" % match.group(1).strip()
|
warnMsg += " ('%s')" % match.group(1).strip()
|
||||||
|
@ -865,7 +865,7 @@ class Connect(object):
|
||||||
warnMsg += "header with option '--user-agent' or switch '--random-agent'"
|
warnMsg += "header with option '--user-agent' or switch '--random-agent'"
|
||||||
elif "IncompleteRead" in tbMsg:
|
elif "IncompleteRead" in tbMsg:
|
||||||
warnMsg = "there was an incomplete read error while retrieving data "
|
warnMsg = "there was an incomplete read error while retrieving data "
|
||||||
warnMsg += "from the target URL"
|
warnMsg += "from the target URL '%s'" % url
|
||||||
elif "Handshake status" in tbMsg:
|
elif "Handshake status" in tbMsg:
|
||||||
status = re.search(r"Handshake status ([\d]{3})", tbMsg)
|
status = re.search(r"Handshake status ([\d]{3})", tbMsg)
|
||||||
errMsg = "websocket handshake status %s" % status.group(1) if status else "unknown"
|
errMsg = "websocket handshake status %s" % status.group(1) if status else "unknown"
|
||||||
|
@ -874,7 +874,7 @@ class Connect(object):
|
||||||
warnMsg = "problems with response (de)compression"
|
warnMsg = "problems with response (de)compression"
|
||||||
retrying = True
|
retrying = True
|
||||||
else:
|
else:
|
||||||
warnMsg = "unable to connect to the target URL"
|
warnMsg = "unable to connect to the target URL '%s'" % url
|
||||||
|
|
||||||
if "BadStatusLine" not in tbMsg and any((conf.proxy, conf.tor)):
|
if "BadStatusLine" not in tbMsg and any((conf.proxy, conf.tor)):
|
||||||
warnMsg += " or proxy"
|
warnMsg += " or proxy"
|
||||||
|
|
|
@ -93,7 +93,7 @@ class HTTPSConnection(_http_client.HTTPSConnection):
|
||||||
sock.close()
|
sock.close()
|
||||||
except (ssl.SSLError, socket.error, _http_client.BadStatusLine) as ex:
|
except (ssl.SSLError, socket.error, _http_client.BadStatusLine) as ex:
|
||||||
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' on '%s:%d' ('%s')" % (_lut[protocol], self.host, self.port, getSafeExString(ex)))
|
||||||
|
|
||||||
elif hasattr(ssl, "wrap_socket"):
|
elif hasattr(ssl, "wrap_socket"):
|
||||||
for protocol in _protocols:
|
for protocol in _protocols:
|
||||||
|
@ -110,7 +110,7 @@ class HTTPSConnection(_http_client.HTTPSConnection):
|
||||||
sock.close()
|
sock.close()
|
||||||
except (ssl.SSLError, socket.error, _http_client.BadStatusLine) as ex:
|
except (ssl.SSLError, socket.error, _http_client.BadStatusLine) as ex:
|
||||||
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' on '%s:%d' ('%s')" % (_lut[protocol], self.host, self.port, getSafeExString(ex)))
|
||||||
|
|
||||||
if not success:
|
if not success:
|
||||||
errMsg = "can't establish SSL connection"
|
errMsg = "can't establish SSL connection"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user