mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
Minor enhancement to be able to dump entries also on MySQL < 5.0 when DB name, table name and column(s) are provided
This commit is contained in:
parent
2fcbb57e1c
commit
342a5436f4
|
@ -784,11 +784,6 @@ class Enumeration:
|
||||||
|
|
||||||
|
|
||||||
def dumpTable(self):
|
def dumpTable(self):
|
||||||
if kb.dbms == "MySQL" and not self.has_information_schema:
|
|
||||||
errMsg = "information_schema not available, "
|
|
||||||
errMsg += "back-end DBMS is MySQL < 5.0"
|
|
||||||
raise sqlmapUnsupportedFeatureException, errMsg
|
|
||||||
|
|
||||||
if not conf.tbl:
|
if not conf.tbl:
|
||||||
errMsg = "missing table parameter"
|
errMsg = "missing table parameter"
|
||||||
raise sqlmapMissingMandatoryOptionException, errMsg
|
raise sqlmapMissingMandatoryOptionException, errMsg
|
||||||
|
@ -804,6 +799,23 @@ class Enumeration:
|
||||||
|
|
||||||
rootQuery = queries[kb.dbms].dumpTable
|
rootQuery = queries[kb.dbms].dumpTable
|
||||||
|
|
||||||
|
if conf.col:
|
||||||
|
self.cachedColumns[conf.db] = {}
|
||||||
|
self.cachedColumns[conf.db][conf.tbl] = {}
|
||||||
|
for column in colList:
|
||||||
|
self.cachedColumns[conf.db][conf.tbl][column] = None
|
||||||
|
elif not self.cachedColumns:
|
||||||
|
if kb.dbms == "MySQL" and not self.has_information_schema:
|
||||||
|
errMsg = "information_schema not available, "
|
||||||
|
errMsg += "back-end DBMS is MySQL < 5.0"
|
||||||
|
raise sqlmapUnsupportedFeatureException, errMsg
|
||||||
|
|
||||||
|
self.cachedColumns = self.getColumns(onlyColNames=True)
|
||||||
|
|
||||||
|
colList = self.cachedColumns[conf.db][conf.tbl].keys()
|
||||||
|
colList.sort(key=lambda x: x.lower())
|
||||||
|
colString = ", ".join(column for column in colList)
|
||||||
|
|
||||||
logMsg = "fetching"
|
logMsg = "fetching"
|
||||||
if conf.col:
|
if conf.col:
|
||||||
colList = conf.col.split(",")
|
colList = conf.col.split(",")
|
||||||
|
@ -813,18 +825,6 @@ class Enumeration:
|
||||||
logMsg += " on database '%s'" % conf.db
|
logMsg += " on database '%s'" % conf.db
|
||||||
logger.info(logMsg)
|
logger.info(logMsg)
|
||||||
|
|
||||||
if conf.col:
|
|
||||||
self.cachedColumns[conf.db] = {}
|
|
||||||
self.cachedColumns[conf.db][conf.tbl] = {}
|
|
||||||
for column in colList:
|
|
||||||
self.cachedColumns[conf.db][conf.tbl][column] = None
|
|
||||||
elif not self.cachedColumns:
|
|
||||||
self.cachedColumns = self.getColumns(onlyColNames=True)
|
|
||||||
|
|
||||||
colList = self.cachedColumns[conf.db][conf.tbl].keys()
|
|
||||||
colList.sort(key=lambda x: x.lower())
|
|
||||||
colString = ", ".join(column for column in colList)
|
|
||||||
|
|
||||||
if conf.unionUse:
|
if conf.unionUse:
|
||||||
if kb.dbms == "Oracle":
|
if kb.dbms == "Oracle":
|
||||||
query = rootQuery["inband"]["query"] % (colString, conf.tbl.upper())
|
query = rootQuery["inband"]["query"] % (colString, conf.tbl.upper())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user