diff --git a/tamper/plus2concat.py b/tamper/plus2concat.py index 574a20828..113315b9b 100644 --- a/tamper/plus2concat.py +++ b/tamper/plus2concat.py @@ -41,6 +41,9 @@ def tamper(payload, **kwargs): retVal = payload if payload: + prefix, suffix = '+' * len(re.search(r"\A(\+*)", payload).group(0)), '+' * len(re.search(r"(\+*)\Z", payload).group(0)) + retVal = retVal.strip('+') + while True: indexes = zeroDepthSearch(retVal, '+') @@ -76,4 +79,6 @@ def tamper(payload, **kwargs): else: break + retVal = "%s%s%s" % (prefix, retVal, suffix) + return retVal diff --git a/tamper/plus2fnconcat.py b/tamper/plus2fnconcat.py index 86ceee621..bc85826f8 100644 --- a/tamper/plus2fnconcat.py +++ b/tamper/plus2fnconcat.py @@ -42,6 +42,9 @@ def tamper(payload, **kwargs): retVal = payload if payload: + prefix, suffix = '+' * len(re.search(r"\A(\+*)", payload).group(0)), '+' * len(re.search(r"(\+*)\Z", payload).group(0)) + retVal = retVal.strip('+') + while True: indexes = zeroDepthSearch(retVal, '+') @@ -89,4 +92,6 @@ def tamper(payload, **kwargs): else: break + retVal = "%s%s%s" % (prefix, retVal, suffix) + return retVal