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

Skip to content

Commit 9d28ae2

Browse files
committed
fixup for situations with unexpected LENGTHs in multithreaded mode (e.g. UTF8 data retrieval)
1 parent dc8862a commit 9d28ae2

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,7 @@ def __setKnowledgeBaseAttributes():
973973
logger.debug(debugMsg)
974974

975975
kb.absFilePaths = set()
976+
kb.assumeBlank = False
976977
kb.bannerFp = advancedDict()
977978

978979
kb.cache = advancedDict()

lib/techniques/blind/inference.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from lib.core.common import getCharset
3333
from lib.core.common import goGoodSamaritan
3434
from lib.core.common import getPartRun
35+
from lib.core.common import readInput
3536
from lib.core.common import replaceNewlineTabs
3637
from lib.core.common import safeStringFormat
3738
from lib.core.convert import urlencode
@@ -289,7 +290,21 @@ def downloadThread():
289290
val = getChar(curidx)
290291

291292
if val is None:
292-
raise sqlmapValueException, "failed to get character at index %d (expected %d total)" % (curidx, length)
293+
if not kb.assumeBlank:
294+
iolock.acquire()
295+
warnMsg = "failed to get character at index %d (expected %d total)." % (curidx, length)
296+
logger.warn(warnMsg)
297+
message = "assume blank character? [Y/n/a]"
298+
getOutput = readInput(message, default="Y")
299+
iolock.release()
300+
if getOutput in ("a", "A"):
301+
kb.assumeBlank = True
302+
elif not getOutput or getOutput in ("y", "Y"):
303+
pass # do nothing
304+
else:
305+
raise sqlmapValueException
306+
307+
val = ' '
293308
else:
294309
break
295310

0 commit comments

Comments
 (0)