mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 14:55:40 +00:00
Adding auto-between on > filtering
This commit is contained in:
parent
a7c63afdd8
commit
0cf4c641a1
2 changed files with 28 additions and 5 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue