mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 20:51:31 +00:00
Fixes (old) Informix escaping
This commit is contained in:
@@ -7,6 +7,7 @@ See the file 'LICENSE' for copying permission
|
||||
|
||||
import re
|
||||
|
||||
from lib.core.common import isDBMSVersionAtLeast
|
||||
from lib.core.common import randomStr
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
@@ -24,14 +25,17 @@ class Syntax(GenericSyntax):
|
||||
def escaper(value):
|
||||
return "||".join("CHR(%d)" % ord(_) for _ in value)
|
||||
|
||||
excluded = {}
|
||||
for _ in re.findall(r"DBINFO\([^)]+\)", expression):
|
||||
excluded[_] = randomStr()
|
||||
expression = expression.replace(_, excluded[_])
|
||||
retVal = expression
|
||||
|
||||
retVal = Syntax._escape(expression, quote, escaper)
|
||||
if isDBMSVersionAtLeast("11.70"):
|
||||
excluded = {}
|
||||
for _ in re.findall(r"DBINFO\([^)]+\)", expression):
|
||||
excluded[_] = randomStr()
|
||||
expression = expression.replace(_, excluded[_])
|
||||
|
||||
for _ in excluded.items():
|
||||
retVal = retVal.replace(_[1], _[0])
|
||||
retVal = Syntax._escape(expression, quote, escaper)
|
||||
|
||||
for _ in excluded.items():
|
||||
retVal = retVal.replace(_[1], _[0])
|
||||
|
||||
return retVal
|
||||
Reference in New Issue
Block a user