|
33 | 33 | from lib.core.exception import sqlmapThreadException |
34 | 34 | from lib.core.exception import unhandledException |
35 | 35 | from lib.core.progress import ProgressBar |
| 36 | +from lib.core.settings import CHAR_INFERENCE_MARK |
36 | 37 | from lib.core.unescaper import unescaper |
37 | 38 | from lib.request.connect import Connect as Request |
38 | 39 |
|
@@ -141,7 +142,7 @@ def getChar(idx, charTbl=asciiTbl, continuousOrder=True, expand=charsetType is N |
141 | 142 | continuousOrder means that distance between each two neighbour's |
142 | 143 | numerical values is exactly 1 |
143 | 144 | """ |
144 | | - |
| 145 | + |
145 | 146 | result = tryHint(idx) |
146 | 147 |
|
147 | 148 | if result: |
@@ -170,18 +171,14 @@ def getChar(idx, charTbl=asciiTbl, continuousOrder=True, expand=charsetType is N |
170 | 171 | position = (len(charTbl) >> 1) |
171 | 172 | posValue = charTbl[position] |
172 | 173 |
|
173 | | - if dbms in (DBMS.SQLITE, DBMS.MAXDB): |
174 | | - pushValue(posValue) |
175 | | - posValue = chr(posValue) if posValue < 128 else unichr(posValue) |
176 | | - |
177 | | - forgedPayload = safeStringFormat(payload, (expressionUnescaped, idx, posValue)) |
| 174 | + if CHAR_INFERENCE_MARK not in payload: |
| 175 | + forgedPayload = safeStringFormat(payload, (expressionUnescaped, idx, posValue)) |
| 176 | + else: |
| 177 | + forgedPayload = safeStringFormat(payload, (expressionUnescaped, idx)).replace(CHAR_INFERENCE_MARK, chr(posValue) if posValue < 128 else unichr(posValue)) |
178 | 178 |
|
179 | 179 | queriesCount[0] += 1 |
180 | 180 | result = Request.queryPage(forgedPayload, timeBasedCompare=timeBasedCompare) |
181 | 181 |
|
182 | | - if dbms in (DBMS.SQLITE, DBMS.MAXDB): |
183 | | - posValue = popValue() |
184 | | - |
185 | 182 | if result: |
186 | 183 | minValue = posValue |
187 | 184 |
|
|
0 commit comments