|
22 | 22 | from lib.core.common import calculateDeltaSeconds |
23 | 23 | from lib.core.common import clearConsoleLine |
24 | 24 | from lib.core.common import cpuThrottle |
| 25 | +from lib.core.common import executeCode |
25 | 26 | from lib.core.common import extractRegexResult |
26 | 27 | from lib.core.common import getCurrentThreadData |
27 | 28 | from lib.core.common import getFilteredPageContent |
@@ -603,6 +604,31 @@ def _randomizeParameter(paramString, randomParameter): |
603 | 604 | elif item == PLACE.COOKIE and cookie: |
604 | 605 | cookie = _randomizeParameter(cookie, randomParameter) |
605 | 606 |
|
| 607 | + if conf.evalCode: |
| 608 | + variables = {} |
| 609 | + originals = {} |
| 610 | + |
| 611 | + if get: |
| 612 | + executeCode(get.replace("&", ";"), variables) |
| 613 | + if post: |
| 614 | + executeCode(post.replace("&", ";"), variables) |
| 615 | + |
| 616 | + originals.update(variables) |
| 617 | + executeCode(conf.evalCode, variables) |
| 618 | + |
| 619 | + for name, value in variables.items(): |
| 620 | + if name != "__builtins__" and originals.get(name, "") != value: |
| 621 | + if isinstance(value, (basestring, int)): |
| 622 | + value = unicode(value) |
| 623 | + if '%s=' % name in (get or ""): |
| 624 | + get = re.sub("(%s=)([^&]+)" % name, "\g<1>%s" % value, get) |
| 625 | + elif '%s=' % name in (post or ""): |
| 626 | + post = re.sub("(%s=)([^&]+)" % name, "\g<1>%s" % value, post) |
| 627 | + elif post: |
| 628 | + post += "&%s=%s" % (name, value) |
| 629 | + else: |
| 630 | + get += "&%s=%s" % (name, value) |
| 631 | + |
606 | 632 | get = urlencode(get, limit=True) |
607 | 633 | if post and place != PLACE.POST and hasattr(post, UNENCODED_ORIGINAL_VALUE): |
608 | 634 | post = getattr(post, UNENCODED_ORIGINAL_VALUE) |
|
0 commit comments