|
23 | 23 | from lib.core.exception import sqlmapNoneDataException |
24 | 24 | from lib.core.settings import INFERENCE_UNKNOWN_CHAR |
25 | 25 | from lib.core.settings import MAX_INT |
| 26 | +from lib.core.unescaper import unescaper |
26 | 27 | from lib.request import inject |
27 | 28 |
|
28 | 29 | def pivotDumpTable(table, colList, count=None, blind=True): |
@@ -101,23 +102,17 @@ def pivotDumpTable(table, colList, count=None, blind=True): |
101 | 102 |
|
102 | 103 | for column in colList: |
103 | 104 | def _(pivotValue): |
104 | | - # Correction for pivotValues with unrecognized/problematic chars |
105 | | - for char in (INFERENCE_UNKNOWN_CHAR, '\''): |
106 | | - if pivotValue and char in pivotValue and pivotValue[0] != char: |
107 | | - pivotValue = pivotValue.split(char)[0] |
108 | | - pivotValue = pivotValue[:-1] + decodeIntToUnicode(ord(pivotValue[-1]) + 1) |
109 | | - break |
110 | 105 | if column == colList[0]: |
111 | | - query = dumpNode.query % (column, table, column, pivotValue) |
| 106 | + query = dumpNode.query.replace("'%s'", "%s") % (column, table, column, unescaper.unescape(pivotValue, False)) |
112 | 107 | else: |
113 | | - query = dumpNode.query2 % (column, table, colList[0], pivotValue) |
| 108 | + query = dumpNode.query2.replace("'%s'", "%s") % (column, table, colList[0], unescaper.unescape(pivotValue, False)) |
114 | 109 |
|
115 | 110 | return unArrayizeValue(inject.getValue(query, blind=blind, time=blind, union=not blind, error=not blind)) |
116 | 111 |
|
117 | 112 | value = _(pivotValue) |
118 | 113 | if column == colList[0]: |
119 | 114 | if isNoneValue(value): |
120 | | - for pivotValue in filter(None, (" " if pivotValue == " " else None, "%s%s" % (pivotValue[0], chr(ord(pivotValue[1]) + 1)) if len(pivotValue) > 1 else None, chr(ord(pivotValue[0]) + 1))): |
| 115 | + for pivotValue in filter(None, (" " if pivotValue == " " else None, "%s%s" % (pivotValue[0], unichr(ord(pivotValue[1]) + 1)) if len(pivotValue) > 1 else None, unichr(ord(pivotValue[0]) + 1))): |
121 | 116 | value = _(pivotValue) |
122 | 117 | if not isNoneValue(value): |
123 | 118 | break |
|
0 commit comments