Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed1b5d0

Browse files
committed
Minor fix
1 parent b5c8707 commit ed1b5d0

1 file changed

Lines changed: 3 additions & 19 deletions

File tree

plugins/generic/filesystem.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from lib.core.agent import agent
1212
from lib.core.common import dataToOutFile
1313
from lib.core.common import Backend
14+
from lib.core.common import decodeHexValue
1415
from lib.core.common import isNumPosStrValue
1516
from lib.core.common import isListLike
1617
from lib.core.common import isTechniqueAvailable
@@ -36,23 +37,6 @@ def __init__(self):
3637
self.fileTblName = "sqlmapfile"
3738
self.tblField = "data"
3839

39-
def _unhexString(self, hexStr):
40-
if len(hexStr) % 2 != 0:
41-
errMsg = "for some reason(s) sqlmap retrieved an odd-length "
42-
errMsg += "hexadecimal string which it is not able to convert "
43-
errMsg += "to raw string"
44-
logger.error(errMsg)
45-
46-
return hexStr
47-
48-
try:
49-
cleanStr = hexdecode(hexStr)
50-
except TypeError, e:
51-
logger.critical("unable to unhex the string ('%s')" % e)
52-
return None
53-
54-
return cleanStr
55-
5640
def _checkWrittenFile(self, wFile, dFile, fileType):
5741
if Backend.isDbms(DBMS.MYSQL):
5842
lengthQuery = "SELECT LENGTH(LOAD_FILE('%s'))" % dFile
@@ -211,7 +195,7 @@ def readFile(self, rFile):
211195

212196
kb.fileReadMode = False
213197

214-
if fileContent in ( None, "" ) and not Backend.isDbms(DBMS.PGSQL):
198+
if fileContent in (None, "") and not Backend.isDbms(DBMS.PGSQL):
215199
self.cleanup(onlyFileTbl=True)
216200

217201
return
@@ -230,7 +214,7 @@ def readFile(self, rFile):
230214

231215
fileContent = newFileContent
232216

233-
fileContent = self._unhexString(fileContent)
217+
fileContent = decodeHexValue(fileContent)
234218
rFilePath = dataToOutFile(fileContent)
235219

236220
if not Backend.isDbms(DBMS.PGSQL):

0 commit comments

Comments
 (0)