File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1833,3 +1833,8 @@ def initTechnique(technique=None):
18331833 warnMsg = "there is no injection data available for technique "
18341834 warnMsg += "'%s'" % enumValueToNameLookup (PAYLOAD .TECHNIQUE , technique )
18351835 logger .warn (warnMsg )
1836+
1837+ def arrayizeValue (value ):
1838+ if not isinstance (value , list ):
1839+ value = [value ]
1840+ return value
Original file line number Diff line number Diff line change 88"""
99
1010from lib .core .agent import agent
11+ from lib .core .common import arrayizeValue
1112from lib .core .common import getRange
1213from lib .core .common import isNumPosStrValue
1314from lib .core .data import conf
@@ -63,7 +64,7 @@ def getTables(self):
6364 value = inject .getValue (query , blind = False , error = False )
6465
6566 if value :
66- kb .data .cachedTables [db ] = value
67+ kb .data .cachedTables [db ] = arrayizeValue ( value )
6768
6869 if not kb .data .cachedTables and not conf .direct :
6970 for db in dbs :
Original file line number Diff line number Diff line change 1111import time
1212
1313from lib .core .agent import agent
14+ from lib .core .common import arrayizeValue
1415from lib .core .common import dataToStdout
1516from lib .core .common import getRange
1617from lib .core .common import getCompiledRegex
@@ -158,7 +159,7 @@ def getUsers(self):
158159 value = inject .getValue (query , blind = False , error = False )
159160
160161 if value :
161- kb .data .cachedUsers = value
162+ kb .data .cachedUsers = arrayizeValue ( value )
162163
163164 if not kb .data .cachedUsers and not conf .direct :
164165 infoMsg = "fetching number of database users"
@@ -684,10 +685,7 @@ def getDbs(self):
684685 value = inject .getValue (query , blind = False , error = False )
685686
686687 if value :
687- if isinstance (value , basestring ):
688- kb .data .cachedDbs = [value ]
689- else :
690- kb .data .cachedDbs = value
688+ kb .data .cachedDbs = arrayizeValue (value )
691689
692690 if not kb .data .cachedDbs and not conf .direct :
693691 infoMsg = "fetching number of databases"
You can’t perform that action at this time.
0 commit comments