mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
proper handling of carriage return character from Windows target machines
This commit is contained in:
parent
ab33651f96
commit
2a8e270bef
|
@ -66,6 +66,7 @@ from lib.core.settings import SQLITE_ALIASES
|
||||||
from lib.core.settings import ACCESS_ALIASES
|
from lib.core.settings import ACCESS_ALIASES
|
||||||
from lib.core.settings import FIREBIRD_ALIASES
|
from lib.core.settings import FIREBIRD_ALIASES
|
||||||
from lib.core.settings import DUMP_NEWLINE_MARKER
|
from lib.core.settings import DUMP_NEWLINE_MARKER
|
||||||
|
from lib.core.settings import DUMP_CR_MARKER
|
||||||
from lib.core.settings import DUMP_DEL_MARKER
|
from lib.core.settings import DUMP_DEL_MARKER
|
||||||
from lib.core.settings import DUMP_TAB_MARKER
|
from lib.core.settings import DUMP_TAB_MARKER
|
||||||
from lib.core.settings import DUMP_START_MARKER
|
from lib.core.settings import DUMP_START_MARKER
|
||||||
|
@ -577,7 +578,7 @@ def replaceNewlineTabs(inpStr, stdout=False):
|
||||||
if stdout:
|
if stdout:
|
||||||
replacedString = inpStr.replace("\n", " ").replace("\r", " ").replace("\t", " ")
|
replacedString = inpStr.replace("\n", " ").replace("\r", " ").replace("\t", " ")
|
||||||
else:
|
else:
|
||||||
replacedString = inpStr.replace("\n", DUMP_NEWLINE_MARKER).replace("\r", " ").replace("\t", DUMP_TAB_MARKER)
|
replacedString = inpStr.replace("\n", DUMP_NEWLINE_MARKER).replace("\r", DUMP_CR_MARKER).replace("\t", DUMP_TAB_MARKER)
|
||||||
|
|
||||||
replacedString = replacedString.replace(kb.misc.delimiter, DUMP_DEL_MARKER)
|
replacedString = replacedString.replace(kb.misc.delimiter, DUMP_DEL_MARKER)
|
||||||
|
|
||||||
|
@ -587,7 +588,7 @@ def restoreDumpMarkedChars(inpStr, onlyNewlineTab=False):
|
||||||
replacedString = inpStr
|
replacedString = inpStr
|
||||||
|
|
||||||
if isinstance(replacedString, basestring):
|
if isinstance(replacedString, basestring):
|
||||||
replacedString = replacedString.replace(DUMP_NEWLINE_MARKER, "\n").replace(DUMP_TAB_MARKER, "\t")
|
replacedString = replacedString.replace(DUMP_NEWLINE_MARKER, "\n").replace(DUMP_CR_MARKER, "\r").replace(DUMP_TAB_MARKER, "\t")
|
||||||
|
|
||||||
if not onlyNewlineTab:
|
if not onlyNewlineTab:
|
||||||
replacedString = replacedString.replace(DUMP_START_MARKER, "").replace(DUMP_STOP_MARKER, "")
|
replacedString = replacedString.replace(DUMP_START_MARKER, "").replace(DUMP_STOP_MARKER, "")
|
||||||
|
|
|
@ -40,6 +40,7 @@ LOGGER.setLevel(logging.WARN)
|
||||||
|
|
||||||
# dump markers
|
# dump markers
|
||||||
DUMP_NEWLINE_MARKER = "__NEWLINE__"
|
DUMP_NEWLINE_MARKER = "__NEWLINE__"
|
||||||
|
DUMP_CR_MARKER = "__CARRIAGE_RETURN__"
|
||||||
DUMP_DEL_MARKER = "__DEL__"
|
DUMP_DEL_MARKER = "__DEL__"
|
||||||
DUMP_TAB_MARKER = "__TAB__"
|
DUMP_TAB_MARKER = "__TAB__"
|
||||||
DUMP_START_MARKER = "__START__"
|
DUMP_START_MARKER = "__START__"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user