Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6cbb927

Browse files
committed
Partial fix for -o not resumed at following runs if missing from command line
1 parent 50f4c4a commit 6cbb927

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

lib/controller/checks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ def genCmpPayload():
465465
injection.conf.titles = conf.titles
466466
injection.conf.string = conf.string
467467
injection.conf.regexp = conf.regexp
468+
injection.conf.optimize = conf.optimize
468469

469470
if conf.beep or conf.realTest:
470471
beep()

lib/core/common.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,6 +2454,17 @@ def isTechniqueAvailable(technique=None):
24542454
else:
24552455
return getTechniqueData(technique) is not None
24562456

2457+
def setOptimize():
2458+
#conf.predictOutput = True
2459+
conf.keepAlive = True
2460+
conf.threads = 3 if conf.threads < 3 else conf.threads
2461+
conf.nullConnection = not any([conf.data, conf.textOnly, conf.titles, conf.string, conf.regexp])
2462+
2463+
if not conf.nullConnection:
2464+
debugMsg = "turning off --null-connection switch used indirectly by switch -o"
2465+
logger.debug(debugMsg)
2466+
2467+
24572468
def initTechnique(technique=None):
24582469
"""
24592470
Prepares proper page template and match ratio for technique specified
@@ -2472,6 +2483,9 @@ def initTechnique(technique=None):
24722483
setattr(conf, key, value)
24732484
debugMsg = "resuming configuration option '%s' (%s)" % (key, value)
24742485
logger.debug(debugMsg)
2486+
2487+
if value and key == "optimize":
2488+
setOptimize()
24752489
else:
24762490
warnMsg = "there is no injection data available for technique "
24772491
warnMsg += "'%s'" % enumValueToNameLookup(PAYLOAD.TECHNIQUE, technique)

lib/core/option.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
from lib.core.common import readInput
4949
from lib.core.common import runningAsAdmin
5050
from lib.core.common import sanitizeStr
51+
from lib.core.common import setOptimize
5152
from lib.core.common import UnicodeRawConfigParser
5253
from lib.core.convert import urldecode
5354
from lib.core.data import conf
@@ -1304,13 +1305,7 @@ def __cleanupOptions():
13041305
conf.multipleTargets = True
13051306

13061307
if conf.optimize:
1307-
#conf.predictOutput = True
1308-
conf.keepAlive = True
1309-
conf.threads = 3 if conf.threads < 3 else conf.threads
1310-
conf.nullConnection = not any([conf.data, conf.textOnly, conf.titles, conf.string, conf.regexp])
1311-
if not conf.nullConnection:
1312-
debugMsg = "turning off --null-connection switch used indirectly by switch -o"
1313-
logger.debug(debugMsg)
1308+
setOptimize()
13141309

13151310
if conf.data:
13161311
conf.data = urldecode(conf.data)

0 commit comments

Comments
 (0)