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.string = conf.string
injection.conf.regexp = conf.regexp
injection.conf.optimize = conf.optimize
if conf.beep or conf.realTest:
beep()

View File

@ -2454,6 +2454,17 @@ def isTechniqueAvailable(technique=None):
else:
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):
"""
Prepares proper page template and match ratio for technique specified
@ -2472,6 +2483,9 @@ def initTechnique(technique=None):
setattr(conf, key, value)
debugMsg = "resuming configuration option '%s' (%s)" % (key, value)
logger.debug(debugMsg)
if value and key == "optimize":
setOptimize()
else:
warnMsg = "there is no injection data available for 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 runningAsAdmin
from lib.core.common import sanitizeStr
from lib.core.common import setOptimize
from lib.core.common import UnicodeRawConfigParser
from lib.core.convert import urldecode
from lib.core.data import conf
@ -1304,13 +1305,7 @@ def __cleanupOptions():
conf.multipleTargets = True
if conf.optimize:
#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)
setOptimize()
if conf.data:
conf.data = urldecode(conf.data)