From ed1b5d0ada805dce68fc3e73ba802667ead5f607 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 7 Dec 2012 10:57:57 +0100 Subject: [PATCH] Minor fix --- plugins/generic/filesystem.py | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/plugins/generic/filesystem.py b/plugins/generic/filesystem.py index d4914e7fd..f976c5188 100644 --- a/plugins/generic/filesystem.py +++ b/plugins/generic/filesystem.py @@ -11,6 +11,7 @@ import os from lib.core.agent import agent from lib.core.common import dataToOutFile from lib.core.common import Backend +from lib.core.common import decodeHexValue from lib.core.common import isNumPosStrValue from lib.core.common import isListLike from lib.core.common import isTechniqueAvailable @@ -36,23 +37,6 @@ class Filesystem: self.fileTblName = "sqlmapfile" self.tblField = "data" - def _unhexString(self, hexStr): - if len(hexStr) % 2 != 0: - errMsg = "for some reason(s) sqlmap retrieved an odd-length " - errMsg += "hexadecimal string which it is not able to convert " - errMsg += "to raw string" - logger.error(errMsg) - - return hexStr - - try: - cleanStr = hexdecode(hexStr) - except TypeError, e: - logger.critical("unable to unhex the string ('%s')" % e) - return None - - return cleanStr - def _checkWrittenFile(self, wFile, dFile, fileType): if Backend.isDbms(DBMS.MYSQL): lengthQuery = "SELECT LENGTH(LOAD_FILE('%s'))" % dFile @@ -211,7 +195,7 @@ class Filesystem: kb.fileReadMode = False - if fileContent in ( None, "" ) and not Backend.isDbms(DBMS.PGSQL): + if fileContent in (None, "") and not Backend.isDbms(DBMS.PGSQL): self.cleanup(onlyFileTbl=True) return @@ -230,7 +214,7 @@ class Filesystem: fileContent = newFileContent - fileContent = self._unhexString(fileContent) + fileContent = decodeHexValue(fileContent) rFilePath = dataToOutFile(fileContent) if not Backend.isDbms(DBMS.PGSQL):