@@ -55,22 +55,28 @@ def stackedReadFile(self, rFile):
5555 length = inject .getValue ("SELECT LENGTH(%s) FROM %s" % (self .tblField , self .fileTblName ), unique = False , resumeValue = False , expected = EXPECTED .INT , charsetType = CHARSET_TYPE .DIGITS )
5656
5757 if not isNumPosStrValue (length ):
58- errMsg = "unable to retrieve the content of the "
59- errMsg += "file '%s'" % rFile
60- raise sqlmapNoneDataException , errMsg
61-
62- length = int (length )
63- sustrLen = 1024
58+ warnMsg = "unable to retrieve the content of the "
59+ warnMsg += "file '%s'" % rFile
60+
61+ if conf .direct or isTechniqueAvailable (PAYLOAD .TECHNIQUE .UNION ):
62+ warnMsg += ", going to fall-back to simpler technique"
63+ logger .warn (warnMsg )
64+ result = self .unionReadFile (rFile )
65+ else :
66+ raise sqlmapNoneDataException , warnMsg
67+ else :
68+ length = int (length )
69+ sustrLen = 1024
6470
65- if length > sustrLen :
66- result = []
71+ if length > sustrLen :
72+ result = []
6773
68- for i in xrange (1 , length , sustrLen ):
69- chunk = inject .getValue ("SELECT MID(%s, %d, %d) FROM %s" % (self .tblField , i , sustrLen , self .fileTblName ), unpack = False , unique = False , resumeValue = False , charsetType = CHARSET_TYPE .HEXADECIMAL )
74+ for i in xrange (1 , length , sustrLen ):
75+ chunk = inject .getValue ("SELECT MID(%s, %d, %d) FROM %s" % (self .tblField , i , sustrLen , self .fileTblName ), unpack = False , unique = False , resumeValue = False , charsetType = CHARSET_TYPE .HEXADECIMAL )
7076
71- result .append (chunk )
72- else :
73- result = inject .getValue ("SELECT %s FROM %s" % (self .tblField , self .fileTblName ), unique = False , resumeValue = False , charsetType = CHARSET_TYPE .HEXADECIMAL )
77+ result .append (chunk )
78+ else :
79+ result = inject .getValue ("SELECT %s FROM %s" % (self .tblField , self .fileTblName ), unique = False , resumeValue = False , charsetType = CHARSET_TYPE .HEXADECIMAL )
7480
7581 return result
7682
0 commit comments