Skip to content

Instantly share code, notes, and snippets.

@leonjza
Created August 13, 2014 15:54
Show Gist options
  • Save leonjza/24e53bf704ce775adfdd to your computer and use it in GitHub Desktop.
Save leonjza/24e53bf704ce775adfdd to your computer and use it in GitHub Desktop.
Flick parsebanner.py
#!/usr/bin/python
import base64
import binascii
# first empty string
string = ''
with open('banner.txt','r') as f:
for line in f.read():
string += line.rstrip()
# decoded 0x
decoded = [x.decode("hex") for x in string.split("\\x")]
base_six_four = ''.join(decoded)
print base_six_four
# reiterate over base64
un_base64d = base_six_four
while True:
try:
base64.decodestring(un_base64d)
except binascii.Error:
break
un_base64d = base64.b64decode(un_base64d)
print un_base64d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment