mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-21 14:02:49 +03:00
implemented feature request from Ole Rasmussen regarding table name retrieval speedup
This commit is contained in:
parent
1ab78ce60e
commit
17554759b7
|
@ -920,6 +920,7 @@ def __setKnowledgeBaseAttributes():
|
||||||
kb.injParameter = None
|
kb.injParameter = None
|
||||||
kb.injPlace = None
|
kb.injPlace = None
|
||||||
kb.injType = None
|
kb.injType = None
|
||||||
|
kb.hintValue = None
|
||||||
|
|
||||||
# Back-end DBMS underlying operating system fingerprint via banner (-b)
|
# Back-end DBMS underlying operating system fingerprint via banner (-b)
|
||||||
# parsing
|
# parsing
|
||||||
|
|
|
@ -114,7 +114,31 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||||
|
|
||||||
queriesCount = [0] # As list to deal with nested scoping rules
|
queriesCount = [0] # As list to deal with nested scoping rules
|
||||||
|
|
||||||
|
hintlock = threading.Lock()
|
||||||
|
def tryHint(idx):
|
||||||
|
hintlock.acquire()
|
||||||
|
hintValue = kb.hintValue
|
||||||
|
hintlock.release()
|
||||||
|
if hintValue and len(hintValue) >= idx:
|
||||||
|
if kb.dbms == "SQLite":
|
||||||
|
posValue = hintValue[idx-1]
|
||||||
|
else:
|
||||||
|
posValue = ord(hintValue[idx-1])
|
||||||
|
|
||||||
|
forgedPayload = safeStringFormat(payload.replace('%3E', '%3D'), (expressionUnescaped, idx, posValue))
|
||||||
|
result = Request.queryPage(urlencode(forgedPayload))
|
||||||
|
if result:
|
||||||
|
return hintValue[idx-1]
|
||||||
|
hintlock.acquire()
|
||||||
|
kb.hintValue = None
|
||||||
|
hintlock.release()
|
||||||
|
return None
|
||||||
|
|
||||||
def getChar(idx, asciiTbl=asciiTbl):
|
def getChar(idx, asciiTbl=asciiTbl):
|
||||||
|
result = tryHint(idx)
|
||||||
|
if result:
|
||||||
|
return result
|
||||||
|
|
||||||
maxValue = asciiTbl[len(asciiTbl)-1]
|
maxValue = asciiTbl[len(asciiTbl)-1]
|
||||||
minValue = 0
|
minValue = 0
|
||||||
|
|
||||||
|
|
|
@ -783,6 +783,7 @@ class Enumeration:
|
||||||
query = rootQuery["blind"]["query"] % (db, index)
|
query = rootQuery["blind"]["query"] % (db, index)
|
||||||
table = inject.getValue(query, inband=False)
|
table = inject.getValue(query, inband=False)
|
||||||
tables.append(table)
|
tables.append(table)
|
||||||
|
kb.hintValue = table
|
||||||
|
|
||||||
if tables:
|
if tables:
|
||||||
kb.data.cachedTables[db] = tables
|
kb.data.cachedTables[db] = tables
|
||||||
|
|
Loading…
Reference in New Issue
Block a user