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

Skip to content

Commit a4ebd54

Browse files
committed
Patch for an Issue reported privately via email
1 parent ba369b7 commit a4ebd54

3 files changed

Lines changed: 8 additions & 4 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.1.7.5"
22+
VERSION = "1.1.7.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/request/inject.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ def getValue(expression, blind=True, union=True, error=True, time=True, fromUser
345345
kb.safeCharEncode = safeCharEncode
346346
kb.resumeValues = resumeValue
347347

348+
# Note: following keywords are expected to be in uppercase
349+
for keyword in ("SELECT", "FROM", "WHERE"):
350+
expression = re.sub("(?i)(\A|\(|\)|\s)%s(\Z|\(|\)|\s)" % keyword, r"\g<1>%s\g<2>" % keyword, expression)
351+
348352
if suppressOutput is not None:
349353
pushValue(getCurrentThreadData().disableStdOut)
350354
getCurrentThreadData().disableStdOut = suppressOutput
@@ -356,7 +360,7 @@ def getValue(expression, blind=True, union=True, error=True, time=True, fromUser
356360
if expected == EXPECTED.BOOL:
357361
forgeCaseExpression = booleanExpression = expression
358362

359-
if expression.upper().startswith("SELECT "):
363+
if expression.startswith("SELECT "):
360364
booleanExpression = "(%s)=%s" % (booleanExpression, "'1'" if "'1'" in booleanExpression else "1")
361365
else:
362366
forgeCaseExpression = agent.forgeCaseStatement(expression)

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ b9ff4e622c416116bee6024c0f050349 lib/core/enums.py
4646
d8e9250f3775119df07e9070eddccd16 lib/core/replication.py
4747
785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py
4848
40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py
49-
ab9636352fc61fcb89683d45b2f895e8 lib/core/settings.py
49+
7d6af4ab9aa4b6c10cefe0062409a228 lib/core/settings.py
5050
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
5151
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
5252
baa3f47efa6701076d026e43a6874a51 lib/core/target.py
@@ -73,7 +73,7 @@ fb6b788d0016ab4ec5e5f661f0f702ad lib/request/direct.py
7373
cc1163d38e9b7ee5db2adac6784c02bb lib/request/dns.py
7474
5dcdb37823a0b5eff65cd1018bcf09e4 lib/request/httpshandler.py
7575
310efc965c862cfbd7b0da5150a5ad36 lib/request/__init__.py
76-
70ec3f5bce37cdd7bf085ba2ddda30ac lib/request/inject.py
76+
62b01fc81e0ee708d1b92add612f659e lib/request/inject.py
7777
dc1e0af84ee8eb421797d61c8cb8f172 lib/request/methodrequest.py
7878
bb9c165b050f7696b089b96b5947fac3 lib/request/pkihandler.py
7979
602d4338a9fceaaee40c601410d8ac0b lib/request/rangehandler.py

0 commit comments

Comments
 (0)