diff --git a/lib/core/option.py b/lib/core/option.py index 3812cc5e7..f5113fe97 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -114,14 +114,13 @@ def __urllib2Opener(): # Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html if conf.keepAlive: + warnMsg = "persistent HTTP(s) connections, Keep-Alive, has " + warnMsg += "been disabled because of it's incompatibility " + if conf.proxy: - warnMsg = "persistent HTTP(s) connections, Keep-Alive, has " - warnMsg += "been disabled because of it's incompatibility " warnMsg += "with HTTP(s) proxy" logger.warn(warnMsg) elif conf.aType: - warnMsg = "persistent HTTP(s) connections, Keep-Alive, has " - warnMsg += "been disabled because of it's incompatibility " warnMsg += "with authentication methods" logger.warn(warnMsg) else: @@ -507,38 +506,6 @@ def __setWriteFile(): conf.wFileType = getFileType(conf.wFile) -def __setUnion(): - if isinstance(conf.uCols, basestring) and conf.uChar != "1-20": - debugMsg = "setting the UNION query SQL injection range of columns" - logger.debug(debugMsg) - - if "-" not in conf.uCols or len(conf.uCols.split("-")) != 2: - raise sqlmapSyntaxException, "--union-cols must be a range with hyphon (e.g. 1-10)" - - conf.uCols = conf.uCols.replace(" ", "") - conf.uColsStart, conf.uColsStop = conf.uCols.split("-") - - if not conf.uColsStart.isdigit() or not conf.uColsStop.isdigit(): - raise sqlmapSyntaxException, "--union-cols must be a range of integers" - - conf.uColsStart = int(conf.uColsStart) - conf.uColsStop = int(conf.uColsStop) - - if conf.uColsStart > conf.uColsStop: - errMsg = "--union-cols range has to be from lower to " - errMsg += "higher number of columns" - raise sqlmapSyntaxException, errMsg - - if isinstance(conf.uChar, basestring) and conf.uChar != "NULL": - debugMsg = "setting the UNION query SQL injection character to '%s'" % conf.uChar - logger.debug(debugMsg) - - if not conf.uChar.isdigit() and ( not conf.uChar.startswith("'") or not conf.uChar.endswith("'") ): - debugMsg = "forcing the UNION query SQL injection character to '%s'" % conf.uChar - logger.debug(debugMsg) - - conf.uChar = "'%s'" % conf.uChar - def __setOS(): """ Force the back-end DBMS operating system option. @@ -1406,7 +1373,6 @@ def init(inputOptions=advancedDict()): __setHTTPAuthentication() __setHTTPProxy() __setSafeUrl() - __setUnion() __setGoogleDorking() __urllib2Opener() __findPageForms() diff --git a/lib/core/threads.py b/lib/core/threads.py index aa78a83fd..9dec6557b 100644 --- a/lib/core/threads.py +++ b/lib/core/threads.py @@ -36,4 +36,3 @@ def getCurrentThreadData(): if threadUID not in kb.threadData: kb.threadData[threadUID] = ThreadData() return kb.threadData[threadUID] - diff --git a/lib/request/connect.py b/lib/request/connect.py index 131ae4b62..f3f29de61 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -463,6 +463,7 @@ class Connect: if kb.testMode: kb.testQueryCount += 1 + if conf.cj: conf.cj.clear() diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index 4935086b5..486a37b8d 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -320,13 +320,14 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if (endCharIndex - startCharIndex == conf.progressWidth) and (endCharIndex < length-1): output = output[:-2] + '..' - output += '_' * (min(length, conf.progressWidth) - len(output)) - status = ' %d/%d (%d%s)' % (count, length, round(100.0*count/length), '%') - output += status if count != length else " "*len(status) + if conf.verbose in (1, 2) and not showEta: + output += '_' * (min(length, conf.progressWidth) - len(output)) + status = ' %d/%d (%d%s)' % (count, length, round(100.0*count/length), '%') + output += status if count != length else " "*len(status) - iolock.acquire() - dataToStdout("\r[%s] [INFO] retrieved: %s" % (time.strftime("%X"), filterControlChars(output))) - iolock.release() + iolock.acquire() + dataToStdout("\r[%s] [INFO] retrieved: %s" % (time.strftime("%X"), filterControlChars(output))) + iolock.release() if not kb.threadContinue: if int(threading.currentThread().getName()) == numThreads - 1: diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 33dfc1398..ff4ec0a1e 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -744,6 +744,7 @@ class Enumeration: if bruteForce: resumeAvailable = False + for db, table in kb.brute.tables: if db == conf.db: resumeAvailable = True @@ -919,6 +920,7 @@ class Enumeration: if bruteForce: resumeAvailable = False + for db, table, colName, colType in kb.brute.columns: if db == conf.db and table == conf.tbl: resumeAvailable = True @@ -931,6 +933,7 @@ class Enumeration: columns[colName] = colType kb.data.cachedColumns[conf.db] = {conf.tbl: columns} + return kb.data.cachedColumns message = "do you want to use common columns existance check? [Y/n/q]"