mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 00:04:23 +03:00
run like --threads=20! will skip the maximum number of threads check
This commit is contained in:
parent
4f122ee008
commit
76f79ece13
|
@ -2190,7 +2190,7 @@ def _basicOptionValidation():
|
||||||
errMsg = "switch '--predict-output' is incompatible with option '--threads' and switch '-o'"
|
errMsg = "switch '--predict-output' is incompatible with option '--threads' and switch '-o'"
|
||||||
raise SqlmapSyntaxException(errMsg)
|
raise SqlmapSyntaxException(errMsg)
|
||||||
|
|
||||||
if conf.threads > MAX_NUMBER_OF_THREADS:
|
if conf.threads > MAX_NUMBER_OF_THREADS and not conf.get("skipThreadCheck"):
|
||||||
errMsg = "maximum number of used threads is %d avoiding potential connection issues" % MAX_NUMBER_OF_THREADS
|
errMsg = "maximum number of used threads is %d avoiding potential connection issues" % MAX_NUMBER_OF_THREADS
|
||||||
raise SqlmapSyntaxException(errMsg)
|
raise SqlmapSyntaxException(errMsg)
|
||||||
|
|
||||||
|
|
|
@ -110,13 +110,18 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
|
||||||
while True:
|
while True:
|
||||||
message = "please enter number of threads? [Enter for %d (current)] " % numThreads
|
message = "please enter number of threads? [Enter for %d (current)] " % numThreads
|
||||||
choice = readInput(message, default=str(numThreads))
|
choice = readInput(message, default=str(numThreads))
|
||||||
if choice and choice.isdigit():
|
if choice:
|
||||||
if int(choice) > MAX_NUMBER_OF_THREADS:
|
skipThreadCheck = False
|
||||||
errMsg = "maximum number of used threads is %d avoiding potential connection issues" % MAX_NUMBER_OF_THREADS
|
if choice.endswith('!'):
|
||||||
logger.critical(errMsg)
|
choice = choice[:-1]
|
||||||
else:
|
skipThreadCheck = True
|
||||||
conf.threads = numThreads = int(choice)
|
if choice.isdigit():
|
||||||
break
|
if int(choice) > MAX_NUMBER_OF_THREADS and not skipThreadCheck:
|
||||||
|
errMsg = "maximum number of used threads is %d avoiding potential connection issues" % MAX_NUMBER_OF_THREADS
|
||||||
|
logger.critical(errMsg)
|
||||||
|
else:
|
||||||
|
conf.threads = numThreads = int(choice)
|
||||||
|
break
|
||||||
|
|
||||||
if numThreads == 1:
|
if numThreads == 1:
|
||||||
warnMsg = "running in a single-thread mode. This could take a while"
|
warnMsg = "running in a single-thread mode. This could take a while"
|
||||||
|
|
|
@ -6,6 +6,7 @@ See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -850,6 +851,9 @@ def cmdLineParser():
|
||||||
for i in xrange(len(argv)):
|
for i in xrange(len(argv)):
|
||||||
if argv[i] == "-hh":
|
if argv[i] == "-hh":
|
||||||
argv[i] = "-h"
|
argv[i] = "-h"
|
||||||
|
elif re.match(r"\A\d+!\Z", argv[i]) and argv[max(0, i - 1)] == "--threads" or re.match(r"\A--threads.+\d+!\Z", argv[i]):
|
||||||
|
argv[i] = argv[i][:-1]
|
||||||
|
conf.skipThreadCheck = True
|
||||||
elif argv[i] == "--version":
|
elif argv[i] == "--version":
|
||||||
print VERSION_STRING.split('/')[-1]
|
print VERSION_STRING.split('/')[-1]
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
Loading…
Reference in New Issue
Block a user