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

Skip to content

Commit 8994bf2

Browse files
committed
Further dealing with time-based SQLi (Issue #1973)
1 parent 09617c8 commit 8994bf2

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

lib/controller/checks.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
from lib.core.settings import IDS_WAF_CHECK_TIMEOUT
7575
from lib.core.settings import MAX_DIFFLIB_SEQUENCE_LENGTH
7676
from lib.core.settings import NON_SQLI_CHECK_PREFIX_SUFFIX_LENGTH
77+
from lib.core.settings import SLEEP_TIME_MARKER
7778
from lib.core.settings import SUHOSIN_MAX_VALUE_LENGTH
7879
from lib.core.settings import SUPPORTED_DBMS
7980
from lib.core.settings import URI_HTTP_HEADER
@@ -560,6 +561,12 @@ def genCmpPayload():
560561
trueCode = threadData.lastCode
561562

562563
if trueResult:
564+
# Just extra validation step (e.g. to check for dropping protection mechanisms)
565+
if SLEEP_TIME_MARKER in reqPayload:
566+
falseResult = Request.queryPage(reqPayload.replace(SLEEP_TIME_MARKER, "0"), place, timeBasedCompare=True, raise404=False)
567+
if falseResult:
568+
continue
569+
563570
# Confirm test's results
564571
trueResult = Request.queryPage(reqPayload, place, timeBasedCompare=True, raise404=False)
565572

lib/core/agent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
from lib.core.settings import NULL
4444
from lib.core.settings import PAYLOAD_DELIMITER
4545
from lib.core.settings import REPLACEMENT_MARKER
46+
from lib.core.settings import SLEEP_TIME_MARKER
4647
from lib.core.unescaper import unescaper
4748

4849
class Agent(object):
@@ -343,7 +344,7 @@ def adjustLateValues(self, payload):
343344
"""
344345

345346
if payload:
346-
payload = payload.replace("[SLEEPTIME]", str(conf.timeSec))
347+
payload = payload.replace(SLEEP_TIME_MARKER, str(conf.timeSec))
347348

348349
return payload
349350

lib/core/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.revision import getRevisionNumber
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.0.9.36"
22+
VERSION = "1.0.9.37"
2323
REVISION = getRevisionNumber()
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
@@ -65,6 +65,7 @@
6565

6666
RANDOM_INTEGER_MARKER = "[RANDINT]"
6767
RANDOM_STRING_MARKER = "[RANDSTR]"
68+
SLEEP_TIME_MARKER = "[SLEEPTIME]"
6869

6970
PAYLOAD_DELIMITER = "__PAYLOAD_DELIMITER__"
7071
CHAR_INFERENCE_MARK = "%c"

txt/checksum.md5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ b46521e29ea3d813bab5aeb16cac6498 extra/shutils/duplicates.py
2020
cc9c82cfffd8ee9b25ba3af6284f057e extra/sqlharvest/__init__.py
2121
4f2f817596540d82f9fcc0c5b2228beb extra/sqlharvest/sqlharvest.py
2222
2daa39e4d59526acb4772b6c47eb315f lib/controller/action.py
23-
af33b6f729a33235d0230e7b9af6b9cb lib/controller/checks.py
23+
e2be5a4d5fd7587a78fa15a52fa58f32 lib/controller/checks.py
2424
7c5ba631796f12d6de9b667e4cc7812b lib/controller/controller.py
2525
0a64305c3b3a01a2fc3a5e6204f442f1 lib/controller/handler.py
2626
cc9c82cfffd8ee9b25ba3af6284f057e lib/controller/__init__.py
27-
ed9303846f0bc63a9c518a7164301f80 lib/core/agent.py
27+
a5d4c84e40ac170615ee7e05e770e7c2 lib/core/agent.py
2828
eb0bd28b0bd9fbf67dcc3119116df377 lib/core/bigarray.py
2929
33b28a65ab1a9467203f63d798fd9ddf lib/core/common.py
3030
5680d0c446a3bed5c0f2a0402d031557 lib/core/convert.py
@@ -45,7 +45,7 @@ e60456db5380840a586654344003d4e6 lib/core/readlineng.py
4545
5ef56abb8671c2ca6ceecb208258e360 lib/core/replication.py
4646
99a2b496b9d5b546b335653ca801153f lib/core/revision.py
4747
7c15dd2777af4dac2c89cab6df17462e lib/core/session.py
48-
c007f8f0c5f3d8f7b801f33d0ec58448 lib/core/settings.py
48+
5ea71214107e2dc870a14ca2f90e9b49 lib/core/settings.py
4949
7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py
5050
23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py
5151
0bc2fae1dec18cdd11954b22358293f2 lib/core/target.py

0 commit comments

Comments
 (0)