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

Skip to content

Commit 8a90512

Browse files
committed
One more commit related to the last one (reduce false hopes in heavily dynamic cases)
1 parent ae8699f commit 8a90512

5 files changed

Lines changed: 17 additions & 10 deletions

File tree

lib/controller/checks.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,14 +508,14 @@ def genCmpPayload():
508508
errorResult = Request.queryPage(errorPayload, place, raise404=False)
509509
if errorResult:
510510
continue
511-
elif not any((conf.string, conf.notString, conf.regexp, conf.code, kb.nullConnection)):
511+
elif kb.heuristicPage and not any((conf.string, conf.notString, conf.regexp, conf.code, kb.nullConnection)):
512512
_ = comparison(kb.heuristicPage, None, getRatioValue=True)
513513
if _ > kb.matchRatio:
514514
kb.matchRatio = _
515515
logger.debug("adjusting match ratio for current parameter to %.3f" % kb.matchRatio)
516516

517517
# Reducing false-positive "appears" messages in heavily dynamic environment
518-
if kb.heavyDynamic and not Request.queryPage(reqPayload, place, raise404=False):
518+
if kb.heavilyDynamic and not Request.queryPage(reqPayload, place, raise404=False):
519519
continue
520520

521521
injectable = True
@@ -986,6 +986,11 @@ def heuristicCheckSqlInjection(place, parameter):
986986
logger.debug(debugMsg)
987987
return None
988988

989+
if kb.heavilyDynamic:
990+
debugMsg = "heuristic check skipped because of heavy dynamicity"
991+
logger.debug(debugMsg)
992+
return None
993+
989994
origValue = conf.paramDict[place][parameter]
990995
paramType = conf.method if conf.method not in (None, HTTPMETHOD.GET, HTTPMETHOD.POST) else place
991996

@@ -1048,6 +1053,8 @@ def _(page):
10481053
kb.ignoreCasted = readInput(message, default='Y' if conf.multipleTargets else 'N', boolean=True)
10491054

10501055
elif result:
1056+
import pdb
1057+
pdb.set_trace()
10511058
infoMsg += "be injectable"
10521059
if Backend.getErrorParsedDBMSes():
10531060
infoMsg += " (possible DBMS: '%s')" % Format.getErrorParsedDBMSes()
@@ -1172,7 +1179,7 @@ def checkDynamicContent(firstPage, secondPage):
11721179
warnMsg += "sqlmap is going to retry the request(s)"
11731180
singleTimeLogMessage(warnMsg, logging.CRITICAL)
11741181

1175-
kb.heavyDynamic = True
1182+
kb.heavilyDynamic = True
11761183

11771184
secondPage, _, _ = Request.queryPage(content=True)
11781185
findDynamicContent(firstPage, secondPage)

lib/core/option.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
19451945
kb.forcePartialUnion = False
19461946
kb.forceWhere = None
19471947
kb.futileUnion = None
1948-
kb.heavyDynamic = False
1948+
kb.heavilyDynamic = False
19491949
kb.headersFp = {}
19501950
kb.heuristicDbms = None
19511951
kb.heuristicExtendedDbms = None

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.2.3.50"
22+
VERSION = "1.2.3.51"
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/techniques/union/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _orderByTest(cols):
5454
query = agent.suffixQuery(query, suffix=suffix, comment=comment)
5555
payload = agent.payload(newValue=query, place=place, parameter=parameter, where=where)
5656
page, headers, code = Request.queryPage(payload, place=place, content=True, raise404=False)
57-
return not any(re.search(_, page or "", re.I) and not re.search(_, kb.pageTemplate or "", re.I) for _ in ("(warning|error):", "order by", "unknown column", "failed")) and not kb.heavyDynamic and comparison(page, headers, code) or re.search(r"data types cannot be compared or sorted", page or "", re.I) is not None
57+
return not any(re.search(_, page or "", re.I) and not re.search(_, kb.pageTemplate or "", re.I) for _ in ("(warning|error):", "order by", "unknown column", "failed")) and not kb.heavilyDynamic and comparison(page, headers, code) or re.search(r"data types cannot be compared or sorted", page or "", re.I) is not None
5858

5959
if _orderByTest(1 if lowerCount is None else lowerCount) and not _orderByTest(randomInt() if upperCount is None else upperCount + 1):
6060
infoMsg = "'ORDER BY' technique appears to be usable. "

txt/checksum.md5

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ c88d66597f4aab719bde4542b0a1a6e0 extra/shutils/regressiontest.py
2121
1e5532ede194ac9c083891c2f02bca93 extra/sqlharvest/__init__.py
2222
b3e60ea4e18a65c48515d04aab28ff68 extra/sqlharvest/sqlharvest.py
2323
0f581182871148b0456a691ae85b04c0 lib/controller/action.py
24-
28c80dd4b8f288f46388770415d7c1df lib/controller/checks.py
24+
71a8af96273cde7fd8e8c8b3122df27a lib/controller/checks.py
2525
33689bb1b064d4eebc216934795a595f lib/controller/controller.py
2626
c7443613a0a2505b1faec931cee2a6ef lib/controller/handler.py
2727
1e5532ede194ac9c083891c2f02bca93 lib/controller/__init__.py
@@ -40,13 +40,13 @@ cada93357a7321655927fc9625b3bfec lib/core/exception.py
4040
1e5532ede194ac9c083891c2f02bca93 lib/core/__init__.py
4141
458a194764805cd8312c14ecd4be4d1e lib/core/log.py
4242
c9a56e58984420a5abb7a3f7aadc196d lib/core/optiondict.py
43-
8484e95c616b7a5220157c13e24fa1d6 lib/core/option.py
43+
b950c8c2f2ae87ad2ec99e1d19b2c03a lib/core/option.py
4444
7cfd04e583cca782b843f6f6d973981a lib/core/profiling.py
4545
ffa5f01f39b17c8d73423acca6cfe86a lib/core/readlineng.py
4646
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
4747
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
4848
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
49-
30cc59cf0722d37effce632dcd38dc62 lib/core/settings.py
49+
05c1496418a91fba529536205a7e9cc0 lib/core/settings.py
5050
0dfc2ed40adf72e302291f6ecd4406f6 lib/core/shell.py
5151
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
5252
a35efa7bec9f1e6cedf17c9830a79241 lib/core/target.py
@@ -96,7 +96,7 @@ fb9e34d558293b5d6b9727f440712886 lib/takeover/registry.py
9696
f999f2e88dea9ac8831eb2f468478b5f lib/techniques/error/use.py
9797
1e5532ede194ac9c083891c2f02bca93 lib/techniques/__init__.py
9898
1e5532ede194ac9c083891c2f02bca93 lib/techniques/union/__init__.py
99-
07882f244fc73e130ab1a17caa6f5fb0 lib/techniques/union/test.py
99+
36c49359a110fe0f797b2eb9e2d694ed lib/techniques/union/test.py
100100
11ecf2effbe9f40b361843d546c3c521 lib/techniques/union/use.py
101101
c552f8d924d962a26f2ded250bcea3b8 lib/utils/api.py
102102
37dfb641358669f62c2acedff241348b lib/utils/brute.py

0 commit comments

Comments
 (0)