mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 00:04:23 +03:00
Fixes #1299
This commit is contained in:
parent
fdc8e664df
commit
1aafe85a3a
|
@ -872,7 +872,7 @@ def dataToOutFile(filename, data):
|
||||||
retVal = os.path.join(conf.filePath, filePathToSafeString(filename))
|
retVal = os.path.join(conf.filePath, filePathToSafeString(filename))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with openFile(retVal, "wb") as f:
|
with open(retVal, "w+b") as f:
|
||||||
f.write(data)
|
f.write(data)
|
||||||
except IOError, ex:
|
except IOError, ex:
|
||||||
errMsg = "something went wrong while trying to write "
|
errMsg = "something went wrong while trying to write "
|
||||||
|
@ -3714,7 +3714,7 @@ def applyFunctionRecursively(value, function):
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
def decodeHexValue(value):
|
def decodeHexValue(value, raw=False):
|
||||||
"""
|
"""
|
||||||
Returns value decoded from DBMS specific hexadecimal representation
|
Returns value decoded from DBMS specific hexadecimal representation
|
||||||
|
|
||||||
|
@ -3729,7 +3729,7 @@ def decodeHexValue(value):
|
||||||
if value and isinstance(value, basestring) and len(value) % 2 == 0:
|
if value and isinstance(value, basestring) and len(value) % 2 == 0:
|
||||||
retVal = hexdecode(retVal)
|
retVal = hexdecode(retVal)
|
||||||
|
|
||||||
if not kb.binaryField:
|
if not kb.binaryField and not raw:
|
||||||
if Backend.isDbms(DBMS.MSSQL) and value.startswith("0x"):
|
if Backend.isDbms(DBMS.MSSQL) and value.startswith("0x"):
|
||||||
try:
|
try:
|
||||||
retVal = retVal.decode("utf-16-le")
|
retVal = retVal.decode("utf-16-le")
|
||||||
|
|
|
@ -232,7 +232,7 @@ class Filesystem:
|
||||||
fileContent = newFileContent
|
fileContent = newFileContent
|
||||||
|
|
||||||
if fileContent is not None:
|
if fileContent is not None:
|
||||||
fileContent = decodeHexValue(fileContent)
|
fileContent = decodeHexValue(fileContent, True)
|
||||||
|
|
||||||
if fileContent:
|
if fileContent:
|
||||||
localFilePath = dataToOutFile(remoteFile, fileContent)
|
localFilePath = dataToOutFile(remoteFile, fileContent)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user