Skip to content

Instantly share code, notes, and snippets.

@SomberNight
Created June 16, 2018 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SomberNight/2482f94b2a29b11f15bf096bf3633fc9 to your computer and use it in GitHub Desktop.
Save SomberNight/2482f94b2a29b11f15bf096bf3633fc9 to your computer and use it in GitHub Desktop.
Electrum Android wallet file: bruteforce 6-digit PIN
# 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