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

Skip to content

Commit f305dde

Browse files
committed
Patch for an Issue #235
1 parent 181c353 commit f305dde

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ def __setTamperingFunctions():
835835
if name == "tamper" and function.func_code.co_argcount == 2:
836836
found = True
837837
kb.tamperFunctions.append(function)
838+
function.func_name = module.__name__
838839

839840
if check_priority and priority > last_priority:
840841
message = "it seems that you might have mixed "

lib/request/connect.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
from lib.core.exception import sqlmapCompressionException
5454
from lib.core.exception import sqlmapConnectionException
5555
from lib.core.exception import sqlmapSyntaxException
56+
from lib.core.exception import sqlmapValueException
5657
from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR
5758
from lib.core.settings import DEFAULT_CONTENT_TYPE
5859
from lib.core.settings import HTTP_ACCEPT_HEADER_VALUE
@@ -588,6 +589,10 @@ def queryPage(value=None, place=None, content=False, getRatioValue=False, silent
588589
if kb.tamperFunctions:
589590
for function in kb.tamperFunctions:
590591
payload = function(payload=payload, headers=auxHeaders)
592+
if not isinstance(payload, basestring):
593+
errMsg = "tamper function '%s' returns " % function.func_name
594+
errMsg += "invalid payload type ('%s')" % type(payload)
595+
raise sqlmapValueException, errMsg
591596

592597
value = agent.replacePayload(value, payload)
593598

@@ -722,6 +727,7 @@ def _randomizeParameter(paramString, randomParameter):
722727
warnMsg += "value for option '--time-sec' as possible (e.g. "
723728
warnMsg += "%d or more)" % (conf.timeSec * 2)
724729
logger.critical(warnMsg)
730+
725731
elif not kb.testMode:
726732
warnMsg = "it is very important not to stress the network adapter's "
727733
warnMsg += "bandwidth during usage of time-based queries"

0 commit comments

Comments
 (0)