mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 06:01:29 +00:00
Fixes (old) Informix escaping
This commit is contained in:
@@ -80,6 +80,10 @@ class Fingerprint(GenericFingerprint):
|
||||
|
||||
return False
|
||||
|
||||
# Determine if it is Informix >= 11.70
|
||||
if inject.checkBooleanExpression("CHR(32)=' '"):
|
||||
Backend.setVersion(">= 11.70")
|
||||
|
||||
setDbms(DBMS.INFORMIX)
|
||||
|
||||
self.getBanner()
|
||||
|
||||
@@ -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