77See the file 'doc/COPYING' for copying permission
88"""
99
10+ import time
11+
1012from lib .core .agent import agent
1113from lib .core .common import dataToSessionFile
1214from lib .core .common import Backend
15+ from lib .core .common import calculateDeltaSeconds
16+ from lib .core .common import getCurrentThreadData
1317from lib .core .common import getUnicode
1418from lib .core .convert import base64pickle
1519from lib .core .convert import base64unpickle
@@ -26,6 +30,7 @@ def direct(query, content=True):
2630 output = None
2731 select = True
2832 query = agent .payloadDirect (query )
33+ threadData = getCurrentThreadData ()
2934
3035 if Backend .isDbms (DBMS .ORACLE ) and query .startswith ("SELECT " ) and " FROM " not in query :
3136 query = "%s FROM DUAL" % query
@@ -41,6 +46,7 @@ def direct(query, content=True):
4146
4247 logger .log (9 , query )
4348
49+ start = time .time ()
4450 if not select :
4551 output = timeout (func = conf .dbmsConnector .execute , args = (query ,), duration = conf .timeout , default = None )
4652 elif conf .hostname in kb .resumedQueries and query in kb .resumedQueries [conf .hostname ] and "sqlmapoutput" not in query and "sqlmapfile" not in query :
@@ -54,6 +60,7 @@ def direct(query, content=True):
5460 logger .info (infoMsg )
5561 else :
5662 output = timeout (func = conf .dbmsConnector .select , args = (query ,), duration = conf .timeout , default = None )
63+ threadData .lastQueryDuration = calculateDeltaSeconds (start )
5764
5865 if output is None or len (output ) == 0 :
5966 return None
0 commit comments