Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf3edcf

Browse files
committed
Fixes #3542
1 parent aa1020a commit bf3edcf

4 files changed

Lines changed: 27 additions & 19 deletions

File tree

lib/controller/checks.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,9 @@ def checkWaf():
13371337
if any((conf.string, conf.notString, conf.regexp, conf.dummy, conf.offline, conf.skipWaf)):
13381338
return None
13391339

1340+
if kb.originalCode == httplib.NOT_FOUND:
1341+
return None
1342+
13401343
_ = hashDBRetrieve(HASHDB_KEYS.CHECK_WAF_RESULT, True)
13411344
if _ is not None:
13421345
if _:
@@ -1544,6 +1547,8 @@ def checkNullConnection():
15441547
return kb.nullConnection is not None
15451548

15461549
def checkConnection(suppressOutput=False):
1550+
threadData = getCurrentThreadData()
1551+
15471552
if not re.search(r"\A\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\Z", conf.hostname):
15481553
if not any((conf.proxy, conf.tor, conf.dummy, conf.offline)):
15491554
try:
@@ -1568,8 +1573,7 @@ def checkConnection(suppressOutput=False):
15681573

15691574
try:
15701575
kb.originalPageTime = time.time()
1571-
page, headers, _ = Request.queryPage(content=True, noteResponseTime=False)
1572-
kb.originalPage = kb.pageTemplate = page
1576+
Request.queryPage(content=True, noteResponseTime=False)
15731577

15741578
kb.errorIsNone = False
15751579

@@ -1592,8 +1596,6 @@ def checkConnection(suppressOutput=False):
15921596
else:
15931597
kb.errorIsNone = True
15941598

1595-
threadData = getCurrentThreadData()
1596-
15971599
if kb.redirectChoice == REDIRECTION.YES and threadData.lastRedirectURL and threadData.lastRedirectURL[0] == threadData.lastRequestUID:
15981600
if (threadData.lastRedirectURL[1] or "").startswith("https://") and unicodeencode(conf.hostname) in threadData.lastRedirectURL[1]:
15991601
conf.url = re.sub(r"https?://", "https://", conf.url)
@@ -1624,6 +1626,9 @@ def checkConnection(suppressOutput=False):
16241626
kb.ignoreNotFound = True
16251627
else:
16261628
raise
1629+
finally:
1630+
kb.originalPage = kb.pageTemplate = threadData.lastPage
1631+
kb.originalCode = threadData.lastCode
16271632

16281633
return True
16291634

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.3.3.36"
22+
VERSION = "1.3.3.37"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/request/connect.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -753,15 +753,19 @@ class _(dict):
753753
page = unicode(page, errors="ignore")
754754
else:
755755
page = getUnicode(page)
756-
socket.setdefaulttimeout(conf.timeout)
757756

758-
for function in kb.preprocessFunctions:
759-
try:
760-
page, responseHeaders, code = function(page, responseHeaders, code)
761-
except Exception as ex:
762-
errMsg = "error occurred while running preprocess "
763-
errMsg += "function '%s' ('%s')" % (function.func_name, getSafeExString(ex))
764-
raise SqlmapGenericException(errMsg)
757+
for function in kb.preprocessFunctions:
758+
try:
759+
page, responseHeaders, code = function(page, responseHeaders, code)
760+
except Exception as ex:
761+
errMsg = "error occurred while running preprocess "
762+
errMsg += "function '%s' ('%s')" % (function.func_name, getSafeExString(ex))
763+
raise SqlmapGenericException(errMsg)
764+
765+
threadData.lastPage = page
766+
threadData.lastCode = code
767+
768+
socket.setdefaulttimeout(conf.timeout)
765769

766770
processResponse(page, responseHeaders, status)
767771

@@ -1309,10 +1313,9 @@ def _(value):
13091313
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)
13101314

13111315
threadData.lastQueryDuration = calculateDeltaSeconds(start)
1312-
threadData.lastPage = page
1313-
threadData.lastCode = code
13141316

1315-
kb.originalCode = kb.originalCode or code
1317+
kb.originalCode = code if kb.originalCode is None else kb.originalCode
1318+
kb.originalPage = page if kb.originalPage is None else kb.originalPage
13161319

13171320
if kb.testMode:
13181321
kb.testQueryCount += 1

txt/checksum.md5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fb6be55d21a70765e35549af2484f762 extra/sqlharvest/__init__.py
2424
fb6be55d21a70765e35549af2484f762 extra/wafdetectify/__init__.py
2525
4dc5e7c5400204159baaf10a0a9124f0 extra/wafdetectify/wafdetectify.py
2626
e6909a3b32fc09c0373101eb58c76538 lib/controller/action.py
27-
0fce185e63b1b743b3ef0a3dbe640366 lib/controller/checks.py
27+
e51ec20c402d53c3cbcae0b6bd71bd5d lib/controller/checks.py
2828
8581acf56b8fb0def50af3707490a834 lib/controller/controller.py
2929
c1da277517c7ec4c23e953a51b51e203 lib/controller/handler.py
3030
fb6be55d21a70765e35549af2484f762 lib/controller/__init__.py
@@ -50,7 +50,7 @@ d5ef43fe3cdd6c2602d7db45651f9ceb lib/core/readlineng.py
5050
7d8a22c582ad201f65b73225e4456170 lib/core/replication.py
5151
3179d34f371e0295dd4604568fb30bcd lib/core/revision.py
5252
d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
53-
94a1fd458bf3c9ced052707b8b5e447d lib/core/settings.py
53+
63db6d32f98705fc0240aaeeff88ef0d lib/core/settings.py
5454
4483b4a5b601d8f1c4281071dff21ecc lib/core/shell.py
5555
10fd19b0716ed261e6d04f311f6f527c lib/core/subprocessng.py
5656
10d7e4f7ba2502cce5cf69223c52eddc lib/core/target.py
@@ -73,7 +73,7 @@ e4ea70bcd461f5176867dcd89d372386 lib/request/basicauthhandler.py
7373
bd4b654767eab19cd4dcd4520a68eed5 lib/request/basic.py
7474
caa52d249fbcf1705cd9208b84d93387 lib/request/chunkedhandler.py
7575
fc25d951217077fe655ed2a3a81552ae lib/request/comparison.py
76-
ea6610ed5557f263cb7a6075732461ce lib/request/connect.py
76+
ff54b009d9aaa8199888615dacaf0c43 lib/request/connect.py
7777
43005bd6a78e9cf0f3ed2283a1cb122e lib/request/direct.py
7878
2b7509ba38a667c61cefff036ec4ca6f lib/request/dns.py
7979
ceac6b3bf1f726f8ff43c6814e9d7281 lib/request/httpshandler.py

0 commit comments

Comments
 (0)