Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import base64, sys, os
- def main() :
- try :
- Input = str(sys.argv[1])
- Output = str(sys.argv[2])
- except:
- print "\n[*]Usage: %s <Input file> <Output file>" % os.path.basename(sys.argv[0])
- exit()
- try :
- ifile = open(Input, "rb").read()
- except :
- print "\n[-]Sorry, couldn't open input file"
- exit()
- try :
- if "<?php" in ifile :
- ifile = ifile.replace("<?php", "")
- if "<?" in ifile :
- ifile = ifile.replace("<?", "")
- ifile = ifile.replace("?>", "")
- except :
- pass
- x = "<?php\neval(base64_decode('"
- y = base64.b64encode(ifile)
- z = "'));\n?>"
- try :
- ofile = open(Output, "w")
- ofile.write(x + y + z)
- ofile.close()
- print "\n[+]Done ;)"
- except :
- print "\n[-]Sorry, couldn't make output file"
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement