mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
more update
This commit is contained in:
parent
c24f1cc07c
commit
e2810003ae
|
@ -26,6 +26,7 @@ from lib.core.agent import agent
|
|||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.settings import SQL_STATEMENTS
|
||||
from lib.utils.timeout import timeout
|
||||
|
||||
def direct(query, content=True):
|
||||
output = None
|
||||
|
@ -42,9 +43,9 @@ def direct(query, content=True):
|
|||
break
|
||||
|
||||
if select:
|
||||
output = conf.dbmsConnector.select(query)
|
||||
output = timeout(func=conf.dbmsConnector.select, args = query, duration=conf.timeout, default=None)
|
||||
else:
|
||||
output = conf.dbmsConnector.execute(query)
|
||||
output = timeout(func=conf.dbmsConnector.execute, args = query, duration=conf.timeout, default=None)
|
||||
|
||||
if output is None or len(output) == 0:
|
||||
return None
|
||||
|
|
|
@ -7,14 +7,12 @@ def timeout(func, args=(), kwargs={}, duration=1, default=None):
|
|||
def __init__(self):
|
||||
threading.Thread.__init__(self)
|
||||
self.exceeded = False
|
||||
self.exceptionMsg = None
|
||||
self.result = None
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
self.result = func(*args, **kwargs)
|
||||
except Exception, msg:
|
||||
self.exceptionMsg = msg
|
||||
except:
|
||||
self.result = default
|
||||
|
||||
thread = InterruptableThread()
|
||||
|
|
|
@ -30,7 +30,6 @@ except ImportError, _:
|
|||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.utils.timeout import timeout
|
||||
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
|
@ -61,10 +60,11 @@ class Connector(GenericConnector):
|
|||
self.connected()
|
||||
|
||||
def fetchall(self):
|
||||
retVal = timeout(func=self.cursor.fetchall, duration=conf.timeout, default=None)
|
||||
if self.exceptionMsg:
|
||||
logger.log(8, self.exceptionMsg[1])
|
||||
return retVal
|
||||
try:
|
||||
return self.cursor.fetchall()
|
||||
except pyodbc.ProgrammingError, msg:
|
||||
logger.log(8, msg[1])
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
logger.debug(query)
|
||||
|
|
|
@ -30,7 +30,6 @@ except ImportError, _:
|
|||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.utils.timeout import timeout
|
||||
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
|
@ -60,10 +59,11 @@ class Connector(GenericConnector):
|
|||
self.connected()
|
||||
|
||||
def fetchall(self):
|
||||
retVal = timeout(func=self.cursor.fetchall, duration=conf.timeout, default=None)
|
||||
if self.exceptionMsg:
|
||||
logger.log(8, self.exceptionMsg[1])
|
||||
return retVal
|
||||
try:
|
||||
return self.cursor.fetchall()
|
||||
except kinterbasdb.OperationalError, msg:
|
||||
logger.log(8, msg[1])
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
logger.debug(query)
|
||||
|
|
|
@ -31,7 +31,6 @@ except ImportError, _:
|
|||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.utils.timeout import timeout
|
||||
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
|
@ -64,10 +63,11 @@ class Connector(GenericConnector):
|
|||
self.connected()
|
||||
|
||||
def fetchall(self):
|
||||
retVal = timeout(func=self.cursor.fetchall, duration=conf.timeout, default=None)
|
||||
if self.exceptionMsg:
|
||||
logger.log(8, self.exceptionMsg)
|
||||
return retVal
|
||||
try:
|
||||
return self.cursor.fetchall()
|
||||
except (pymssql.ProgrammingError, pymssql.OperationalError, _mssql.MssqlDatabaseException), msg:
|
||||
logger.log(8, msg)
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
logger.debug(query)
|
||||
|
|
|
@ -30,7 +30,6 @@ except ImportError, _:
|
|||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.utils.timeout import timeout
|
||||
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
|
@ -60,10 +59,11 @@ class Connector(GenericConnector):
|
|||
self.connected()
|
||||
|
||||
def fetchall(self):
|
||||
retVal = timeout(func=self.cursor.fetchall, duration=conf.timeout, default=None)
|
||||
if self.exceptionMsg:
|
||||
logger.log(8, self.exceptionMsg[1])
|
||||
return retVal
|
||||
try:
|
||||
return self.cursor.fetchall()
|
||||
except MySQLdb.ProgrammingError, msg:
|
||||
logger.log(8, msg[1])
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
logger.debug(query)
|
||||
|
|
|
@ -30,7 +30,6 @@ except ImportError, _:
|
|||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.utils.timeout import timeout
|
||||
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
|
@ -62,10 +61,11 @@ class Connector(GenericConnector):
|
|||
self.connected()
|
||||
|
||||
def fetchall(self):
|
||||
retVal = timeout(func=self.cursor.fetchall, duration=conf.timeout, default=None)
|
||||
if self.exceptionMsg:
|
||||
logger.log(8, self.exceptionMsg)
|
||||
return retVal
|
||||
try:
|
||||
return self.cursor.fetchall()
|
||||
except cx_Oracle.InterfaceError, msg:
|
||||
logger.log(8, msg)
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
logger.debug(query)
|
||||
|
|
|
@ -30,7 +30,6 @@ except ImportError, _:
|
|||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.utils.timeout import timeout
|
||||
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
|
@ -60,10 +59,11 @@ class Connector(GenericConnector):
|
|||
self.connected()
|
||||
|
||||
def fetchall(self):
|
||||
retVal = timeout(func=self.cursor.fetchall, duration=conf.timeout, default=None)
|
||||
if self.exceptionMsg:
|
||||
logger.log(8, self.exceptionMsg)
|
||||
return retVal
|
||||
try:
|
||||
return self.cursor.fetchall()
|
||||
except psycopg2.ProgrammingError, msg:
|
||||
logger.log(8, msg)
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
logger.debug(query)
|
||||
|
|
|
@ -30,7 +30,6 @@ except ImportError, _:
|
|||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.utils.timeout import timeout
|
||||
|
||||
from plugins.generic.connector import Connector as GenericConnector
|
||||
|
||||
|
@ -61,10 +60,11 @@ class Connector(GenericConnector):
|
|||
self.connected()
|
||||
|
||||
def fetchall(self):
|
||||
retVal = timeout(func=self.cursor.fetchall, duration=conf.timeout, default=None)
|
||||
if self.exceptionMsg:
|
||||
logger.log(8, self.exceptionMsg[0])
|
||||
return retVal
|
||||
try:
|
||||
return self.cursor.fetchall()
|
||||
except sqlite3.OperationalError, msg:
|
||||
logger.log(8, msg[0])
|
||||
return None
|
||||
|
||||
def execute(self, query):
|
||||
logger.debug(query)
|
||||
|
|
Loading…
Reference in New Issue
Block a user