Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit edb977a

Browse files
committed
bug fix so that if search fails with union/error and blind techniques are available, it falls back to them (like any other enumeration switch) and minor bug fix so that in search mode, the provided table name to search is upped
1 parent 11413a0 commit edb977a

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

plugins/generic/search.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ def searchDb(self):
9191
for value in values:
9292
value = safeSQLIdentificatorNaming(value)
9393
foundDbs.append(value)
94-
else:
94+
95+
if len(foundDbs) == 0 and isInferenceAvailable() and not conf.direct:
9596
infoMsg = "fetching number of database"
9697
if dbConsider == "1":
9798
infoMsg += "s like"
@@ -166,7 +167,7 @@ def searchTable(self):
166167
for tbl in tblList:
167168
tbl = safeSQLIdentificatorNaming(tbl, True)
168169

169-
if Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2):
170+
if Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2, DBMS.FIREBIRD):
170171
tbl = tbl.upper()
171172

172173
infoMsg = "searching table"
@@ -194,7 +195,7 @@ def searchTable(self):
194195
query += whereDbsQuery
195196
values = inject.getValue(query, blind=False, time=False)
196197

197-
if Backend.getIdentifiedDbms() in (DBMS.SQLITE, DBMS.FIREBIRD):
198+
if values and Backend.getIdentifiedDbms() in (DBMS.SQLITE, DBMS.FIREBIRD):
198199
newValues = []
199200

200201
if isinstance(values, basestring):
@@ -216,7 +217,8 @@ def searchTable(self):
216217
foundTbls[foundDb].append(foundTbl)
217218
else:
218219
foundTbls[foundDb] = [foundTbl]
219-
else:
220+
221+
if len(foundTbls) == 0 and isInferenceAvailable() and not conf.direct:
220222
if Backend.getIdentifiedDbms() not in (DBMS.SQLITE, DBMS.FIREBIRD):
221223
infoMsg = "fetching number of databases with table"
222224
if tblConsider == "1":
@@ -445,7 +447,8 @@ def searchColumn(self):
445447
foundCols[column][db] = [tbl]
446448

447449
kb.data.cachedColumns = {}
448-
else:
450+
451+
if len(dbs) == 0 and isInferenceAvailable() and not conf.direct:
449452
if not conf.db:
450453
infoMsg = "fetching number of databases with tables containing column"
451454
if colConsider == "1":

0 commit comments

Comments
 (0)