Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Jutarul on October 07, 2012, 05:06:45 PM



Title: Wallet Brute Force Cracker
Post by: Jutarul on October 07, 2012, 05:06:45 PM
Hi,

is there an open-source wallet brute force cracker, which takes the input from a wordlist file and reports the successful passphrase?
It is not uncommon for people to lose part of their passphrase and they need to test a few 10000 variations.

A feasible solution right now is to use the RPC interface and wrap it in a script, this way I achieve about 10 trial keys per second. So if the wordlist is < 100,000 keys, a full scan should be completed in about 3-4 hours. (since the procedure is embarrassingly parallel you can easily increase the cracking speed, e.g. 1000 instances should give you about 25 million trial keys / hour)

procedure:
0) create a wordlist with one of the major password cracking tools (e.g. john the ripper)
1) run bitcoind as a server with RPC active
2) adjust the following python script to your operating system and environment (link:http://ubuntuone.com/7XJaHf4OH4Ak91DUGhscvG (http://ubuntuone.com/7XJaHf4OH4Ak91DUGhscvG)):
Code:
import subprocess
import sys

wordfile=open(sys.argv[1],"r")
logfile=open(sys.argv[2],"a")

for l in wordfile:
 sys.stdout.write("trying %s" % l)
 w=l.strip()
 p=subprocess.Popen(['./bitcoind','walletpassphrase',w,"1"],stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
 s=p.communicate()[0]
 if ("incorrect" in s):
  logfile.write("%s: incorrect\n" % (w))
 elif ("unlocked" in s):
  logfile.write("%s: unlocked\n" % (w))
 else:
  logfile.write("%s: likely passphrase\n" % (w))
  print "success!"
  print "likely passphrase: %s" % (w)
  break

logfile.close()
3) run the script local to your bitcoin directory:
Code:
python crack.py wordlist.txt log.txt

I'd appreciate if people could extend this thread by explicit instructions for their specific operating system and environment.


Title: Re: Wallet Brute Force Cracker
Post by: Revalin on October 07, 2012, 06:25:42 PM
Related: I wrote a brute force script that takes your best guess at the passphrase and tries possible typos.

https://bitcointalk.org/index.php?topic=85495.msg942171#msg942171