Falling back to unionReadFile() when --file-read does not work against MySQL. This happens when the session user does not have INSERT privilege, required to run LOAD DATA INFILE

This commit is contained in:
Bernardo Damele 2012-04-19 14:05:45 +00:00
parent 2b1b4c0742
commit 072e08836f

View File

@ -55,10 +55,16 @@ class Filesystem(GenericFilesystem):
length = inject.getValue("SELECT LENGTH(%s) FROM %s" % (self.tblField, self.fileTblName), unique=False, resumeValue=False, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS) length = inject.getValue("SELECT LENGTH(%s) FROM %s" % (self.tblField, self.fileTblName), unique=False, resumeValue=False, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS)
if not isNumPosStrValue(length): if not isNumPosStrValue(length):
errMsg = "unable to retrieve the content of the " warnMsg = "unable to retrieve the content of the "
errMsg += "file '%s'" % rFile warnMsg += "file '%s'" % rFile
raise sqlmapNoneDataException, errMsg
if conf.direct or isTechniqueAvailable(PAYLOAD.TECHNIQUE.UNION):
warnMsg += ", going to fall-back to simpler technique"
logger.warn(warnMsg)
result = self.unionReadFile(rFile)
else:
raise sqlmapNoneDataException, warnMsg
else:
length = int(length) length = int(length)
sustrLen = 1024 sustrLen = 1024