MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / getTables

Method getTables

plugins/generic/databases.py:213–464  ·  view source on GitHub ↗
(self, bruteForce=None)

Source from the content-addressed store, hash-verified

211 return kb.data.cachedDbs
212
213 def getTables(self, bruteForce=None):
214 if len(kb.data.cachedTables) > 0:
215 return kb.data.cachedTables
216
217 self.forceDbmsEnum()
218
219 if bruteForce is None:
220 if Backend.isDbms(DBMS.MYSQL) and not kb.data.has_information_schema:
221 warnMsg = "information_schema not available, "
222 warnMsg += "back-end DBMS is MySQL < 5.0"
223 logger.warning(warnMsg)
224 bruteForce = True
225
226 elif Backend.getIdentifiedDbms() in (DBMS.MCKOI, DBMS.EXTREMEDB, DBMS.RAIMA):
227 bruteForce = True
228
229 elif Backend.getIdentifiedDbms() in (DBMS.ACCESS,):
230 try:
231 tables = self.getTables(False)
232 except SqlmapNoneDataException:
233 tables = None
234
235 if not tables:
236 warnMsg = "cannot retrieve table names, "
237 warnMsg += "back-end DBMS is %s" % Backend.getIdentifiedDbms()
238 logger.warning(warnMsg)
239 bruteForce = True
240 else:
241 return tables
242
243 if conf.db == CURRENT_DB:
244 conf.db = self.getCurrentDb()
245
246 if conf.db and Backend.getIdentifiedDbms() in UPPER_CASE_DBMSES:
247 conf.db = conf.db.upper()
248
249 if conf.db:
250 dbs = conf.db.split(',')
251 else:
252 dbs = self.getDbs()
253
254 dbs = [_ for _ in dbs if _ and _.strip()]
255
256 for db in dbs:
257 dbs[dbs.index(db)] = safeSQLIdentificatorNaming(db)
258
259 if bruteForce:
260 resumeAvailable = False
261
262 for db, table in kb.brute.tables:
263 if db == conf.db:
264 resumeAvailable = True
265 break
266
267 if resumeAvailable and not conf.freshQueries:
268 for db, table in kb.brute.tables:
269 if db == conf.db:
270 if conf.db not in kb.data.cachedTables:

Callers 6

getColumnsMethod · 0.95
getSchemaMethod · 0.95
getCountMethod · 0.95
actionFunction · 0.45
dumpTableMethod · 0.45
dumpAllMethod · 0.45

Calls 15

getCurrentDbMethod · 0.95
getDbsMethod · 0.95
readInputFunction · 0.90
tableExistsFunction · 0.90
unArrayizeValueFunction · 0.90
isTechniqueAvailableFunction · 0.90
isNoneValueFunction · 0.90
arrayizeValueFunction · 0.90
isListLikeFunction · 0.90
filterPairValuesFunction · 0.90

Tested by

no test coverage detected