Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
stamparm committed Oct 31, 2015
1 parent 2642e45 commit bae9db6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tamper/commalessmid.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
See the file 'doc/COPYING' for copying permission
"""

import os
import re

from lib.core.common import singleTimeWarnMessage
from lib.core.enums import PRIORITY

__priority__ = PRIORITY.HIGH
Expand All @@ -30,7 +32,11 @@ def tamper(payload, **kwargs):

retVal = payload

match = re.search(r"(?i)MID\(([^,]+?)\s*,\s*(\d+)\s*\,\s*(\d+)\s*\)", payload or "")
warnMsg = "you should consider usage of switch '--no-cast' along with "
warnMsg += "tamper script '%s'" % os.path.basename(__file__).split(".")[0]
singleTimeWarnMessage(warnMsg)

match = re.search(r"(?i)MID\((.+?)\s*,\s*(\d+)\s*\,\s*(\d+)\s*\)", payload or "")
if match:
retVal = retVal.replace(match.group(0), "MID(%s FROM %s FOR %s)" % (match.group(1), match.group(2), match.group(3)))

Expand Down

0 comments on commit bae9db6

Please sign in to comment.