mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-08-02 03:10:12 +03:00
fixed some issues with dotted database-,table- and colum-names
This commit is contained in:
parent
03df419fd6
commit
90b9c4d0d5
|
@ -1353,6 +1353,8 @@ class Enumeration:
|
||||||
def __tableGetCount(self, db, table):
|
def __tableGetCount(self, db, table):
|
||||||
if Backend.isDbms(DBMS.DB2):
|
if Backend.isDbms(DBMS.DB2):
|
||||||
query = "SELECT %s FROM %s.%s--" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(db.upper()), safeSQLIdentificatorNaming(table.upper(), True))
|
query = "SELECT %s FROM %s.%s--" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(db.upper()), safeSQLIdentificatorNaming(table.upper(), True))
|
||||||
|
elif Backend.isDbms(DBMS.MYSQL):
|
||||||
|
query = "SELECT %s FROM `%s`.`%s`" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(db), safeSQLIdentificatorNaming(table, True))
|
||||||
else:
|
else:
|
||||||
query = "SELECT %s FROM %s.%s" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(db), safeSQLIdentificatorNaming(table, True))
|
query = "SELECT %s FROM %s.%s" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(db), safeSQLIdentificatorNaming(table, True))
|
||||||
|
|
||||||
|
@ -1578,7 +1580,7 @@ class Enumeration:
|
||||||
kb.data.cachedColumns = foundData
|
kb.data.cachedColumns = foundData
|
||||||
|
|
||||||
try:
|
try:
|
||||||
kb.dumpTable = "%s.%s" % (conf.db, tbl)
|
kb.dumpTable = "`%s`.`%s`" % (conf.db, tbl)
|
||||||
|
|
||||||
if not safeSQLIdentificatorNaming(conf.db) in kb.data.cachedColumns \
|
if not safeSQLIdentificatorNaming(conf.db) in kb.data.cachedColumns \
|
||||||
or safeSQLIdentificatorNaming(tbl, True) not in \
|
or safeSQLIdentificatorNaming(tbl, True) not in \
|
||||||
|
@ -1617,7 +1619,7 @@ class Enumeration:
|
||||||
# Partial inband and error
|
# Partial inband and error
|
||||||
if not (isTechniqueAvailable(PAYLOAD.TECHNIQUE.UNION) and kb.injection.data[PAYLOAD.TECHNIQUE.UNION].where == PAYLOAD.WHERE.ORIGINAL):
|
if not (isTechniqueAvailable(PAYLOAD.TECHNIQUE.UNION) and kb.injection.data[PAYLOAD.TECHNIQUE.UNION].where == PAYLOAD.WHERE.ORIGINAL):
|
||||||
table = "%s.%s" % (conf.db, tbl)
|
table = "%s.%s" % (conf.db, tbl)
|
||||||
|
|
||||||
retVal = self.__pivotDumpTable(table, colList, blind=False)
|
retVal = self.__pivotDumpTable(table, colList, blind=False)
|
||||||
|
|
||||||
if retVal:
|
if retVal:
|
||||||
|
@ -1628,8 +1630,12 @@ class Enumeration:
|
||||||
elif Backend.getIdentifiedDbms() in (DBMS.PGSQL):
|
elif Backend.getIdentifiedDbms() in (DBMS.PGSQL):
|
||||||
query = rootQuery.inband.query % (colString, conf.db, tbl, prioritySortColumns(colList)[0])
|
query = rootQuery.inband.query % (colString, conf.db, tbl, prioritySortColumns(colList)[0])
|
||||||
elif Backend.getIdentifiedDbms() in (DBMS.MYSQL):
|
elif Backend.getIdentifiedDbms() in (DBMS.MYSQL):
|
||||||
colString = '`%s`' % colString
|
newColString = ""
|
||||||
query = rootQuery.inband.query % (colString, conf.db, tbl, prioritySortColumns(colList)[0])
|
for (index, column) in enumerate(colString.split(',')):
|
||||||
|
newColString = "`%s`, %s" % (column.replace(" ", ""), newColString)
|
||||||
|
newColString = newColString[:-2]
|
||||||
|
|
||||||
|
query = rootQuery.inband.query % (newColString, conf.db, tbl, prioritySortColumns(colList)[0])
|
||||||
else:
|
else:
|
||||||
query = rootQuery.inband.query % (colString, conf.db, tbl)
|
query = rootQuery.inband.query % (colString, conf.db, tbl)
|
||||||
|
|
||||||
|
@ -1687,7 +1693,7 @@ class Enumeration:
|
||||||
else:
|
else:
|
||||||
query = rootQuery.blind.count % (conf.db, tbl)
|
query = rootQuery.blind.count % (conf.db, tbl)
|
||||||
count = inject.getValue(query, inband=False, error=False, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS)
|
count = inject.getValue(query, inband=False, error=False, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS)
|
||||||
|
|
||||||
lengths = {}
|
lengths = {}
|
||||||
entries = {}
|
entries = {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user