Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: btcusury on September 27, 2021, 05:22:50 PM



Title: Forgotten wallet password: Is there a regex brute force program?
Post by: btcusury on September 27, 2021, 05:22:50 PM
Hi y'all! A friend has forgotten his password, already several years back before mnemonic backups, and the bitcoins are now worth quite something. He has some idea of what it might be, but it's millions of possible combinations, impossible for him to try sequentially, but trivial for a computer to process if the right regex pattern could be supplied given some knowledge of parts of the password.

Is there such a brute force program that could be used to try a regex against a wallet.dat file?


Title: Re: Forgotten wallet password: Is there a regex brute force program?
Post by: o_e_l_e_o on September 27, 2021, 05:39:50 PM
btcrecover is the software you are looking for.
You can find it here: https://github.com/3rdIteration/btcrecover
And its documentation here: https://btcrecover.readthedocs.io/en/latest/

You will essentially want to create a tokens file specifying the various strings which could be a part of the password and what combination of said strings to try, and then run it against your wallet.dat file. The instructions for how to do this are here: https://btcrecover.readthedocs.io/en/latest/tokenlist_file/

If you run in to any problems, let us know.


Title: Re: Forgotten wallet password: Is there a regex brute force program?
Post by: NotATether on September 27, 2021, 06:04:59 PM
Interesting question, OP. Such a program would indeed be useful but I am not aware of any programs that will brute force a wallet password by regex.

You will essentially want to create a tokens file specifying the various strings which could be a part of the password and what combination of said strings to try, and then run it against your wallet.dat file. The instructions for how to do this are here: https://btcrecover.readthedocs.io/en/latest/tokenlist_file/

Are you sure that BTCrecover will work with Bitcoin Core wallet.dats? I thought it could only recover Electrum seeds.


Title: Re: Forgotten wallet password: Is there a regex brute force program?
Post by: takuma sato on September 27, 2021, 06:16:58 PM
Interesting question, OP. Such a program would indeed be useful but I am not aware of any programs that will brute force a wallet password by regex.

You will essentially want to create a tokens file specifying the various strings which could be a part of the password and what combination of said strings to try, and then run it against your wallet.dat file. The instructions for how to do this are here: https://btcrecover.readthedocs.io/en/latest/tokenlist_file/

Are you sure that BTCrecover will work with Bitcoin Core wallet.dats? I thought it could only recover Electrum seeds.

Your best hope is probably hashcat:

https://hashcat.net/hashcat/

But you'll have to spend big bucks in a decent computer with a top tier gaming GPU by nvidia if you want any realistic chances of bruteforcing it. If the money lost is relevant then I would pick an 3080 RTX card or 3090 RTX if you can afford it. If you have no success bruteforcing at least you'll be able to play games at the highest settings.


Title: Re: Forgotten wallet password: Is there a regex brute force program?
Post by: o_e_l_e_o on September 27, 2021, 07:18:42 PM
Are you sure that BTCrecover will work with Bitcoin Core wallet.dats? I thought it could only recover Electrum seeds.
Yes, it will work. Its password recovery function works with a large array of wallets:

Bitcoin wallet password recovery support for:
  • Bitcoin Core
  • MultiBit HD and MultiBit Classic
  • Electrum (1.x, 2.x, 3.x and 4.x) (For Legacy and Segwit Wallets. Set --bip32-path "m/0'/0" for a Segwit wallet, leave bip32-path blank for Legacy... No support for 2fa wallets...)
  • Most wallets based on bitcoinj, including Hive for OS X
  • BIP-39 passphrases (Also supports all cryptos supported for seed recovery, as well as recovering "Extra Words" for Electrum seeds)
  • mSIGNA (CoinVault)
  • Blockchain.com
  • pywallet --dumpwallet of Bitcoin Unlimited/Classic/XT/Core wallets
  • Bitcoin Wallet for Android/BlackBerry spending PINs and encrypted backups
  • KnC Wallet for Android encrypted backups
  • Bither

It also supports both BIP39 and Electrum seed phrase descrambling, brute forcing, etc., both with and without additional passphrases, BIP38 paper wallets, and a bunch of altcoin wallets too, including Coinomi and Metamask.


Title: Re: Forgotten wallet password: Is there a regex brute force program?
Post by: NotATether on September 28, 2021, 04:58:43 AM
Your best hope is probably hashcat:

https://hashcat.net/hashcat/

But you'll have to spend big bucks in a decent computer with a top tier gaming GPU by nvidia if you want any realistic chances of bruteforcing it. If the money lost is relevant then I would pick an 3080 RTX card or 3090 RTX if you can afford it. If you have no success bruteforcing at least you'll be able to play games at the highest settings.

You can actually just rent a GPU rig from vast.ai for much cheaper if your brute-force operation will just take a few hours. They even have configurations with 5x and 8x GPUs, including ones from Google Cloud.


Title: Re: Forgotten wallet password: Is there a regex brute force program?
Post by: NotATether on September 30, 2021, 07:25:40 AM
You can try 20,000 passwords per second.

In practice, a high-end GPU searching solo can only search between 4K and 6K passwords per second because of heavy pbkdf2 operations.


Title: Re: Forgotten wallet password: Is there a regex brute force program?
Post by: dextronomous on November 20, 2021, 01:05:50 AM
Hi y'all! A friend has forgotten his password, already several years back before mnemonic backups, and the bitcoins are now worth quite something. He has some idea of what it might be, but it's millions of possible combinations, impossible for him to try sequentially, but trivial for a computer to process if the right regex pattern could be supplied given some knowledge of parts of the password.

Is there such a brute force program that could be used to try a regex against a wallet.dat file?


btcusury you still on the look for a program, i found this one very usefull, https://github.com/glv2/bruteforce-wallet

go try out, can do quite a lot with that one, some threadripper at it, and you got the coins. gl.