continuousOrder means that distance between each two neighbour's numerical values is exactly 1
(idx, charTbl=None, continuousOrder=True, expand=charsetType is None, shiftTable=None, retried=None)
| 265 | return result |
| 266 | |
| 267 | def getChar(idx, charTbl=None, continuousOrder=True, expand=charsetType is None, shiftTable=None, retried=None): |
| 268 | """ |
| 269 | continuousOrder means that distance between each two neighbour's |
| 270 | numerical values is exactly 1 |
| 271 | """ |
| 272 | |
| 273 | threadData = getCurrentThreadData() |
| 274 | |
| 275 | result = tryHint(idx) |
| 276 | |
| 277 | if result: |
| 278 | return result |
| 279 | |
| 280 | if charTbl is None: |
| 281 | charTbl = type(asciiTbl)(asciiTbl) |
| 282 | |
| 283 | originalTbl = type(charTbl)(charTbl) |
| 284 | |
| 285 | if kb.disableShiftTable: |
| 286 | shiftTable = None |
| 287 | elif continuousOrder and shiftTable is None: |
| 288 | # Used for gradual expanding into unicode charspace |
| 289 | shiftTable = [2, 2, 3, 3, 3] |
| 290 | |
| 291 | if "'%s'" % CHAR_INFERENCE_MARK in payload: |
| 292 | for char in ('\n', '\r'): |
| 293 | if ord(char) in charTbl: |
| 294 | if not isinstance(charTbl, list): |
| 295 | charTbl = list(charTbl) |
| 296 | charTbl.remove(ord(char)) |
| 297 | |
| 298 | if not charTbl: |
| 299 | return None |
| 300 | |
| 301 | elif len(charTbl) == 1: |
| 302 | forgedPayload = safeStringFormat(payload.replace(INFERENCE_GREATER_CHAR, INFERENCE_EQUALS_CHAR), (expressionUnescaped, idx, charTbl[0])) |
| 303 | result = Request.queryPage(forgedPayload, timeBasedCompare=timeBasedCompare, raise404=False) |
| 304 | incrementCounter(getTechnique()) |
| 305 | |
| 306 | if result: |
| 307 | return decodeIntToUnicode(charTbl[0]) |
| 308 | else: |
| 309 | return None |
| 310 | |
| 311 | maxChar = maxValue = charTbl[-1] |
| 312 | minValue = charTbl[0] |
| 313 | firstCheck = False |
| 314 | lastCheck = False |
| 315 | unexpectedCode = False |
| 316 | |
| 317 | if continuousOrder: |
| 318 | while len(charTbl) > 1: |
| 319 | position = None |
| 320 | |
| 321 | if charsetType is None: |
| 322 | if not firstCheck: |
| 323 | try: |
| 324 | try: |
no test coverage detected
searching dependent graphs…