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

Skip to content

Commit 7587528

Browse files
committed
Fixes #1202
1 parent 7b2c27f commit 7587528

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

lib/controller/controller.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from lib.core.common import intersect
3131
from lib.core.common import isListLike
3232
from lib.core.common import parseTargetUrl
33+
from lib.core.common import popValue
34+
from lib.core.common import pushValue
3335
from lib.core.common import randomStr
3436
from lib.core.common import readInput
3537
from lib.core.common import safeCSValue
@@ -488,6 +490,10 @@ def start():
488490
kb.testedParams.add(paramKey)
489491

490492
if testSqlInj:
493+
if place == PLACE.COOKIE:
494+
pushValue(kb.mergeCookies)
495+
kb.mergeCookies = False
496+
491497
check = heuristicCheckSqlInjection(place, parameter)
492498

493499
if check != HEURISTIC_TEST.POSITIVE:
@@ -523,6 +529,9 @@ def start():
523529
warnMsg += "injectable"
524530
logger.warn(warnMsg)
525531

532+
if place == PLACE.COOKIE:
533+
kb.mergeCookies = popValue()
534+
526535
if len(kb.injections) == 0 or (len(kb.injections) == 1 and kb.injections[0].place is None):
527536
if kb.vainRun and not conf.multipleTargets:
528537
errMsg = "no parameter(s) found for testing in the provided data "

lib/request/basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def title(self):
9494
_ = readInput(message, default="Y")
9595
kb.mergeCookies = not _ or _[0] in ("y", "Y")
9696

97-
if kb.mergeCookies:
97+
if kb.mergeCookies and kb.injection.place != PLACE.COOKIE:
9898
_ = lambda x: re.sub(r"(?i)\b%s=[^%s]+" % (re.escape(cookie.name), conf.cookieDel or DEFAULT_COOKIE_DELIMITER), "%s=%s" % (cookie.name, getUnicode(cookie.value)), x)
9999
headers[HTTP_HEADER.COOKIE] = _(headers[HTTP_HEADER.COOKIE])
100100

0 commit comments

Comments
 (0)