This commit is contained in:
Miroslav Stampar 2010-12-09 17:10:22 +00:00
parent 0eb2c408a9
commit bbffea2cbc
10 changed files with 12 additions and 23 deletions

View File

@ -7,16 +7,14 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
See the file 'doc/COPYING' for copying permission See the file 'doc/COPYING' for copying permission
""" """
from lib.core.data import kb
from lib.core.datatype import advancedDict from lib.core.datatype import advancedDict
class Unescaper(advancedDict): class Unescaper(advancedDict):
def __init__(self): def __init__(self):
self.__unescaper = None pass
def setUnescape(self, unescapeFunction):
self.__unescaper = unescapeFunction
def unescape(self, expression, quote=True): def unescape(self, expression, quote=True):
return self.__unescaper(expression, quote=quote) return self[kb.dbms if kb.dbms else kb.misc.testedDbms](expression, quote=quote)
unescaper = Unescaper() unescaper = Unescaper()

View File

@ -33,5 +33,4 @@ class AccessMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, Tak
Miscellaneous.__init__(self) Miscellaneous.__init__(self)
Takeover.__init__(self) Takeover.__init__(self)
unescaper[DBMS.ACCESS] = AccessMap.unescape unescaper[DBMS.ACCESS] = Syntax.unescape
unescaper.setUnescape(AccessMap.unescape)

View File

@ -33,5 +33,4 @@ class FirebirdMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, T
Miscellaneous.__init__(self) Miscellaneous.__init__(self)
Takeover.__init__(self) Takeover.__init__(self)
unescaper[DBMS.FIREBIRD] = FirebirdMap.unescape unescaper[DBMS.FIREBIRD] = Syntax.unescape
unescaper.setUnescape(FirebirdMap.unescape)

View File

@ -33,5 +33,4 @@ class MaxDBMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, Take
Miscellaneous.__init__(self) Miscellaneous.__init__(self)
Takeover.__init__(self) Takeover.__init__(self)
unescaper[DBMS.MAXDB] = MaxDBMap.unescape unescaper[DBMS.MAXDB] = Syntax.unescape
unescaper.setUnescape(MaxDBMap.unescape)

View File

@ -34,5 +34,4 @@ class MSSQLServerMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous
Miscellaneous.__init__(self) Miscellaneous.__init__(self)
Takeover.__init__(self) Takeover.__init__(self)
unescaper[DBMS.MSSQL] = MSSQLServerMap.unescape unescaper[DBMS.MSSQL] = Syntax.unescape
unescaper.setUnescape(MSSQLServerMap.unescape)

View File

@ -39,5 +39,4 @@ class MySQLMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, Take
Miscellaneous.__init__(self) Miscellaneous.__init__(self)
Takeover.__init__(self) Takeover.__init__(self)
unescaper[DBMS.MYSQL] = MySQLMap.unescape unescaper[DBMS.MYSQL] = Syntax.unescape
unescaper.setUnescape(MySQLMap.unescape)

View File

@ -33,5 +33,4 @@ class OracleMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, Tak
Miscellaneous.__init__(self) Miscellaneous.__init__(self)
Takeover.__init__(self) Takeover.__init__(self)
unescaper[DBMS.ORACLE] = OracleMap.unescape unescaper[DBMS.ORACLE] = Syntax.unescape
unescaper.setUnescape(OracleMap.unescape)

View File

@ -40,5 +40,4 @@ class PostgreSQLMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous,
Miscellaneous.__init__(self) Miscellaneous.__init__(self)
Takeover.__init__(self) Takeover.__init__(self)
unescaper[DBMS.PGSQL] = PostgreSQLMap.unescape unescaper[DBMS.PGSQL] = Syntax.unescape
unescaper.setUnescape(PostgreSQLMap.unescape)

View File

@ -33,5 +33,4 @@ class SQLiteMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, Tak
Miscellaneous.__init__(self) Miscellaneous.__init__(self)
Takeover.__init__(self) Takeover.__init__(self)
unescaper[DBMS.SQLITE] = SQLiteMap.unescape unescaper[DBMS.SQLITE] = Syntax.unescape
unescaper.setUnescape(SQLiteMap.unescape)

View File

@ -33,5 +33,4 @@ class SybaseMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, Tak
Miscellaneous.__init__(self) Miscellaneous.__init__(self)
Takeover.__init__(self) Takeover.__init__(self)
unescaper[DBMS.SYBASE] = SybaseMap.unescape unescaper[DBMS.SYBASE] = Syntax.unescape
unescaper.setUnescape(SybaseMap.unescape)