mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
Patch for an Issue #212
This commit is contained in:
parent
eb6f17b561
commit
6e2fce66aa
|
@ -10,6 +10,9 @@ try:
|
|||
except ImportError, _:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||
|
@ -49,14 +52,14 @@ class Connector(GenericConnector):
|
|||
try:
|
||||
return self.cursor.fetchall()
|
||||
except pyodbc.ProgrammingError, msg:
|
||||
logger.warn("(remote) %s" % msg[1])
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
try:
|
||||
self.cursor.execute(query)
|
||||
except (pyodbc.OperationalError, pyodbc.ProgrammingError), msg:
|
||||
logger.warn("(remote) %s" % msg[1])
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
except pyodbc.Error, msg:
|
||||
raise sqlmapConnectionException, msg[1]
|
||||
|
||||
|
|
|
@ -10,6 +10,9 @@ try:
|
|||
except ImportError, _:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
@ -42,14 +45,14 @@ class Connector(GenericConnector):
|
|||
try:
|
||||
return self.cursor.fetchall()
|
||||
except ibm_db_dbi.ProgrammingError, msg:
|
||||
logger.warn("(remote) %s" % msg[1])
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
try:
|
||||
self.cursor.execute(query)
|
||||
except (ibm_db_dbi.OperationalError, ibm_db_dbi.ProgrammingError), msg:
|
||||
logger.warn("(remote) %s" % msg[1])
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
except ibm_db_dbi.InternalError, msg:
|
||||
raise sqlmapConnectionException, msg[1]
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ try:
|
|||
except ImportError, _:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.settings import UNICODE_ENCODING
|
||||
|
@ -47,14 +49,14 @@ class Connector(GenericConnector):
|
|||
try:
|
||||
return self.cursor.fetchall()
|
||||
except kinterbasdb.OperationalError, msg:
|
||||
logger.warn("(remote) %s" % msg[1])
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
try:
|
||||
self.cursor.execute(query)
|
||||
except kinterbasdb.OperationalError, msg:
|
||||
logger.warn("(remote) %s" % msg[1])
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
except kinterbasdb.Error, msg:
|
||||
raise sqlmapConnectionException, msg[1]
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@ try:
|
|||
except ImportError, _:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
|
@ -49,7 +51,7 @@ class Connector(GenericConnector):
|
|||
try:
|
||||
return self.cursor.fetchall()
|
||||
except (pymssql.ProgrammingError, pymssql.OperationalError, _mssql.MssqlDatabaseException), msg:
|
||||
logger.warn("(remote) %s" % str(msg).replace("\n", " "))
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % str(msg).replace("\n", " "))
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
|
@ -59,7 +61,7 @@ class Connector(GenericConnector):
|
|||
self.cursor.execute(utf8encode(query))
|
||||
retVal = True
|
||||
except (pymssql.OperationalError, pymssql.ProgrammingError), msg:
|
||||
logger.warn("(remote) %s" % str(msg).replace("\n", " "))
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % str(msg).replace("\n", " "))
|
||||
except pymssql.InternalError, msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ try:
|
|||
except ImportError, _:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
|
@ -44,7 +46,7 @@ class Connector(GenericConnector):
|
|||
try:
|
||||
return self.cursor.fetchall()
|
||||
except pymysql.ProgrammingError, msg:
|
||||
logger.warn(msg[1])
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
|
@ -54,7 +56,7 @@ class Connector(GenericConnector):
|
|||
self.cursor.execute(query)
|
||||
retVal = True
|
||||
except (pymysql.OperationalError, pymysql.ProgrammingError), msg:
|
||||
logger.warn("(remote) %s" % msg[1])
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||
except pymysql.InternalError, msg:
|
||||
raise sqlmapConnectionException, msg[1]
|
||||
|
||||
|
|
|
@ -10,9 +10,11 @@ try:
|
|||
except ImportError, _:
|
||||
pass
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
@ -53,7 +55,7 @@ class Connector(GenericConnector):
|
|||
try:
|
||||
return self.cursor.fetchall()
|
||||
except cx_Oracle.InterfaceError, msg:
|
||||
logger.warn("(remote) %s" % msg)
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
|
@ -63,7 +65,7 @@ class Connector(GenericConnector):
|
|||
self.cursor.execute(utf8encode(query))
|
||||
retVal = True
|
||||
except (cx_Oracle.DatabaseError), msg:
|
||||
logger.warn("(remote) %s" % msg)
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
|
||||
except cx_Oracle.InternalError, msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ try:
|
|||
except ImportError, _:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
|
@ -68,14 +70,14 @@ class Connector(GenericConnector):
|
|||
try:
|
||||
return self.cursor.fetchall()
|
||||
except self.__sqlite.OperationalError, msg:
|
||||
logger.warn("(remote) %s" % msg[0])
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[0])
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
try:
|
||||
self.cursor.execute(utf8encode(query))
|
||||
except self.__sqlite.OperationalError, msg:
|
||||
logger.warn("(remote) %s" % msg[0])
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[0])
|
||||
except self.__sqlite.DatabaseError, msg:
|
||||
raise sqlmapConnectionException, msg[0]
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@ try:
|
|||
except ImportError, _:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
|
@ -49,14 +51,14 @@ class Connector(GenericConnector):
|
|||
try:
|
||||
return self.cursor.fetchall()
|
||||
except (pymssql.ProgrammingError, pymssql.OperationalError, _mssql.MssqlDatabaseException), msg:
|
||||
logger.warn("(remote) %s" % msg)
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
try:
|
||||
self.cursor.execute(utf8encode(query))
|
||||
except (pymssql.OperationalError, pymssql.ProgrammingError), msg:
|
||||
logger.warn("(remote) %s" % msg)
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
|
||||
except pymssql.InternalError, msg:
|
||||
raise sqlmapConnectionException, msg
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user