Rewriting isHeavyQueryBased()

This commit is contained in:
Miroslav Stampar 2019-05-10 10:00:54 +02:00
parent 2efcded23b
commit 32076c5ca6
2 changed files with 10 additions and 6 deletions

View File

@ -3161,24 +3161,28 @@ def isTechniqueAvailable(technique):
else:
return getTechniqueData(technique) is not None
def isHeavyQueryBased():
def isHeavyQueryBased(technique=None):
"""
Returns True whether time-based or stacked payloads are based on heavy queries
Returns True whether current (kb.)technique is heavy-query based
>>> pushValue(kb.injection.data)
>>> kb.injection.data[PAYLOAD.TECHNIQUE.STACKED] = [test for test in getSortedInjectionTests() if "heavy" in test["title"].lower()][0]
>>> pushValue(kb.technique)
>>> kb.technique = PAYLOAD.TECHNIQUE.STACKED
>>> kb.injection.data[kb.technique] = [test for test in getSortedInjectionTests() if "heavy" in test["title"].lower()][0]
>>> isHeavyQueryBased()
True
>>> kb.technique = popValue()
>>> kb.injection.data = popValue()
"""
retVal = False
for technique in getPublicTypeMembers(PAYLOAD.TECHNIQUE, True):
technique = technique or kb.technique
if isTechniqueAvailable(technique):
data = getTechniqueData(technique)
if data and "heavy query" in data["title"].lower():
retVal = True
break
return retVal

View File

@ -18,7 +18,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.3.5.77"
VERSION = "1.3.5.78"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)