|
33 | 33 | from lib.core.enums import PLACE |
34 | 34 | from lib.core.enums import POST_HINT |
35 | 35 | from lib.core.exception import SqlmapNoneDataException |
| 36 | +from lib.core.settings import BOUNDARY_BACKSLASH_MARKER |
36 | 37 | from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR |
37 | 38 | from lib.core.settings import DEFAULT_COOKIE_DELIMITER |
38 | 39 | from lib.core.settings import DEFAULT_GET_POST_DELIMITER |
@@ -187,6 +188,9 @@ def _(pattern, repl, string): |
187 | 188 | if retVal == paramString and urlencode(parameter) != parameter: |
188 | 189 | retVal = _(r"(\A|\b)%s=%s" % (re.escape(urlencode(parameter)), re.escape(origValue)), "%s=%s" % (urlencode(parameter), self.addPayloadDelimiters(newValue.replace("\\", "\\\\"))), paramString) |
189 | 190 |
|
| 191 | + if retVal: |
| 192 | + retVal = retVal.replace(BOUNDARY_BACKSLASH_MARKER, '\\') |
| 193 | + |
190 | 194 | return retVal |
191 | 195 |
|
192 | 196 | def fullPayload(self, query): |
@@ -237,7 +241,7 @@ def prefixQuery(self, expression, prefix=None, where=None, clause=None): |
237 | 241 | if not (expression and expression[0] == ';') and not (query and query[-1] in ('(', ')') and expression and expression[0] in ('(', ')')) and not (query and query[-1] == '('): |
238 | 242 | query += " " |
239 | 243 |
|
240 | | - query = "%s%s" % (query, expression) |
| 244 | + query = "%s%s" % (query.replace('\\', BOUNDARY_BACKSLASH_MARKER), expression) |
241 | 245 |
|
242 | 246 | return query |
243 | 247 |
|
@@ -271,7 +275,7 @@ def suffixQuery(self, expression, comment=None, suffix=None, where=None): |
271 | 275 | pass |
272 | 276 |
|
273 | 277 | elif suffix and not comment: |
274 | | - expression += suffix |
| 278 | + expression += suffix.replace('\\', BOUNDARY_BACKSLASH_MARKER) |
275 | 279 |
|
276 | 280 | return re.sub(r"(?s);\W*;", ";", expression) |
277 | 281 |
|
|
0 commit comments