mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 16:24:25 +03:00
Minor bug fix for --search -C so that now if not columns are found (with criteria specified, e.g. -D testdb -T testtable), it won't ask to dump for the entries
This commit is contained in:
parent
e678219a8c
commit
7330dff255
|
@ -1093,7 +1093,7 @@ class Enumeration:
|
|||
condQuery = " AND (%s)" % " OR ".join(condQueryStr % (condition, unsafeSQLIdentificatorNaming(col)) for col in sorted(colList))
|
||||
|
||||
if colConsider == "1":
|
||||
infoMsg += "LIKE '%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList))
|
||||
infoMsg += "like '%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList))
|
||||
else:
|
||||
infoMsg += "'%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList))
|
||||
else:
|
||||
|
@ -1162,7 +1162,7 @@ class Enumeration:
|
|||
condQuery = " AND (%s)" % " OR ".join(condQueryStr % (condition, unsafeSQLIdentificatorNaming(col)) for col in sorted(colList))
|
||||
|
||||
if colConsider == "1":
|
||||
infoMsg += "LIKE '%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList))
|
||||
infoMsg += "like '%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList))
|
||||
else:
|
||||
infoMsg += "'%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList))
|
||||
else:
|
||||
|
@ -2199,13 +2199,6 @@ class Enumeration:
|
|||
if foundDb is None or foundTbl is None:
|
||||
continue
|
||||
|
||||
if foundDb not in dbs:
|
||||
dbs[foundDb] = {}
|
||||
|
||||
if foundTbl not in dbs[foundDb]:
|
||||
dbs[foundDb][foundTbl] = {}
|
||||
|
||||
if colConsider == "1":
|
||||
conf.db = foundDb
|
||||
conf.tbl = foundTbl
|
||||
conf.col = column
|
||||
|
@ -2213,10 +2206,15 @@ class Enumeration:
|
|||
self.getColumns(onlyColNames=True, colTuple=(colConsider, colCondParam), bruteForce=False)
|
||||
|
||||
if foundDb in kb.data.cachedColumns and foundTbl in kb.data.cachedColumns[foundDb]:
|
||||
if foundDb not in dbs:
|
||||
dbs[foundDb] = {}
|
||||
|
||||
if foundTbl not in dbs[foundDb]:
|
||||
dbs[foundDb][foundTbl] = {}
|
||||
|
||||
dbs[foundDb][foundTbl].update(kb.data.cachedColumns[foundDb][foundTbl])
|
||||
|
||||
kb.data.cachedColumns = {}
|
||||
else:
|
||||
dbs[foundDb][foundTbl][column] = None
|
||||
|
||||
if foundDb in foundCols[column]:
|
||||
foundCols[column][foundDb].append(foundTbl)
|
||||
|
@ -2263,7 +2261,6 @@ class Enumeration:
|
|||
foundCols[column][db] = []
|
||||
else:
|
||||
for db in conf.db.split(","):
|
||||
dbs[db] = {}
|
||||
if db not in foundCols[column]:
|
||||
foundCols[column][db] = []
|
||||
|
||||
|
@ -2307,10 +2304,6 @@ class Enumeration:
|
|||
|
||||
tbl = safeSQLIdentificatorNaming(tbl, True)
|
||||
|
||||
if tbl not in dbs[db]:
|
||||
dbs[db][tbl] = {}
|
||||
|
||||
if colConsider == "1":
|
||||
conf.db = db
|
||||
conf.tbl = tbl
|
||||
conf.col = column
|
||||
|
@ -2318,12 +2311,20 @@ class Enumeration:
|
|||
self.getColumns(onlyColNames=True, colTuple=(colConsider, colCondParam), bruteForce=False)
|
||||
|
||||
if db in kb.data.cachedColumns and tbl in kb.data.cachedColumns[db]:
|
||||
dbs[db][tbl].update(kb.data.cachedColumns[db][tbl])
|
||||
kb.data.cachedColumns = {}
|
||||
else:
|
||||
dbs[db][tbl][column] = None
|
||||
if db not in dbs:
|
||||
dbs[db] = {}
|
||||
|
||||
if tbl not in dbs[db]:
|
||||
dbs[db][tbl] = {}
|
||||
|
||||
dbs[db][tbl].update(kb.data.cachedColumns[db][tbl])
|
||||
|
||||
kb.data.cachedColumns = {}
|
||||
|
||||
if db in foundCols[column]:
|
||||
foundCols[column][db].append(tbl)
|
||||
else:
|
||||
foundCols[column][db] = [tbl]
|
||||
|
||||
self.dumpFoundColumn(dbs, foundCols, colConsider)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user