diff --git a/lib/core/common.py b/lib/core/common.py index b554214df..b0eeaddd8 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1360,7 +1360,7 @@ def normalizePath(filepath): retVal = filepath if retVal: - retVal = retVal.strip("\r").strip("\n") + retVal = retVal.strip("\r\n") retVal = ntpath.normpath(retVal) if isWindowsDriveLetterPath(retVal) else posixpath.normpath(retVal) return retVal diff --git a/lib/core/option.py b/lib/core/option.py index 5c7777797..798b82cfe 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -916,7 +916,7 @@ def _setDNSCache(): def _setHTTPProxy(): """ - Check and set the HTTP proxy to pass by all HTTP requests. + Check and set the HTTP/SOCKS proxy for all HTTP requests. """ global proxyHandler @@ -927,7 +927,7 @@ def _setHTTPProxy(): return - debugMsg = "setting the HTTP/SOCKS proxy to pass by all HTTP requests" + debugMsg = "setting the HTTP/SOCKS proxy for all HTTP requests" logger.debug(debugMsg) proxySplit = urlparse.urlsplit(conf.proxy) @@ -1376,7 +1376,7 @@ def _cleanupOptions(): if not any([char in conf.testFilter for char in ('.', ')', '(', ']', '[')]): conf.testFilter = conf.testFilter.replace('*', '.*') - if conf.timeSec not in kb.explicitSettings: + if "timeSec" not in kb.explicitSettings: if conf.tor: conf.timeSec = 2 * conf.timeSec kb.adjustTimeDelay = ADJUST_TIME_DELAY.DISABLE diff --git a/plugins/generic/filesystem.py b/plugins/generic/filesystem.py index 7ced5df0a..e9ea439f1 100644 --- a/plugins/generic/filesystem.py +++ b/plugins/generic/filesystem.py @@ -65,7 +65,7 @@ class Filesystem: if localFileSize == remoteFileSize: sameFile = True infoMsg = "the local file %s and the remote file " % localFile - infoMsg += "%s have the same size" % remoteFile + infoMsg += "%s has the same size" % remoteFile elif remoteFileSize > localFileSize: infoMsg = "the remote file %s is larger than " % remoteFile infoMsg += "the local file %s" % localFile diff --git a/tamper/between.py b/tamper/between.py index 136fbadf3..6035c4c0d 100644 --- a/tamper/between.py +++ b/tamper/between.py @@ -38,29 +38,10 @@ def tamper(payload, **kwargs): retVal = payload if payload: - retVal = "" - quote, doublequote, firstspace = False, False, False + match = re.search(r"(?i)(\b(AND|OR)\b\s+)(?!.*\b(AND|OR)\b)([^>]+?)\s*>\s*([^>]+)\s*\Z", payload) - for i in xrange(len(payload)): - if not firstspace: - if payload[i].isspace(): - firstspace = True - retVal += " " - continue - - elif payload[i] == '\'': - quote = not quote - - elif payload[i] == '"': - doublequote = not doublequote - - elif payload[i] == ">" and not doublequote and not quote: - retVal += " " if i > 0 and not payload[i - 1].isspace() else "" - retVal += "NOT BETWEEN %s AND" % ('0' if re.search(r"\A[^\w]*\d", payload[i + 1:]) else "NULL") - retVal += " " if i < len(payload) - 1 and not payload[i + 1:i + 2].isspace() else "" - - continue - - retVal += payload[i] + if match: + _ = "%s %s NOT BETWEEN 0 AND %s" % (match.group(2), match.group(4), match.group(5)) + retVal = retVal.replace(match.group(0), _) return retVal diff --git a/xml/queries.xml b/xml/queries.xml index 3a1b19f1b..c41243ace 100644 --- a/xml/queries.xml +++ b/xml/queries.xml @@ -19,7 +19,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -457,7 +457,7 @@ - + @@ -507,7 +507,7 @@ - + @@ -576,7 +576,7 @@ - +