mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-03-03 19:55:47 +03:00
added two new functions: isBase64EncodedString and isHexEncodedString for Feature #71
This commit is contained in:
parent
5a6a01f24c
commit
8bab94de64
|
@ -913,8 +913,8 @@ def safeStringFormat(formatStr, params):
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
def sanitizeAsciiString(string):
|
def sanitizeAsciiString(subject):
|
||||||
return "".join(char if ord(char) < 128 else '?' for char in string)
|
return "".join(char if ord(char) < 128 else '?' for char in subject)
|
||||||
|
|
||||||
def decloakToNamedTemporaryFile(filepath, name=None):
|
def decloakToNamedTemporaryFile(filepath, name=None):
|
||||||
retVal = NamedTemporaryFile()
|
retVal = NamedTemporaryFile()
|
||||||
|
@ -952,3 +952,9 @@ def posixToNtSlashes(filepath):
|
||||||
|
|
||||||
def ntToPosixSlashes(filepath):
|
def ntToPosixSlashes(filepath):
|
||||||
return filepath.replace('\\', '/')
|
return filepath.replace('\\', '/')
|
||||||
|
|
||||||
|
def isBase64EncodedString(subject):
|
||||||
|
return re.match(r"\A(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\Z", subject) is not None
|
||||||
|
|
||||||
|
def isHexEncodedString(subject):
|
||||||
|
return re.match(r"\A[0-9a-fA-F]+\Z", subject) is not None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user