| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -141,7 +141,7 @@ def cmdLineParser(): | |||
| 141 | 141 | help="Test requests between two visits to a given safe url") | |
| 142 | 142 | ||
| 143 | 143 | request.add_option("--eval", dest="evalCode", | |
| 144 | - help="Evaluate provided Python code before the request (e.g. \"import hashlib;id2=hashlib.md5(str(id)).hexdigest()\")") | ||
| 144 | + help="Evaluate provided Python code before the request (e.g. \"import hashlib;id2=hashlib.md5(id).hexdigest()\")") | ||
| 145 | 145 | ||
| 146 | 146 | # Optimization options | |
| 147 | 147 | optimization = OptionGroup(parser, "Optimization", "These " | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -605,13 +605,15 @@ def _randomizeParameter(paramString, randomParameter): | |||
| 605 | 605 | cookie = _randomizeParameter(cookie, randomParameter) | |
| 606 | 606 | ||
| 607 | 607 | if conf.evalCode: | |
| 608 | + delimiter = conf.pDel or "&" | ||
| 608 | 609 | variables = {} | |
| 609 | 610 | originals = {} | |
| 610 | 611 | ||
| 611 | - if get: | ||
| 612 | - executeCode(get.replace("&", ";"), variables) | ||
| 613 | - if post: | ||
| 614 | - executeCode(post.replace("&", ";"), variables) | ||
| 612 | + for item in filter(None, (get, post)): | ||
| 613 | + for part in item.split(delimiter): | ||
| 614 | + if '=' in part: | ||
| 615 | + name, value = part.split('=', 1) | ||
| 616 | + executeCode("%s='%s'" % (name, value), variables) | ||
| 615 | 617 | ||
| 616 | 618 | originals.update(variables) | |
| 617 | 619 | executeCode(conf.evalCode, variables) | |
@@ -621,13 +623,13 @@ def _randomizeParameter(paramString, randomParameter): | |||
| 621 | 623 | if isinstance(value, (basestring, int)): | |
| 622 | 624 | value = unicode(value) | |
| 623 | 625 | if '%s=' % name in (get or ""): | |
| 624 | - get = re.sub("(%s=)([^&]+)" % name, "\g<1>%s" % value, get) | ||
| 626 | + get = re.sub("((\A|\W)%s=)([^%s]+)" % (name, delimiter), "\g<1>%s" % value, get) | ||
| 625 | 627 | elif '%s=' % name in (post or ""): | |
| 626 | - post = re.sub("(%s=)([^&]+)" % name, "\g<1>%s" % value, post) | ||
| 628 | + post = re.sub("((\A|\W)%s=)([^%s]+)" % (name, delimiter), "\g<1>%s" % value, post) | ||
| 627 | 629 | elif post: | |
| 628 | - post += "&%s=%s" % (name, value) | ||
| 630 | + post += "%s%s=%s" % (delimiter, name, value) | ||
| 629 | 631 | else: | |
| 630 | - get += "&%s=%s" % (name, value) | ||
| 632 | + get += "%s%s=%s" % (delimiter, name, value) | ||
| 631 | 633 | ||
| 632 | 634 | get = urlencode(get, limit=True) | |
| 633 | 635 | if post and place != PLACE.POST and hasattr(post, UNENCODED_ORIGINAL_VALUE): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -131,7 +131,7 @@ safUrl = | |||
| 131 | 131 | saFreq = 0 | |
| 132 | 132 | ||
| 133 | 133 | # Evaluate provided Python code before the request | |
| 134 | - # Example: import hashlib;id2=hashlib.md5(str(id)).hexdigest() | ||
| 134 | + # Example: import hashlib;id2=hashlib.md5(id).hexdigest() | ||
| 135 | 135 | evalCode = | |
| 136 | 136 | ||
| 137 | 137 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments