Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 32076c5

Browse files
committed
Rewriting isHeavyQueryBased()
1 parent 2efcded commit 32076c5

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

lib/core/common.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3161,24 +3161,28 @@ def isTechniqueAvailable(technique):
31613161
else:
31623162
return getTechniqueData(technique) is not None
31633163

3164-
def isHeavyQueryBased():
3164+
def isHeavyQueryBased(technique=None):
31653165
"""
3166-
Returns True whether time-based or stacked payloads are based on heavy queries
3166+
Returns True whether current (kb.)technique is heavy-query based
31673167
31683168
>>> pushValue(kb.injection.data)
3169-
>>> kb.injection.data[PAYLOAD.TECHNIQUE.STACKED] = [test for test in getSortedInjectionTests() if "heavy" in test["title"].lower()][0]
3169+
>>> pushValue(kb.technique)
3170+
>>> kb.technique = PAYLOAD.TECHNIQUE.STACKED
3171+
>>> kb.injection.data[kb.technique] = [test for test in getSortedInjectionTests() if "heavy" in test["title"].lower()][0]
31703172
>>> isHeavyQueryBased()
31713173
True
3174+
>>> kb.technique = popValue()
31723175
>>> kb.injection.data = popValue()
31733176
"""
31743177

31753178
retVal = False
31763179

3177-
for technique in getPublicTypeMembers(PAYLOAD.TECHNIQUE, True):
3180+
technique = technique or kb.technique
3181+
3182+
if isTechniqueAvailable(technique):
31783183
data = getTechniqueData(technique)
31793184
if data and "heavy query" in data["title"].lower():
31803185
retVal = True
3181-
break
31823186

31833187
return retVal
31843188

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty import six
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.5.77"
21+
VERSION = "1.3.5.78"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

0 commit comments

Comments
 (0)