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

Skip to content

Commit d37be5f

Browse files
committed
Fix for an Issue #248
1 parent 9a54a91 commit d37be5f

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/core/agent.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from lib.core.enums import PLACE
2929
from lib.core.enums import POST_HINT
3030
from lib.core.exception import sqlmapNoneDataException
31+
from lib.core.settings import ASTERISK_MARKER
3132
from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR
3233
from lib.core.settings import GENERIC_SQL_COMMENT
3334
from lib.core.settings import PAYLOAD_DELIMITER
@@ -116,7 +117,9 @@ def payload(self, place=None, parameter=None, value=None, newValue=None, where=N
116117
_ = "%s%s" % (origValue, CUSTOM_INJECTION_MARK_CHAR)
117118
if kb.postHint == POST_HINT.JSON and not isNumber(newValue) and not '"%s"' % _ in paramString:
118119
newValue = '"%s"' % newValue
119-
retVal = paramString.replace(_, self.addPayloadDelimiters(newValue)).replace(CUSTOM_INJECTION_MARK_CHAR, "")
120+
newValue = newValue.replace(CUSTOM_INJECTION_MARK_CHAR, ASTERISK_MARKER)
121+
retVal = paramString.replace(_, self.addPayloadDelimiters(newValue))
122+
retVal = retVal.replace(CUSTOM_INJECTION_MARK_CHAR, "").replace(ASTERISK_MARKER, CUSTOM_INJECTION_MARK_CHAR)
120123
elif place in (PLACE.USER_AGENT, PLACE.REFERER, PLACE.HOST):
121124
retVal = paramString.replace(origValue, self.addPayloadDelimiters(newValue))
122125
else:

lib/core/settings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@
3636
# Markers for special cases when parameter values contain html encoded characters
3737
PARAMETER_AMP_MARKER = "__AMP__"
3838
PARAMETER_SEMICOLON_MARKER = "__SEMICOLON__"
39-
4039
PARTIAL_VALUE_MARKER = "__PARTIAL__"
41-
4240
URI_QUESTION_MARKER = "__QUESTION_MARK__"
41+
ASTERISK_MARKER = "__ASTERISK_MARK__"
4342

4443
PAYLOAD_DELIMITER = "\x00"
4544
CHAR_INFERENCE_MARK = "%c"

0 commit comments

Comments
 (0)