Last active
January 18, 2016 10:23
-
-
Save fblundun/ad8d377918260f96eb03 to your computer and use it in GitHub Desktop.
List strings which may appear when a target string is base 64-encoded
This file contains 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/python | |
import base64 | |
import sys | |
input = sys.argv[1] | |
drop = [0, 2, 3] | |
def get_combinations(s): | |
return [(base64.urlsafe_b64encode('a'*i + s)[drop[i]:]).replace('=', '') for i in range(3)] | |
for x in [get_combinations(sys.argv[1])]: | |
for y in x: | |
print(y) |
This file contains 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/python | |
import base64 | |
import sys | |
input = sys.argv[1] | |
def get_combinations(s): | |
return [base64.urlsafe_b64encode('a'*i + s)[2*i:-4] for i in range(3)] | |
for x in [get_combinations(sys.argv[1])]: | |
for y in x: | |
print(y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample usage: