Post
Topic
Board Bitcoin Technical Support
Re: Encrypted wallet.dat, lost password, any solutions?
by
madmooseman
on 12/12/2013, 10:40:42 UTC
Quote
type ruby brute.rb

The script should start running and you will see it fill with lines of attempted and failed passphrases. If it succeeds, it stops running and prints Found it! youractualpasscode

*Note: for step 4 above, I still do not know the proper way to make a config file for windows 7. I struggled with this and finally got something to work. If anyone can give some simple and complete instructions please add them.

I assume with this you have to navigate to the folder where brute.rb is?

Whether I run it on windows or ubuntu, I have the same problem - it says that my RPC password is incorrect, even when copying the password from the file.

It does try one guess first, but it isn't correct.

Here is the code I'm running (with my passwords censored)

Code:
#!/usr/bin/ruby
require "net/http"
require "json"

$rpc_pass = "rpc-pass"
words = ['pass1', 'pass2', 'pass3', 'pass4']
max_words = 4

def test(passphrase)
  puts passphrase.inspect
  request = Net::HTTP::Post.new("/")
  request.basic_auth "", $rpc_pass
  request.body = { method:"walletpassphrase", params:[passphrase, 1] }.to_json
  response = Net::HTTP.new("localhost", 8332).request(request)
  if response.code == "401" ; puts "Incorrect RPC user/pass" ; exit 1 ; end
  ret = JSON.parse response.body
  if ret["error"].nil? ; puts "\nFound it! #{passphrase.inspect}" ; exit ; end
  return if ret["error"]["code"] == -14 # wrong passphrase
  raise "WTF? #{ret.inspect}"
end

(1..max_words).each do |n_words|
  words.permutation(n_words).each do |perm|
    [" ", ""].repeated_permutation(perm.count + 2).each do |j|
      test(["", *perm, ""].zip(j).join)
    end
  end
end

puts "No luck."

My problem is that I have a list of words, but I don't know the order.  I know that I used either 3 or 4 of these words.

I also have seen people saying to use John the Ripper on this, but I can't for the life of me work it out.

Alternatively, I can offer a "pretty decent" reward if someone can get it based on the lists of possible passwords, the mkey section of the wallet and whatever else you need (short of the wallet file itself).

Any help would be much appreciated.