mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-16 19:40:37 +03:00
Fixes #3542
This commit is contained in:
parent
aa1020a3d1
commit
bf3edcfc1c
|
@ -1337,6 +1337,9 @@ def checkWaf():
|
||||||
if any((conf.string, conf.notString, conf.regexp, conf.dummy, conf.offline, conf.skipWaf)):
|
if any((conf.string, conf.notString, conf.regexp, conf.dummy, conf.offline, conf.skipWaf)):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
if kb.originalCode == httplib.NOT_FOUND:
|
||||||
|
return None
|
||||||
|
|
||||||
_ = hashDBRetrieve(HASHDB_KEYS.CHECK_WAF_RESULT, True)
|
_ = hashDBRetrieve(HASHDB_KEYS.CHECK_WAF_RESULT, True)
|
||||||
if _ is not None:
|
if _ is not None:
|
||||||
if _:
|
if _:
|
||||||
|
@ -1544,6 +1547,8 @@ def checkNullConnection():
|
||||||
return kb.nullConnection is not None
|
return kb.nullConnection is not None
|
||||||
|
|
||||||
def checkConnection(suppressOutput=False):
|
def checkConnection(suppressOutput=False):
|
||||||
|
threadData = getCurrentThreadData()
|
||||||
|
|
||||||
if not re.search(r"\A\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\Z", conf.hostname):
|
if not re.search(r"\A\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\Z", conf.hostname):
|
||||||
if not any((conf.proxy, conf.tor, conf.dummy, conf.offline)):
|
if not any((conf.proxy, conf.tor, conf.dummy, conf.offline)):
|
||||||
try:
|
try:
|
||||||
|
@ -1568,8 +1573,7 @@ def checkConnection(suppressOutput=False):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
kb.originalPageTime = time.time()
|
kb.originalPageTime = time.time()
|
||||||
page, headers, _ = Request.queryPage(content=True, noteResponseTime=False)
|
Request.queryPage(content=True, noteResponseTime=False)
|
||||||
kb.originalPage = kb.pageTemplate = page
|
|
||||||
|
|
||||||
kb.errorIsNone = False
|
kb.errorIsNone = False
|
||||||
|
|
||||||
|
@ -1592,8 +1596,6 @@ def checkConnection(suppressOutput=False):
|
||||||
else:
|
else:
|
||||||
kb.errorIsNone = True
|
kb.errorIsNone = True
|
||||||
|
|
||||||
threadData = getCurrentThreadData()
|
|
||||||
|
|
||||||
if kb.redirectChoice == REDIRECTION.YES and threadData.lastRedirectURL and threadData.lastRedirectURL[0] == threadData.lastRequestUID:
|
if kb.redirectChoice == REDIRECTION.YES and threadData.lastRedirectURL and threadData.lastRedirectURL[0] == threadData.lastRequestUID:
|
||||||
if (threadData.lastRedirectURL[1] or "").startswith("https://") and unicodeencode(conf.hostname) in threadData.lastRedirectURL[1]:
|
if (threadData.lastRedirectURL[1] or "").startswith("https://") and unicodeencode(conf.hostname) in threadData.lastRedirectURL[1]:
|
||||||
conf.url = re.sub(r"https?://", "https://", conf.url)
|
conf.url = re.sub(r"https?://", "https://", conf.url)
|
||||||
|
@ -1624,6 +1626,9 @@ def checkConnection(suppressOutput=False):
|
||||||
kb.ignoreNotFound = True
|
kb.ignoreNotFound = True
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
finally:
|
||||||
|
kb.originalPage = kb.pageTemplate = threadData.lastPage
|
||||||
|
kb.originalCode = threadData.lastCode
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
|
||||||
from lib.core.enums import OS
|
from lib.core.enums import OS
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.3.3.36"
|
VERSION = "1.3.3.37"
|
||||||
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)
|
||||||
|
|
|
@ -753,15 +753,19 @@ class Connect(object):
|
||||||
page = unicode(page, errors="ignore")
|
page = unicode(page, errors="ignore")
|
||||||
else:
|
else:
|
||||||
page = getUnicode(page)
|
page = getUnicode(page)
|
||||||
socket.setdefaulttimeout(conf.timeout)
|
|
||||||
|
|
||||||
for function in kb.preprocessFunctions:
|
for function in kb.preprocessFunctions:
|
||||||
try:
|
try:
|
||||||
page, responseHeaders, code = function(page, responseHeaders, code)
|
page, responseHeaders, code = function(page, responseHeaders, code)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
errMsg = "error occurred while running preprocess "
|
errMsg = "error occurred while running preprocess "
|
||||||
errMsg += "function '%s' ('%s')" % (function.func_name, getSafeExString(ex))
|
errMsg += "function '%s' ('%s')" % (function.func_name, getSafeExString(ex))
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
|
|
||||||
|
threadData.lastPage = page
|
||||||
|
threadData.lastCode = code
|
||||||
|
|
||||||
|
socket.setdefaulttimeout(conf.timeout)
|
||||||
|
|
||||||
processResponse(page, responseHeaders, status)
|
processResponse(page, responseHeaders, status)
|
||||||
|
|
||||||
|
@ -1309,10 +1313,9 @@ class Connect(object):
|
||||||
page, headers, code = Connect.getPage(url=_(kb.secondReq[0]), post=_(kb.secondReq[2]), method=kb.secondReq[1], cookie=kb.secondReq[3], silent=silent, auxHeaders=dict(auxHeaders, **dict(kb.secondReq[4])), response=response, raise404=False, ignoreTimeout=timeBasedCompare, refreshing=True)
|
page, headers, code = Connect.getPage(url=_(kb.secondReq[0]), post=_(kb.secondReq[2]), method=kb.secondReq[1], cookie=kb.secondReq[3], silent=silent, auxHeaders=dict(auxHeaders, **dict(kb.secondReq[4])), response=response, raise404=False, ignoreTimeout=timeBasedCompare, refreshing=True)
|
||||||
|
|
||||||
threadData.lastQueryDuration = calculateDeltaSeconds(start)
|
threadData.lastQueryDuration = calculateDeltaSeconds(start)
|
||||||
threadData.lastPage = page
|
|
||||||
threadData.lastCode = code
|
|
||||||
|
|
||||||
kb.originalCode = kb.originalCode or code
|
kb.originalCode = code if kb.originalCode is None else kb.originalCode
|
||||||
|
kb.originalPage = page if kb.originalPage is None else kb.originalPage
|
||||||
|
|
||||||
if kb.testMode:
|
if kb.testMode:
|
||||||
kb.testQueryCount += 1
|
kb.testQueryCount += 1
|
||||||
|
|
|
@ -24,7 +24,7 @@ fb6be55d21a70765e35549af2484f762 extra/sqlharvest/__init__.py
|
||||||
fb6be55d21a70765e35549af2484f762 extra/wafdetectify/__init__.py
|
fb6be55d21a70765e35549af2484f762 extra/wafdetectify/__init__.py
|
||||||
4dc5e7c5400204159baaf10a0a9124f0 extra/wafdetectify/wafdetectify.py
|
4dc5e7c5400204159baaf10a0a9124f0 extra/wafdetectify/wafdetectify.py
|
||||||
e6909a3b32fc09c0373101eb58c76538 lib/controller/action.py
|
e6909a3b32fc09c0373101eb58c76538 lib/controller/action.py
|
||||||
0fce185e63b1b743b3ef0a3dbe640366 lib/controller/checks.py
|
e51ec20c402d53c3cbcae0b6bd71bd5d lib/controller/checks.py
|
||||||
8581acf56b8fb0def50af3707490a834 lib/controller/controller.py
|
8581acf56b8fb0def50af3707490a834 lib/controller/controller.py
|
||||||
c1da277517c7ec4c23e953a51b51e203 lib/controller/handler.py
|
c1da277517c7ec4c23e953a51b51e203 lib/controller/handler.py
|
||||||
fb6be55d21a70765e35549af2484f762 lib/controller/__init__.py
|
fb6be55d21a70765e35549af2484f762 lib/controller/__init__.py
|
||||||
|
@ -50,7 +50,7 @@ d5ef43fe3cdd6c2602d7db45651f9ceb lib/core/readlineng.py
|
||||||
7d8a22c582ad201f65b73225e4456170 lib/core/replication.py
|
7d8a22c582ad201f65b73225e4456170 lib/core/replication.py
|
||||||
3179d34f371e0295dd4604568fb30bcd lib/core/revision.py
|
3179d34f371e0295dd4604568fb30bcd lib/core/revision.py
|
||||||
d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
|
d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
|
||||||
94a1fd458bf3c9ced052707b8b5e447d lib/core/settings.py
|
63db6d32f98705fc0240aaeeff88ef0d lib/core/settings.py
|
||||||
4483b4a5b601d8f1c4281071dff21ecc lib/core/shell.py
|
4483b4a5b601d8f1c4281071dff21ecc lib/core/shell.py
|
||||||
10fd19b0716ed261e6d04f311f6f527c lib/core/subprocessng.py
|
10fd19b0716ed261e6d04f311f6f527c lib/core/subprocessng.py
|
||||||
10d7e4f7ba2502cce5cf69223c52eddc lib/core/target.py
|
10d7e4f7ba2502cce5cf69223c52eddc lib/core/target.py
|
||||||
|
@ -73,7 +73,7 @@ e4ea70bcd461f5176867dcd89d372386 lib/request/basicauthhandler.py
|
||||||
bd4b654767eab19cd4dcd4520a68eed5 lib/request/basic.py
|
bd4b654767eab19cd4dcd4520a68eed5 lib/request/basic.py
|
||||||
caa52d249fbcf1705cd9208b84d93387 lib/request/chunkedhandler.py
|
caa52d249fbcf1705cd9208b84d93387 lib/request/chunkedhandler.py
|
||||||
fc25d951217077fe655ed2a3a81552ae lib/request/comparison.py
|
fc25d951217077fe655ed2a3a81552ae lib/request/comparison.py
|
||||||
ea6610ed5557f263cb7a6075732461ce lib/request/connect.py
|
ff54b009d9aaa8199888615dacaf0c43 lib/request/connect.py
|
||||||
43005bd6a78e9cf0f3ed2283a1cb122e lib/request/direct.py
|
43005bd6a78e9cf0f3ed2283a1cb122e lib/request/direct.py
|
||||||
2b7509ba38a667c61cefff036ec4ca6f lib/request/dns.py
|
2b7509ba38a667c61cefff036ec4ca6f lib/request/dns.py
|
||||||
ceac6b3bf1f726f8ff43c6814e9d7281 lib/request/httpshandler.py
|
ceac6b3bf1f726f8ff43c6814e9d7281 lib/request/httpshandler.py
|
||||||
|
|
Loading…
Reference in New Issue
Block a user