Skip to content

Instantly share code, notes, and snippets.

Created Apr 25, 2014
What would you like to do?
Egg 0x0e
#!/usr/bin/env python
import base64
import re
import urllib
import codecs
import binascii
def decode(text):
m = re.match("^\[(\d+):(\w+)\](.+)", text)
if not m:
return text
level =
enc =
payload =
print level, enc
if enc == "b64":
result = base64.b64decode(payload)
elif enc == 'b32':
result = base64.b32decode(payload)
elif enc == 'inv':
result = payload.swapcase()
elif enc == 'url':
result = urllib.unquote(payload)
elif enc == 'nop':
result = payload
elif enc == 'r13':
result = codecs.decode(payload, 'rot_13')
elif enc == 'xxx':
result = re.match('xxx(.+)xxx', payload).group(1)
elif enc == 'rev':
result = payload[::-1]
elif enc == 'hex':
result = binascii.unhexlify(payload)
return payload
return decode(result)
if __name__ == "__main__":
fh = open("source.txt")
source =
a = decode(source)
print a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment