From c62b0f7e68939854a4d7d8514f6fca2117ef0f8f Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 28 May 2015 23:49:44 +0200 Subject: [PATCH] New tamper script --- tamper/symboliclogical.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tamper/symboliclogical.py diff --git a/tamper/symboliclogical.py b/tamper/symboliclogical.py new file mode 100644 index 000000000..a14198748 --- /dev/null +++ b/tamper/symboliclogical.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +""" +Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) +See the file 'doc/COPYING' for copying permission +""" + +import re + +from lib.core.enums import PRIORITY + +__priority__ = PRIORITY.LOWEST + +def dependencies(): + pass + +def tamper(payload, **kwargs): + """ + Replaces AND and OR logical operators with their symbolic counterparts (&& and ||) + + >>> tamper("1 AND '1'='1") + '1 && '1'='1' + """ + + retVal = payload + + if payload: + retVal = re.sub(r"(?i)\bAND\b", "&&", re.sub(r"(?i)\bOR\b", "||", payload)) + + return retVal