Created
June 16, 2018 02:30
-
-
Save SomberNight/2482f94b2a29b11f15bf096bf3633fc9 to your computer and use it in GitHub Desktop.
Electrum Android wallet file: bruteforce 6-digit PIN
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
# note: for good perfomance, have pycryptodome installed | |
# (about 20x faster than pyaes for this). | |
# for ref, it takes about 60 seconds to scan the whole domain for me with pycryptodome. | |
import electrum | |
from electrum.wallet import Wallet | |
from electrum.storage import WalletStorage | |
storage = WalletStorage('path_to_wallet_file') | |
wallet = Wallet(storage) | |
def test_password(x): | |
try: | |
wallet.keystore.get_seed(x) | |
except: | |
return False | |
else: | |
return True | |
for pw_int in range(10**6): | |
if pw_int % 5000 == 0: | |
print("checking:", pw_int) | |
pw_str = '{0:06d}'.format(pw_int) | |
if test_password(pw_str): | |
print("found pw!", pw_str) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment