Fix for an Issue #316

This commit is contained in:
Miroslav Stampar 2012-12-20 20:55:59 +01:00
parent 1073ebc697
commit 712cf4e4db
2 changed files with 13 additions and 13 deletions

View File

@ -66,7 +66,7 @@ def tableExists(tableFile, regex=None):
threadData = getCurrentThreadData()
threadData.shared.count = 0
threadData.shared.limit = len(tables)
threadData.shared.values = []
threadData.shared.value = []
threadData.shared.unique = set()
def tableExistsThread():
@ -92,7 +92,7 @@ def tableExists(tableFile, regex=None):
kb.locks.io.acquire()
if result and table.lower() not in threadData.shared.unique:
threadData.shared.values.append(table)
threadData.shared.value.append(table)
threadData.shared.unique.add(table.lower())
if conf.verbose in (1, 2):
@ -117,17 +117,17 @@ def tableExists(tableFile, regex=None):
clearConsoleLine(True)
dataToStdout("\n")
if not threadData.shared.values:
if not threadData.shared.value:
warnMsg = "no table(s) found"
logger.warn(warnMsg)
else:
for item in threadData.shared.values:
for item in threadData.shared.value:
if conf.db not in kb.data.cachedTables:
kb.data.cachedTables[conf.db] = [item]
else:
kb.data.cachedTables[conf.db].append(item)
for _ in map(lambda x: (conf.db, x), threadData.shared.values):
for _ in map(lambda x: (conf.db, x), threadData.shared.value):
if _ not in kb.brute.tables:
kb.brute.tables.append(_)
@ -164,7 +164,7 @@ def columnExists(columnFile, regex=None):
threadData = getCurrentThreadData()
threadData.shared.count = 0
threadData.shared.limit = len(columns)
threadData.shared.values = []
threadData.shared.value = []
def columnExistsThread():
threadData = getCurrentThreadData()
@ -184,7 +184,7 @@ def columnExists(columnFile, regex=None):
kb.locks.io.acquire()
if result:
threadData.shared.values.append(column)
threadData.shared.value.append(column)
if conf.verbose in (1, 2):
clearConsoleLine(True)
@ -208,13 +208,13 @@ def columnExists(columnFile, regex=None):
clearConsoleLine(True)
dataToStdout("\n")
if not threadData.shared.values:
if not threadData.shared.value:
warnMsg = "no column(s) found"
logger.warn(warnMsg)
else:
columns = {}
for column in threadData.shared.values:
for column in threadData.shared.value:
result = inject.checkBooleanExpression("%s" % safeStringFormat("EXISTS(SELECT %s FROM %s WHERE ROUND(%s)=ROUND(%s))", (column, table, column, column)))
if result:

View File

@ -34,7 +34,7 @@ class Crawler(object):
def getTargetUrls(self):
try:
threadData = getCurrentThreadData()
threadData.shared.values = oset()
threadData.shared.value = oset()
def crawlThread():
threadData = getCurrentThreadData()
@ -82,7 +82,7 @@ class Crawler(object):
with kb.locks.value:
threadData.shared.deeper.add(url)
if re.search(r"(.*?)\?(.+)", url):
threadData.shared.values.add(url)
threadData.shared.value.add(url)
except UnicodeEncodeError: # for non-HTML files
pass
finally:
@ -121,9 +121,9 @@ class Crawler(object):
finally:
clearConsoleLine(True)
if not threadData.shared.values:
if not threadData.shared.value:
warnMsg = "no usable links found (with GET parameters)"
logger.warn(warnMsg)
else:
for url in threadData.shared.values:
for url in threadData.shared.value:
kb.targets.add(( url, None, None, None ))