|
66 | 66 | from lib.core.settings import ASTERISK_MARKER |
67 | 67 | from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR |
68 | 68 | from lib.core.settings import DEFAULT_CONTENT_TYPE |
| 69 | +from lib.core.settings import DEFAULT_COOKIE_DELIMITER |
69 | 70 | from lib.core.settings import DEFAULT_GET_POST_DELIMITER |
70 | 71 | from lib.core.settings import HTTP_ACCEPT_HEADER_VALUE |
71 | 72 | from lib.core.settings import HTTP_ACCEPT_ENCODING_HEADER_VALUE |
@@ -750,17 +751,26 @@ def _randomizeParameter(paramString, randomParameter): |
750 | 751 | value = urldecode(value, convall=True, plusspace=(item==post and kb.postSpaceToPlus)) |
751 | 752 | evaluateCode("%s=%s" % (name, repr(value)), variables) |
752 | 753 |
|
| 754 | + if cookie: |
| 755 | + for part in cookie.split(conf.pDel or DEFAULT_COOKIE_DELIMITER): |
| 756 | + if '=' in part: |
| 757 | + name, value = part.split('=', 1) |
| 758 | + value = urldecode(value, convall=True) |
| 759 | + evaluateCode("%s=%s" % (name, repr(value)), variables) |
| 760 | + |
753 | 761 | originals.update(variables) |
754 | 762 | evaluateCode(conf.evalCode, variables) |
755 | 763 |
|
756 | 764 | for name, value in variables.items(): |
757 | 765 | if name != "__builtins__" and originals.get(name, "") != value: |
758 | 766 | if isinstance(value, (basestring, int)): |
759 | 767 | value = unicode(value) |
760 | | - if '%s=' % name in (get or ""): |
| 768 | + if re.search(r"\b%s=" % name, (get or "")): |
761 | 769 | get = re.sub("((\A|\W)%s=)([^%s]+)" % (name, delimiter), "\g<1>%s" % value, get) |
762 | | - elif '%s=' % name in (post or ""): |
| 770 | + elif re.search(r"\b%s=" % name, (post or "")): |
763 | 771 | post = re.sub("((\A|\W)%s=)([^%s]+)" % (name, delimiter), "\g<1>%s" % value, post) |
| 772 | + elif re.search(r"\b%s=" % name, (cookie or "")): |
| 773 | + cookie = re.sub("((\A|\W)%s=)([^%s]+)" % (name, conf.pDel or DEFAULT_COOKIE_DELIMITER), "\g<1>%s" % value, cookie) |
764 | 774 | elif post is not None: |
765 | 775 | post += "%s%s=%s" % (delimiter, name, value) |
766 | 776 | else: |
|
0 commit comments