Created
August 8, 2012 13:24
-
-
Save amro/3294999 to your computer and use it in GitHub Desktop.
Rudimentary Android Keystore Password Recovery Script
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/env ruby | |
# USE AT YOUR OWN RISK | |
# This script stops when it hits the correct | |
# password (you'll see keytool's "New Password:" prompt) | |
# If it makes it through all permutations without a match, | |
# then tweak your input. Oh, and it's not particularly fast. | |
# Note the empty strings at the end of each array to | |
# try leaving out those parts | |
prefix = ['your', 'possible', 'prefixes', ''] | |
mid = ['some','possible','mid', ''] | |
mid_two = ['other', 'possible', 'mid parts', ''] | |
suffix = ['suffixes', 'go', 'here', ''] | |
prefix.each do |pre| | |
mid.each do |mid| | |
mid_two.each do |mid_t| | |
suffix.each do |suf| | |
pw_to_test = pre + mid + mid_t + suf | |
puts "trying password #{pw_to_test}" | |
# Set change "YOUR_ANDROID_KEYSTORE" to the name of your key store file | |
command = "keytool -storepasswd -keystore YOUR_ANDROID_KEYSTORE.key -storepass '" + pw_to_test + "'" | |
f = IO::popen(command) | |
r = f.readlines | |
f.close | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment