minor improvements regarding data retrieval through DNS channel

This commit is contained in:
Miroslav Stampar
2012-04-03 09:18:30 +00:00
parent 46cfa64d81
commit e05109812f
8 changed files with 43 additions and 20 deletions

View File

@@ -1599,9 +1599,9 @@ def parseXmlFile(xmlFile, handler):
parse(stream, handler)
stream.close()
def getSPLSnippet(dbms, name, **variables):
def getSPQLSnippet(dbms, name, **variables):
"""
Returns content of SPL snippet located inside "procs" directory
Returns content of SP(Q)L snippet located inside "procs" directory
"""
filename = os.path.join(paths.SQLMAP_PROCS_PATH, DBMS_DIRECTORY_DICT[dbms], "%s.txt" % name)

View File

@@ -1438,6 +1438,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
kb.delayCandidates = TIME_DELAY_CANDIDATES * [0]
kb.dep = None
kb.dnsMode = False
kb.dnsTest = None
kb.docRoot = None
kb.dumpMode = False
kb.dynamicMarkings = []

View File

@@ -92,6 +92,13 @@ def exceptionHandledFunction(threadFunction):
print
logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg))
def setDaemon(thread):
# Reference: http://stackoverflow.com/questions/190010/daemon-threads-explanation
if PYVERSION >= "2.6":
thread.daemon = True
else:
thread.setDaemon(True)
def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardException=True, threadChoice=False, startThreadMsg=True):
threads = []
@@ -128,11 +135,7 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
for numThread in xrange(numThreads):
thread = threading.Thread(target=exceptionHandledFunction, name=str(numThread), args=[threadFunction])
# Reference: http://stackoverflow.com/questions/190010/daemon-threads-explanation
if PYVERSION >= "2.6":
thread.daemon = True
else:
thread.setDaemon(True)
setDaemon(thread)
try:
thread.start()