Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding:utf-8 -*-
- import sys
- import argparse
- import binascii
- import time
- def Banner():
- print" _______ _______ __ __ __ __ "
- print"| __|.----.-----.-----.-----. | __| |--.-----.| | |.----.-----.--| |.-----."
- print"| | || _| -__| -__| | |__ | | -__|| | || __| _ | _ || -__|"
- print"|_______||__| |_____|_____|__|__| |_______|__|__|_____||__|__||____|_____|_____||_____|"
- print"\t\t\t\tCoded By Zer0C0de\n"
- def encode(code):
- for encoded in code:
- print "\b\\x"+encoded.encode("hex"),
- print "\n"
- parser = argparse.ArgumentParser()
- parser.add_argument("-e","--encode",help="Encode a string")
- parser.add_argument("-d","--decode",help="Decode a string")
- parser.add_argument("-s","--stringfile",help="Encode from a file")
- parser.add_argument("-f","--filedecode",help="Decode from a file")
- args = parser.parse_args()
- if args.filedecode:
- fl = args.filedecode
- Banner()
- try:
- f = open(fl,"r")
- for decod in f:
- print "shellcode => ",decod
- cleaninput = decod.replace("\\x","").rstrip('\n')
- print "hex => ",cleaninput
- print "plaintext => ",
- print "\b"+cleaninput.decode("hex")+"\n"
- except IOError:
- print fl+" isnt found"
- if args.stringfile:
- fl = args.stringfile
- Banner()
- f = open(fl,'rw')
- strings = {}
- for line in f:
- strings[line] = line.rstrip('\n')
- try:
- for enc in strings.keys():
- print "plain text => "+strings[enc]
- print "hex => "+enc.encode("hex")
- print "shellcode => ",
- encode(strings[enc])
- except IOError:
- print fl+"isnt found"
- f.close()
- if args.encode:
- Banner()
- enc = args.encode
- print "plain text => "+enc+"\n",
- print "hex => "+enc.encode("hex")
- print "shellcode => ",
- for encoded in enc:
- print("\b\\x"+encoded.encode("hex")),
- print "\n"
- if args.decode:
- Banner()
- dec = args.decode
- cleaninput = dec.replace("\\","")
- cleaninput = dec.replace("x","")
- print "shellcode => ",dec
- print "hex => ",cleaninput
- print "plaintext => ",
- print "\b"+cleaninput.decode("hex")
Add Comment
Please, Sign In to add comment