Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 35ed668

Browse files
committed
Minor improvement of the randomcase tamper script
1 parent 70215a9 commit 35ed668

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tamper/randomcase.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ def tamper(payload, **kwargs):
4444
word = match.group()
4545

4646
if word.upper() in kb.keywords:
47-
_ = str()
47+
while True:
48+
_ = ""
4849

49-
for i in xrange(len(word)):
50-
_ += word[i].upper() if randomRange(0, 1) else word[i].lower()
50+
for i in xrange(len(word)):
51+
_ += word[i].upper() if randomRange(0, 1) else word[i].lower()
52+
53+
if len(_) > 1 and _ not in (_.lower(), _.upper()):
54+
break
5155

5256
retVal = retVal.replace(word, _)
5357

0 commit comments

Comments
 (0)