From 0cf4c641a1c3d3657a0fb97d49eb01b881f482da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0tampar?= Date: Tue, 21 Jul 2026 13:16:40 +0200 Subject: [PATCH] Adding auto-between on > filtering --- lib/controller/checks.py | 31 +++++++++++++++++++++++++++---- lib/core/settings.py | 2 +- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index f7c9d5e31..473e5719b 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -1061,10 +1061,33 @@ def checkFilteredChars(injection): # inference techniques depend on character '>' if not any(_ in injection.data for _ in (PAYLOAD.TECHNIQUE.ERROR, PAYLOAD.TECHNIQUE.UNION, PAYLOAD.TECHNIQUE.QUERY)): if not checkBooleanExpression("%d>%d" % (randInt + 1, randInt)): - warnMsg = "it appears that the character '>' is " - warnMsg += "filtered by the back-end server. You are strongly " - warnMsg += "advised to rerun with the '--tamper=between'" - logger.warning(warnMsg) + # '>' is filtered - blind inference bisection (e.g. ASCII(...)>N) would silently + # retrieve nothing. Auto-apply the 'between' tamper (> -> NOT BETWEEN 0 AND, SQL + # standard, all DBMS) and re-verify, so the run adapts in place instead of forcing a + # manual rerun. Skipped when the user chose their own '--tamper' (respect that choice). + adapted = False + + if not conf.tamper: + from lib.utils.wafbypass import loadTamper + function = loadTamper("between") + + if function is not None and function not in (kb.tamperFunctions or []): + kb.tamperFunctions = (kb.tamperFunctions or []) + [function] + _ = randomInt() + + if checkBooleanExpression("%d>%d" % (_ + 1, _)): + adapted = True + infoMsg = "the character '>' appears to be filtered by the back-end " + infoMsg += "server; sqlmap automatically applied the 'between' tamper script to adapt" + logger.info(infoMsg) + else: + kb.tamperFunctions.remove(function) + + if not adapted: + warnMsg = "it appears that the character '>' is " + warnMsg += "filtered by the back-end server. You are strongly " + warnMsg += "advised to rerun with the '--tamper=between'" + logger.warning(warnMsg) kb.injection = popValue() diff --git a/lib/core/settings.py b/lib/core/settings.py index b62afba26..d042eda90 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.10.7.167" +VERSION = "1.10.7.168" 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)