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

Method dumpTable

plugins/generic/entries.py:63–480  ·  view source on GitHub ↗
(self, foundData=None)

Source from the content-addressed store, hash-verified

61 pass
62
63 def dumpTable(self, foundData=None):
64 self.forceDbmsEnum()
65
66 if conf.db is None or conf.db == CURRENT_DB:
67 if conf.db is None:
68 warnMsg = "missing database parameter. sqlmap is going "
69 warnMsg += "to use the current database to enumerate "
70 warnMsg += "table(s) entries"
71 logger.warning(warnMsg)
72
73 conf.db = self.getCurrentDb()
74
75 elif conf.db is not None:
76 if Backend.getIdentifiedDbms() in UPPER_CASE_DBMSES:
77 conf.db = conf.db.upper()
78
79 if ',' in conf.db:
80 errMsg = "only one database name is allowed when enumerating "
81 errMsg += "the tables' columns"
82 raise SqlmapMissingMandatoryOptionException(errMsg)
83
84 if conf.exclude and re.search(conf.exclude, conf.db, re.I) is not None:
85 infoMsg = "skipping database '%s'" % unsafeSQLIdentificatorNaming(conf.db)
86 singleTimeLogMessage(infoMsg)
87 return
88
89 conf.db = safeSQLIdentificatorNaming(conf.db) or ""
90
91 if conf.tbl:
92 if Backend.getIdentifiedDbms() in UPPER_CASE_DBMSES:
93 conf.tbl = conf.tbl.upper()
94
95 tblList = conf.tbl.split(',')
96 else:
97 self.getTables()
98
99 if len(kb.data.cachedTables) > 0:
100 tblList = list(six.itervalues(kb.data.cachedTables))
101
102 if tblList and isListLike(tblList[0]):
103 tblList = tblList[0]
104 elif conf.db and not conf.search:
105 errMsg = "unable to retrieve the tables "
106 errMsg += "in database '%s'" % unsafeSQLIdentificatorNaming(conf.db)
107 raise SqlmapNoneDataException(errMsg)
108 else:
109 return
110
111 for tbl in tblList:
112 tblList[tblList.index(tbl)] = safeSQLIdentificatorNaming(tbl, True)
113
114 for tbl in tblList:
115 if kb.dumpKeyboardInterrupt:
116 break
117
118 if conf.exclude and re.search(conf.exclude, unsafeSQLIdentificatorNaming(tbl), re.I) is not None:
119 infoMsg = "skipping table '%s'" % unsafeSQLIdentificatorNaming(tbl)
120 singleTimeLogMessage(infoMsg)

Callers 4

dumpAllMethod · 0.95
dumpFoundColumnMethod · 0.95
dumpFoundTablesMethod · 0.95
actionFunction · 0.80

Calls 15

appendMethod · 0.95
singleTimeLogMessageFunction · 0.90
isListLikeFunction · 0.90
isTechniqueAvailableFunction · 0.90
singleTimeWarnMessageFunction · 0.90
isNumPosStrValueFunction · 0.90
getLimitRangeFunction · 0.90
isNoneValueFunction · 0.90

Tested by

no test coverage detected