mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 01:26:42 +03:00
some more refactoring
This commit is contained in:
parent
8e4b8d345f
commit
b2dad63000
|
@ -2581,7 +2581,7 @@ def arrayizeValue(value):
|
|||
itself
|
||||
"""
|
||||
|
||||
if not isinstance(value, (list, tuple, set)):
|
||||
if not isinstance(value, (list, tuple)):
|
||||
value = [ value ]
|
||||
|
||||
return value
|
||||
|
@ -2592,7 +2592,7 @@ def unArrayizeValue(value):
|
|||
itself
|
||||
"""
|
||||
|
||||
if isinstance(value, (list, tuple, set)):
|
||||
if isinstance(value, (list, tuple)):
|
||||
value = value[0] if len(value) > 0 else None
|
||||
|
||||
return value
|
||||
|
|
|
@ -11,6 +11,7 @@ from lib.core.common import Backend
|
|||
from lib.core.common import isTechniqueAvailable
|
||||
from lib.core.common import randomStr
|
||||
from lib.core.common import safeSQLIdentificatorNaming
|
||||
from lib.core.common import unArrayizeValue
|
||||
from lib.core.common import unsafeSQLIdentificatorNaming
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
|
@ -77,8 +78,7 @@ class Enumeration(GenericEnumeration):
|
|||
rootQuery = queries[Backend.getIdentifiedDbms()].tables
|
||||
|
||||
for db in dbs:
|
||||
if isinstance(db, (tuple, list)):
|
||||
db = db[0] if db else ""
|
||||
db = unArrayizeValue(db)
|
||||
|
||||
randStr = randomStr()
|
||||
query = rootQuery.inband.query % (("'%s'" % db) if db != "USER" else 'USER')
|
||||
|
|
|
@ -16,6 +16,7 @@ from lib.core.common import isNoneValue
|
|||
from lib.core.common import isNumPosStrValue
|
||||
from lib.core.common import isTechniqueAvailable
|
||||
from lib.core.common import safeSQLIdentificatorNaming
|
||||
from lib.core.common import unArrayizeValue
|
||||
from lib.core.common import unsafeSQLIdentificatorNaming
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
|
@ -88,8 +89,7 @@ class Enumeration(GenericEnumeration):
|
|||
|
||||
if any(isTechniqueAvailable(_) for _ in (PAYLOAD.TECHNIQUE.UNION, PAYLOAD.TECHNIQUE.ERROR)) or conf.direct:
|
||||
for db in dbs:
|
||||
if isinstance(db, (tuple, list)):
|
||||
db = db[0] if db else ""
|
||||
db = unArrayizeValue(db)
|
||||
|
||||
if conf.excludeSysDbs and db in self.excludeDbsList:
|
||||
infoMsg = "skipping system database '%s'" % db
|
||||
|
|
|
@ -12,6 +12,7 @@ from lib.core.common import filterPairValues
|
|||
from lib.core.common import isTechniqueAvailable
|
||||
from lib.core.common import randomStr
|
||||
from lib.core.common import safeSQLIdentificatorNaming
|
||||
from lib.core.common import unArrayizeValue
|
||||
from lib.core.common import unsafeSQLIdentificatorNaming
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
|
@ -138,8 +139,7 @@ class Enumeration(GenericEnumeration):
|
|||
rootQuery = queries[Backend.getIdentifiedDbms()].tables
|
||||
|
||||
for db in dbs:
|
||||
if isinstance(db, (tuple, list)):
|
||||
db = db[0] if db else ""
|
||||
db = unArrayizeValue(db)
|
||||
|
||||
for blind in blinds:
|
||||
randStr = randomStr()
|
||||
|
|
|
@ -897,10 +897,7 @@ class Enumeration:
|
|||
value = map(lambda x: (dbs[0], x), value)
|
||||
|
||||
for db, table in filterPairValues(value):
|
||||
if isinstance(db, (tuple, list)):
|
||||
db = db[0] if db else ""
|
||||
|
||||
db = safeSQLIdentificatorNaming(db)
|
||||
db = safeSQLIdentificatorNaming(unArrayizeValue(db))
|
||||
table = safeSQLIdentificatorNaming(table, True)
|
||||
|
||||
if not kb.data.cachedTables.has_key(db):
|
||||
|
|
Loading…
Reference in New Issue
Block a user