mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Update for column types (Issue #552)
This commit is contained in:
@@ -32,6 +32,7 @@ from lib.core.data import logger
|
||||
from lib.core.data import paths
|
||||
from lib.core.data import queries
|
||||
from lib.core.dicts import FIREBIRD_TYPES
|
||||
from lib.core.dicts import INFORMIX_TYPES
|
||||
from lib.core.enums import CHARSET_TYPE
|
||||
from lib.core.enums import DBMS
|
||||
from lib.core.enums import EXPECTED
|
||||
@@ -603,8 +604,17 @@ class Databases:
|
||||
if len(columnData) == 1:
|
||||
columns[name] = None
|
||||
else:
|
||||
key = int(columnData[1]) if isinstance(columnData[1], basestring) and columnData[1].isdigit() else columnData[1]
|
||||
if Backend.isDbms(DBMS.FIREBIRD):
|
||||
columnData[1] = FIREBIRD_TYPES.get(int(columnData[1]) if isinstance(columnData[1], basestring) and columnData[1].isdigit() else columnData[1], columnData[1])
|
||||
columnData[1] = FIREBIRD_TYPES.get(key, columnData[1])
|
||||
elif Backend.isDbms(DBMS.INFORMIX):
|
||||
notNull = False
|
||||
if isinstance(key, int) and key > 255:
|
||||
key -= 256
|
||||
notNull = True
|
||||
columnData[1] = INFORMIX_TYPES.get(key, columnData[1])
|
||||
if notNull:
|
||||
columnData[1] = "%s NOT NULL" % columnData[1]
|
||||
|
||||
columns[name] = columnData[1]
|
||||
|
||||
@@ -752,11 +762,22 @@ class Databases:
|
||||
conf.db, conf.db, unsafeSQLIdentificatorNaming(tbl).split(".")[-1])
|
||||
elif Backend.isDbms(DBMS.FIREBIRD):
|
||||
query = rootQuery.blind.query2 % (tbl, column)
|
||||
elif Backend.isDbms(DBMS.INFORMIX):
|
||||
query = rootQuery.blind.query2 % (conf.db, conf.db, conf.db, conf.db, conf.db, tbl, column)
|
||||
|
||||
colType = unArrayizeValue(inject.getValue(query, union=False, error=False))
|
||||
|
||||
key = int(colType) if isinstance(colType, basestring) and colType.isdigit() else colType
|
||||
if Backend.isDbms(DBMS.FIREBIRD):
|
||||
colType = FIREBIRD_TYPES.get(colType, colType)
|
||||
colType = FIREBIRD_TYPES.get(key, colType)
|
||||
elif Backend.isDbms(DBMS.INFORMIX):
|
||||
notNull = False
|
||||
if isinstance(key, int) and key > 255:
|
||||
key -= 256
|
||||
notNull = True
|
||||
colType = INFORMIX_TYPES.get(key, colType)
|
||||
if notNull:
|
||||
colType = "%s NOT NULL" % colType
|
||||
|
||||
column = safeSQLIdentificatorNaming(column)
|
||||
columns[column] = colType
|
||||
|
||||
Reference in New Issue
Block a user