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

Skip to content

Commit 3544793

Browse files
committed
Fixes #3088
1 parent 7a8add0 commit 3544793

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

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.5.5"
22+
VERSION = "1.2.5.6"
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: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def _orderByTest(cols):
9090
kb.errorIsNone = False
9191
lowerCount, upperCount = conf.uColsStart, conf.uColsStop
9292

93-
if lowerCount == 1 or conf.uCols:
94-
found = kb.orderByColumns or (_orderByTechnique(lowerCount, upperCount) if conf.uCols else _orderByTechnique())
93+
if kb.orderByColumns is None and (lowerCount == 1 or conf.uCols): # ORDER BY is not bullet-proof
94+
found = _orderByTechnique(lowerCount, upperCount) if conf.uCols else _orderByTechnique()
9595
if found:
9696
kb.orderByColumns = found
9797
infoMsg = "target URL appears to have %d column%s in query" % (found, 's' if found > 1 else "")
@@ -267,6 +267,8 @@ def _unionTestByCharBruteforce(comment, place, parameter, value, prefix, suffix)
267267

268268
validPayload = None
269269
vector = None
270+
orderBy = kb.orderByColumns
271+
uChars = (conf.uChar, kb.uChar)
270272

271273
# In case that user explicitly stated number of columns affected
272274
if conf.uColsStop == conf.uColsStart:
@@ -301,6 +303,10 @@ def _unionTestByCharBruteforce(comment, place, parameter, value, prefix, suffix)
301303
if not all((validPayload, vector)) and not warnMsg.endswith("consider "):
302304
singleTimeWarnMessage(warnMsg)
303305

306+
if count and orderBy is None and kb.orderByColumns is not None: # discard ORDER BY results (not usable - e.g. maybe invalid altogether)
307+
conf.uChar, kb.uChar = uChars
308+
validPayload, vector = _unionTestByCharBruteforce(comment, place, parameter, value, prefix, suffix)
309+
304310
return validPayload, vector
305311

306312
def unionTest(comment, place, parameter, value, prefix, suffix):

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ c9a56e58984420a5abb7a3f7aadc196d lib/core/optiondict.py
4747
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
4848
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
4949
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
50-
2b1dd381a11c70766d31a272619dc356 lib/core/settings.py
50+
051375e24f79fe7967a7401d57e084cf lib/core/settings.py
5151
0dfc2ed40adf72e302291f6ecd4406f6 lib/core/shell.py
5252
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
5353
6306284edcccc185b2df085438572b0d lib/core/target.py
@@ -97,7 +97,7 @@ bad83c6386adf345fbc982bdafbe3b93 lib/techniques/dns/use.py
9797
f999f2e88dea9ac8831eb2f468478b5f lib/techniques/error/use.py
9898
1e5532ede194ac9c083891c2f02bca93 lib/techniques/__init__.py
9999
1e5532ede194ac9c083891c2f02bca93 lib/techniques/union/__init__.py
100-
2075952d327723169de8fb7ac667c9c1 lib/techniques/union/test.py
100+
94d7a22bb6725a91e84ba2cd9973e96d lib/techniques/union/test.py
101101
11ecf2effbe9f40b361843d546c3c521 lib/techniques/union/use.py
102102
8d99c07416df40350ff8836d9d79ebb5 lib/utils/api.py
103103
37dfb641358669f62c2acedff241348b lib/utils/brute.py

0 commit comments

Comments
 (0)