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
"""
from lib.core.data import kb
from lib.core.datatype import advancedDict
class Unescaper(advancedDict):
def __init__(self):
self.__unescaper = None
def setUnescape(self, unescapeFunction):
self.__unescaper = unescapeFunction
pass
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()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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