From f305dde413afde13d64422a4e5425edeb4ecd22a Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 10 Nov 2012 11:01:29 +0100 Subject: [PATCH] Patch for an Issue #235 --- lib/core/option.py | 1 + lib/request/connect.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/core/option.py b/lib/core/option.py index 6d6e5ec5f..7b977e62c 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -835,6 +835,7 @@ def __setTamperingFunctions(): if name == "tamper" and function.func_code.co_argcount == 2: found = True kb.tamperFunctions.append(function) + function.func_name = module.__name__ if check_priority and priority > last_priority: message = "it seems that you might have mixed " diff --git a/lib/request/connect.py b/lib/request/connect.py index 9573781da..1f494997b 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -53,6 +53,7 @@ from lib.core.enums import REDIRECTION from lib.core.exception import sqlmapCompressionException from lib.core.exception import sqlmapConnectionException from lib.core.exception import sqlmapSyntaxException +from lib.core.exception import sqlmapValueException from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR from lib.core.settings import DEFAULT_CONTENT_TYPE from lib.core.settings import HTTP_ACCEPT_HEADER_VALUE @@ -588,6 +589,10 @@ class Connect: if kb.tamperFunctions: for function in kb.tamperFunctions: payload = function(payload=payload, headers=auxHeaders) + if not isinstance(payload, basestring): + errMsg = "tamper function '%s' returns " % function.func_name + errMsg += "invalid payload type ('%s')" % type(payload) + raise sqlmapValueException, errMsg value = agent.replacePayload(value, payload) @@ -722,6 +727,7 @@ class Connect: warnMsg += "value for option '--time-sec' as possible (e.g. " warnMsg += "%d or more)" % (conf.timeSec * 2) logger.critical(warnMsg) + elif not kb.testMode: warnMsg = "it is very important not to stress the network adapter's " warnMsg += "bandwidth during usage of time-based queries"