mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-07 01:03:43 +03:00
foundation for filtering binary string values (for example, replacement of non readable chars with #)
This commit is contained in:
parent
aa81ed4033
commit
c83e9f6ca5
|
@ -1806,7 +1806,7 @@ def removeDynamicContent(page):
|
||||||
|
|
||||||
return page
|
return page
|
||||||
|
|
||||||
def filterStringValue(value, regex):
|
def filterStringValue(value, regex, replace=None):
|
||||||
"""
|
"""
|
||||||
Returns string value consisting only
|
Returns string value consisting only
|
||||||
of chars satisfying supplied regular
|
of chars satisfying supplied regular
|
||||||
|
@ -1818,6 +1818,8 @@ def filterStringValue(value, regex):
|
||||||
for char in value:
|
for char in value:
|
||||||
if re.search(regex, char):
|
if re.search(regex, char):
|
||||||
retVal += char
|
retVal += char
|
||||||
|
elif replace:
|
||||||
|
retVal += replace
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ DUMP_STOP_MARKER = "__STOP__"
|
||||||
|
|
||||||
PAYLOAD_DELIMITER = "\x00"
|
PAYLOAD_DELIMITER = "\x00"
|
||||||
CHAR_INFERENCE_MARK = "%c"
|
CHAR_INFERENCE_MARK = "%c"
|
||||||
|
READABLE_CHAR_REGEX = r'[\ -~]'
|
||||||
|
|
||||||
# coefficient used for a time-based query delay checking (must be >= 7)
|
# coefficient used for a time-based query delay checking (must be >= 7)
|
||||||
TIME_STDEV_COEFF = 10
|
TIME_STDEV_COEFF = 10
|
||||||
|
|
Loading…
Reference in New Issue
Block a user