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

Skip to content

Commit ea4cef9

Browse files
committed
Skipping quit exception in case of --search
1 parent e19b097 commit ea4cef9

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

plugins/dbms/mssqlserver/enumeration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def getTables(self):
152152
warnMsg += "for database '%s'" % db
153153
logger.warn(warnMsg)
154154

155-
if not kb.data.cachedTables:
155+
if not kb.data.cachedTables and not conf.search:
156156
errMsg = "unable to retrieve the tables for any database"
157157
raise SqlmapNoneDataException(errMsg)
158158
else:

plugins/generic/databases.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def getTables(self, bruteForce=None):
358358
if bruteForce is None:
359359
logger.error(errMsg)
360360
return self.getTables(bruteForce=True)
361-
else:
361+
elif not conf.search:
362362
raise SqlmapNoneDataException(errMsg)
363363
else:
364364
for db, tables in kb.data.cachedTables.items():
@@ -432,10 +432,12 @@ def getColumns(self, onlyColNames=False, colTuple=None, bruteForce=None, dumpMod
432432
tblList = tblList[0]
433433

434434
tblList = list(tblList)
435-
else:
435+
elif not conf.search:
436436
errMsg = "unable to retrieve the tables "
437437
errMsg += "in database '%s'" % unsafeSQLIdentificatorNaming(conf.db)
438438
raise SqlmapNoneDataException(errMsg)
439+
else:
440+
return kb.data.cachedColumns
439441

440442
tblList = filter(None, (safeSQLIdentificatorNaming(_, True) for _ in tblList))
441443

plugins/generic/entries.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ def dumpTable(self, foundData=None):
8989

9090
if isinstance(tblList[0], (set, tuple, list)):
9191
tblList = tblList[0]
92-
else:
92+
elif not conf.search:
9393
errMsg = "unable to retrieve the tables "
9494
errMsg += "in database '%s'" % unsafeSQLIdentificatorNaming(conf.db)
9595
raise SqlmapNoneDataException(errMsg)
96+
else:
97+
return
9698

9799
for tbl in tblList:
98100
tblList[tblList.index(tbl)] = safeSQLIdentificatorNaming(tbl, True)

0 commit comments

Comments
 (0)