mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
added kb.cache for storing cached results (e.g. kb.cache.regex for storing compiled regular expressions and kb.cache.md5 for storing precalculated MD5 values during '--users --common-prediction' session)
This commit is contained in:
parent
b798222dd7
commit
0450df8a77
|
@ -76,8 +76,6 @@ from lib.core.settings import SQLITE_ALIASES
|
|||
from lib.core.settings import ACCESS_ALIASES
|
||||
from lib.core.settings import FIREBIRD_ALIASES
|
||||
|
||||
__compiledRegularExpressions = {}
|
||||
|
||||
def paramToDict(place, parameters=None):
|
||||
"""
|
||||
Split the parameters into names and values, check if these parameters
|
||||
|
@ -1305,14 +1303,11 @@ def getCompiledRegex(regex, *args):
|
|||
Returns compiled regular expression and stores it in cache for further
|
||||
usage
|
||||
"""
|
||||
|
||||
global __compiledRegularExpressions
|
||||
|
||||
if (regex, args) in __compiledRegularExpressions:
|
||||
return __compiledRegularExpressions[(regex, args)]
|
||||
if (regex, args) in kb.cache.regex:
|
||||
return kb.cache.regex[(regex, args)]
|
||||
else:
|
||||
retVal = re.compile(regex, *args)
|
||||
__compiledRegularExpressions[(regex, args)] = retVal
|
||||
kb.cache.regex[(regex, args)] = retVal
|
||||
return retVal
|
||||
|
||||
def getPartRun():
|
||||
|
|
|
@ -928,6 +928,11 @@ def __setKnowledgeBaseAttributes():
|
|||
|
||||
kb.absFilePaths = set()
|
||||
kb.bannerFp = advancedDict()
|
||||
|
||||
kb.cache = advancedDict()
|
||||
kb.cache.regex = {}
|
||||
kb.cache.md5 = {}
|
||||
|
||||
kb.commonOutputs = None
|
||||
kb.data = advancedDict()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user