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

Skip to content

Commit e73ac6c

Browse files
committed
Minor patch on request of an user
1 parent c2b2ccd commit e73ac6c

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

lib/core/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3360,6 +3360,8 @@ def randomizeParameterValue(value):
33603360

33613361
retVal = value
33623362

3363+
value = re.sub(r"%[0-9a-fA-F]{2}", "", value)
3364+
33633365
for match in re.finditer('[A-Z]+', value):
33643366
retVal = retVal.replace(match.group(), randomStr(len(match.group())).upper())
33653367

lib/request/connect.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -818,21 +818,23 @@ def _adjustParameter(paramString, parameter, newValue):
818818
if conf.rParam:
819819
def _randomizeParameter(paramString, randomParameter):
820820
retVal = paramString
821-
match = re.search("%s=(?P<value>[^&;]+)" % re.escape(randomParameter), paramString)
821+
match = re.search(r"(\A|\b)%s=(?P<value>[^&;]+)" % re.escape(randomParameter), paramString)
822822
if match:
823823
origValue = match.group("value")
824-
retVal = re.sub("%s=[^&;]+" % re.escape(randomParameter), "%s=%s" % (randomParameter, randomizeParameterValue(origValue)), paramString)
824+
retVal = re.sub(r"(\A|\b)%s=[^&;]+" % re.escape(randomParameter), "%s=%s" % (randomParameter, randomizeParameterValue(origValue)), paramString)
825825
return retVal
826826

827827
for randomParameter in conf.rParam:
828-
for item in (PLACE.GET, PLACE.POST, PLACE.COOKIE):
828+
for item in (PLACE.GET, PLACE.POST, PLACE.COOKIE, PLACE.URI, PLACE.CUSTOM_POST):
829829
if item in conf.parameters:
830830
if item == PLACE.GET and get:
831831
get = _randomizeParameter(get, randomParameter)
832-
elif item == PLACE.POST and post:
832+
elif item in (PLACE.POST, PLACE.CUSTOM_POST) and post:
833833
post = _randomizeParameter(post, randomParameter)
834834
elif item == PLACE.COOKIE and cookie:
835835
cookie = _randomizeParameter(cookie, randomParameter)
836+
elif item == PLACE.URI and uri:
837+
uri = _randomizeParameter(uri, randomParameter)
836838

837839
if conf.evalCode:
838840
delimiter = conf.paramDel or DEFAULT_GET_POST_DELIMITER

0 commit comments

Comments
 (0)