Skip to content

Commit e236ba5

Browse files
committed
Removing single-thread limit for time-based SQLi
1 parent a6b6b91 commit e236ba5

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
18751875
kb.followSitemapRecursion = None
18761876
kb.forcedDbms = None
18771877
kb.forcePartialUnion = False
1878+
kb.forceThreads = None
18781879
kb.forceWhere = None
18791880
kb.futileUnion = None
18801881
kb.heavilyDynamic = False

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

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

lib/parse/cmdline.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,6 @@ def cmdLineParser(argv=None):
721721
parser.add_option("--force-pivoting", dest="forcePivoting", action="store_true",
722722
help=SUPPRESS_HELP)
723723

724-
parser.add_option("--force-threads", dest="forceThreads", action="store_true",
725-
help=SUPPRESS_HELP)
726-
727724
parser.add_option("--smoke-test", dest="smokeTest", action="store_true",
728725
help=SUPPRESS_HELP)
729726

lib/request/inject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def _goInference(payload, expression, charsetType=None, firstChar=None, lastChar
9191
timeBasedCompare = (kb.technique in (PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED))
9292

9393
if not (timeBasedCompare and kb.dnsTest):
94-
if (conf.eta or conf.threads > 1) and Backend.getIdentifiedDbms() and not re.search(r"(COUNT|LTRIM)\(", expression, re.I) and not (timeBasedCompare and not conf.forceThreads):
94+
if (conf.eta or conf.threads > 1) and Backend.getIdentifiedDbms() and not re.search(r"(COUNT|LTRIM)\(", expression, re.I) and not (timeBasedCompare and not kb.forceThreads):
9595

9696
if field and re.search(r"\ASELECT\s+DISTINCT\((.+?)\)\s+FROM", expression, re.I):
9797
expression = "SELECT %s FROM (%s)" % (field, expression)

lib/techniques/blind/inference.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from lib.core.common import hashDBRetrieve
2525
from lib.core.common import hashDBWrite
2626
from lib.core.common import incrementCounter
27+
from lib.core.common import readInput
2728
from lib.core.common import safeStringFormat
2829
from lib.core.common import singleTimeWarnMessage
2930
from lib.core.data import conf
@@ -163,12 +164,15 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
163164
if showEta:
164165
progress = ProgressBar(maxValue=length)
165166

166-
if timeBasedCompare and conf.threads > 1 and not conf.forceThreads:
167-
warnMsg = "multi-threading is considered unsafe in time-based data retrieval. Going to switch it off automatically"
168-
singleTimeWarnMessage(warnMsg)
167+
if timeBasedCompare and conf.threads > 1 and kb.forceThreads is None:
168+
msg = "multi-threading is considered unsafe in "
169+
msg += "time-based data retrieval. Are you sure "
170+
msg += "of your choice (breaking warranty) [y/N] "
171+
172+
kb.forceThreads = readInput(msg, default='N', boolean=True)
169173

170174
if numThreads > 1:
171-
if not timeBasedCompare or conf.forceThreads:
175+
if not timeBasedCompare or kb.forceThreads:
172176
debugMsg = "starting %d thread%s" % (numThreads, ("s" if numThreads > 1 else ""))
173177
logger.debug(debugMsg)
174178
else:

0 commit comments

Comments
 (0)