mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-24 18:43:47 +03:00
minor bug fix
This commit is contained in:
parent
2ad267132a
commit
41ae9bc7ff
|
@ -84,6 +84,9 @@ Pierre Chifflier <pollux@debian.org> and Mark Hymers <ftpmaster@debian.org>
|
|||
Chris Clements <cclements@flatearth.net>
|
||||
for reporting a couple of bugs
|
||||
|
||||
John Cobb <johnc@nobytes.com>
|
||||
for reporting a minor bug
|
||||
|
||||
Andreas Constantinides <megahz@megahz.org>
|
||||
for reporting a minor bug
|
||||
|
||||
|
|
|
@ -2915,3 +2915,11 @@ def safeCSValue(value):
|
|||
retVal = '"%s"' % retVal.replace('"', '""')
|
||||
|
||||
return retVal
|
||||
|
||||
def filterPairValues(values):
|
||||
retVal = []
|
||||
|
||||
if not isNoneValue(values) and hasattr(values, '__iter__'):
|
||||
retVal = filter(lambda x: isinstance(x, (tuple, list, set)) and len(x) == 2, values)
|
||||
|
||||
return retVal
|
||||
|
|
|
@ -8,6 +8,7 @@ See the file 'doc/COPYING' for copying permission
|
|||
"""
|
||||
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import filterPairValues
|
||||
from lib.core.common import isTechniqueAvailable
|
||||
from lib.core.common import randomStr
|
||||
from lib.core.common import safeSQLIdentificatorNaming
|
||||
|
@ -232,7 +233,7 @@ class Enumeration(GenericEnumeration):
|
|||
table = {}
|
||||
columns = {}
|
||||
|
||||
for name, type_ in zip(retVal[0]["%s.name" % randStr], retVal[0]["%s.usertype" % randStr]):
|
||||
for name, type_ in filterPairValues(zip(retVal[0]["%s.name" % randStr], retVal[0]["%s.usertype" % randStr])):
|
||||
columns[name] = sybaseTypes.get(type_, type_)
|
||||
|
||||
table[safeSQLIdentificatorNaming(tbl)] = columns
|
||||
|
|
|
@ -16,10 +16,10 @@ from lib.core.common import Backend
|
|||
from lib.core.common import BigArray
|
||||
from lib.core.common import clearConsoleLine
|
||||
from lib.core.common import dataToStdout
|
||||
from lib.core.common import filterPairValues
|
||||
from lib.core.common import getRange
|
||||
from lib.core.common import getCompiledRegex
|
||||
from lib.core.common import getFileItems
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import isNoneValue
|
||||
from lib.core.common import isNumPosStrValue
|
||||
|
@ -272,7 +272,7 @@ class Enumeration:
|
|||
retVal = self.__pivotDumpTable("(%s) AS %s" % (query, randStr), ['%s.name' % randStr,'%s.password' % randStr], blind=False)
|
||||
|
||||
if retVal:
|
||||
for user, password in zip(retVal[0]["%s.name" % randStr], retVal[0]["%s.password" % randStr]):
|
||||
for user, password in filterPairValues(zip(retVal[0]["%s.name" % randStr], retVal[0]["%s.password" % randStr])):
|
||||
# password = "0x%s" % strToHex(password)
|
||||
if not kb.data.cachedUsersPasswords.has_key(user):
|
||||
kb.data.cachedUsersPasswords[user] = [password]
|
||||
|
@ -283,8 +283,7 @@ class Enumeration:
|
|||
else:
|
||||
value = inject.getValue(query, blind=False)
|
||||
|
||||
if not isNoneValue(value):
|
||||
for user, password in value:
|
||||
for user, password in filterPairValues(value):
|
||||
if not user or user == " ":
|
||||
continue
|
||||
|
||||
|
@ -315,7 +314,7 @@ class Enumeration:
|
|||
retVal = self.__pivotDumpTable("(%s) AS %s" % (query, randStr), ['%s.name' % randStr,'%s.password' % randStr], blind=True)
|
||||
|
||||
if retVal:
|
||||
for user, password in zip(retVal[0]["%s.name" % randStr], retVal[0]["%s.password" % randStr]):
|
||||
for user, password in filterPairValues(zip(retVal[0]["%s.name" % randStr], retVal[0]["%s.password" % randStr])):
|
||||
password = "0x%s" % strToHex(password)
|
||||
|
||||
if not kb.data.cachedUsersPasswords.has_key(user):
|
||||
|
@ -895,7 +894,7 @@ class Enumeration:
|
|||
if len(value) > 0 and not isinstance(value[0], (list, tuple)):
|
||||
value = zip([conf.db for i in xrange(len(value))], value)
|
||||
|
||||
for db, table in value:
|
||||
for db, table in filterPairValues(value):
|
||||
db = safeSQLIdentificatorNaming(db)
|
||||
table = safeSQLIdentificatorNaming(table, True)
|
||||
|
||||
|
@ -2031,9 +2030,7 @@ class Enumeration:
|
|||
query += exclDbsQuery
|
||||
values = inject.getValue(query, blind=False)
|
||||
|
||||
if not any([isNoneValue(values), isinstance(values, basestring)]):
|
||||
values = filter(lambda x: isinstance(x, (tuple, list, set)) and len(x) == 2, values)
|
||||
for foundDb, foundTbl in values:
|
||||
for foundDb, foundTbl in filterPairValues(values):
|
||||
foundDb = safeSQLIdentificatorNaming(foundDb)
|
||||
foundTbl = safeSQLIdentificatorNaming(foundTbl, True)
|
||||
|
||||
|
@ -2197,11 +2194,7 @@ class Enumeration:
|
|||
query += exclDbsQuery
|
||||
values = inject.getValue(query, blind=False)
|
||||
|
||||
if not isNoneValue(values):
|
||||
if isinstance(values, basestring):
|
||||
values = [ values ]
|
||||
|
||||
for foundDb, foundTbl in values:
|
||||
for foundDb, foundTbl in filterPairValues(values):
|
||||
foundDb = safeSQLIdentificatorNaming(foundDb)
|
||||
foundTbl = safeSQLIdentificatorNaming(foundTbl, True)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user