mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-17 03:32:20 +03:00
Proper resume of --schema data when calling with --columns switch, minor fixes too
This commit is contained in:
parent
a23ca952e4
commit
f449688f93
|
@ -904,6 +904,9 @@ class Enumeration:
|
||||||
return kb.data.cachedTables
|
return kb.data.cachedTables
|
||||||
|
|
||||||
def getSchema(self):
|
def getSchema(self):
|
||||||
|
infoMsg = "enumerating database management system schema"
|
||||||
|
logger.info(infoMsg)
|
||||||
|
|
||||||
pushValue(conf.db)
|
pushValue(conf.db)
|
||||||
pushValue(conf.tbl)
|
pushValue(conf.tbl)
|
||||||
|
|
||||||
|
@ -934,20 +937,11 @@ class Enumeration:
|
||||||
def getColumns(self, onlyColNames=False):
|
def getColumns(self, onlyColNames=False):
|
||||||
bruteForce = False
|
bruteForce = False
|
||||||
|
|
||||||
if not conf.tbl:
|
if conf.tbl is not None and "." in conf.tbl:
|
||||||
warnMsg = "missing table parameter, sqlmap will enumerate "
|
|
||||||
warnMsg += "the whole database management system schema"
|
|
||||||
logger.warn(warnMsg)
|
|
||||||
|
|
||||||
return self.getSchema()
|
|
||||||
|
|
||||||
if "." in conf.tbl:
|
|
||||||
if not conf.db:
|
if not conf.db:
|
||||||
conf.db, conf.tbl = conf.tbl.split(".")
|
conf.db, conf.tbl = conf.tbl.split(".")
|
||||||
|
|
||||||
self.forceDbmsEnum()
|
if conf.tbl is not None and conf.db is None:
|
||||||
|
|
||||||
if not conf.db:
|
|
||||||
warnMsg = "missing database parameter, sqlmap is going to "
|
warnMsg = "missing database parameter, sqlmap is going to "
|
||||||
warnMsg += "use the current database to enumerate table "
|
warnMsg += "use the current database to enumerate table "
|
||||||
warnMsg += "'%s' columns" % conf.tbl
|
warnMsg += "'%s' columns" % conf.tbl
|
||||||
|
@ -955,6 +949,24 @@ class Enumeration:
|
||||||
|
|
||||||
conf.db = self.getCurrentDb()
|
conf.db = self.getCurrentDb()
|
||||||
|
|
||||||
|
self.forceDbmsEnum()
|
||||||
|
|
||||||
|
if kb.data.cachedColumns and conf.db in kb.data.cachedColumns \
|
||||||
|
and conf.tbl in kb.data.cachedColumns[conf.db]:
|
||||||
|
infoMsg = "fetching columns "
|
||||||
|
infoMsg += "for table '%s' " % conf.tbl
|
||||||
|
infoMsg += "on database '%s'" % conf.db
|
||||||
|
logger.info(infoMsg)
|
||||||
|
|
||||||
|
return { conf.db: kb.data.cachedColumns[conf.db]}
|
||||||
|
|
||||||
|
if not conf.tbl:
|
||||||
|
warnMsg = "missing table parameter, sqlmap will enumerate "
|
||||||
|
warnMsg += "the full database management system schema"
|
||||||
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
|
return self.getSchema()
|
||||||
|
|
||||||
if Backend.getIdentifiedDbms() == DBMS.MYSQL and not kb.data.has_information_schema:
|
if Backend.getIdentifiedDbms() == DBMS.MYSQL and not kb.data.has_information_schema:
|
||||||
errMsg = "information_schema not available, "
|
errMsg = "information_schema not available, "
|
||||||
errMsg += "back-end DBMS is MySQL < 5.0"
|
errMsg += "back-end DBMS is MySQL < 5.0"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user