Partial fix for -o not resumed at following runs if missing from command line

This commit is contained in:
Bernardo Damele 2011-07-25 11:05:49 +00:00
parent 50f4c4af52
commit 6cbb927012
3 changed files with 17 additions and 7 deletions

View File

@ -465,6 +465,7 @@ def checkSqlInjection(place, parameter, value):
injection.conf.titles = conf.titles injection.conf.titles = conf.titles
injection.conf.string = conf.string injection.conf.string = conf.string
injection.conf.regexp = conf.regexp injection.conf.regexp = conf.regexp
injection.conf.optimize = conf.optimize
if conf.beep or conf.realTest: if conf.beep or conf.realTest:
beep() beep()

View File

@ -2454,6 +2454,17 @@ def isTechniqueAvailable(technique=None):
else: else:
return getTechniqueData(technique) is not None return getTechniqueData(technique) is not None
def setOptimize():
#conf.predictOutput = True
conf.keepAlive = True
conf.threads = 3 if conf.threads < 3 else conf.threads
conf.nullConnection = not any([conf.data, conf.textOnly, conf.titles, conf.string, conf.regexp])
if not conf.nullConnection:
debugMsg = "turning off --null-connection switch used indirectly by switch -o"
logger.debug(debugMsg)
def initTechnique(technique=None): def initTechnique(technique=None):
""" """
Prepares proper page template and match ratio for technique specified Prepares proper page template and match ratio for technique specified
@ -2472,6 +2483,9 @@ def initTechnique(technique=None):
setattr(conf, key, value) setattr(conf, key, value)
debugMsg = "resuming configuration option '%s' (%s)" % (key, value) debugMsg = "resuming configuration option '%s' (%s)" % (key, value)
logger.debug(debugMsg) logger.debug(debugMsg)
if value and key == "optimize":
setOptimize()
else: else:
warnMsg = "there is no injection data available for technique " warnMsg = "there is no injection data available for technique "
warnMsg += "'%s'" % enumValueToNameLookup(PAYLOAD.TECHNIQUE, technique) warnMsg += "'%s'" % enumValueToNameLookup(PAYLOAD.TECHNIQUE, technique)

View File

@ -48,6 +48,7 @@ from lib.core.common import readCachedFileContent
from lib.core.common import readInput from lib.core.common import readInput
from lib.core.common import runningAsAdmin from lib.core.common import runningAsAdmin
from lib.core.common import sanitizeStr from lib.core.common import sanitizeStr
from lib.core.common import setOptimize
from lib.core.common import UnicodeRawConfigParser from lib.core.common import UnicodeRawConfigParser
from lib.core.convert import urldecode from lib.core.convert import urldecode
from lib.core.data import conf from lib.core.data import conf
@ -1304,13 +1305,7 @@ def __cleanupOptions():
conf.multipleTargets = True conf.multipleTargets = True
if conf.optimize: if conf.optimize:
#conf.predictOutput = True setOptimize()
conf.keepAlive = True
conf.threads = 3 if conf.threads < 3 else conf.threads
conf.nullConnection = not any([conf.data, conf.textOnly, conf.titles, conf.string, conf.regexp])
if not conf.nullConnection:
debugMsg = "turning off --null-connection switch used indirectly by switch -o"
logger.debug(debugMsg)
if conf.data: if conf.data:
conf.data = urldecode(conf.data) conf.data = urldecode(conf.data)