diff --git a/lib/core/settings.py b/lib/core/settings.py index 984ab7cb6..951a45d9f 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.3.7.19" +VERSION = "1.3.7.20" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/plugins/generic/filesystem.py b/plugins/generic/filesystem.py index 8d672e167..f622a0dfd 100644 --- a/plugins/generic/filesystem.py +++ b/plugins/generic/filesystem.py @@ -21,6 +21,8 @@ from lib.core.common import isStackingAvailable from lib.core.common import isTechniqueAvailable from lib.core.common import readInput from lib.core.compat import xrange +from lib.core.convert import encodeBase64 +from lib.core.convert import encodeHex from lib.core.convert import getText from lib.core.convert import getUnicode from lib.core.data import conf @@ -134,8 +136,14 @@ class Filesystem(object): def fileContentEncode(self, content, encoding, single, chunkSize=256): retVal = [] - if encoding: - content = getText(codecs.encode(content, encoding)).replace("\n", "") + if encoding == "hex": + content = encodeHex(content) + elif encoding == "base64": + content = encodeBase64(content) + else: + content = codecs.encode(content, encoding) + + content = getText(content).replace("\n", "") if not single: if len(content) > chunkSize: