Created
October 25, 2017 14:22
-
-
Save kkirsche/2dff0907a2774067493d6c92306630b3 to your computer and use it in GitHub Desktop.
Decode base64 and convert to hex format, like shellcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from base64 import b64decode | |
from urllib import unquote | |
base64_strs = ['xU5LNJhXeo9B6o4Ri%2FxFHodARXWqgtNufNrYzqG05nGOLNboDgJtkw%3D%3D', | |
'%2BjAd73J7RAZgLxAUkIG5l0cMPLQEBAtZRMP3WdXr1%2BMYdrg2cZKaow%3D%3D'] | |
for bstr in base64_strs: | |
unquoted_bstr = unquote(bstr) | |
data = b64decode(unquoted_bstr) | |
bl = [] | |
for char in data: | |
mm = int(char.encode('hex'), 16) | |
bl.append(hex(mm)) | |
print(' '.join(bl)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment