Pages:
Author

Topic: Encrypted wallet.dat, lost password, any solutions? - page 4. (Read 213600 times)

member
Activity: 84
Merit: 10
A very hot topic Smiley
hero member
Activity: 784
Merit: 500
btchris, is there any btcrecover official thread yet, isn't?

I configured easily the GPU accelerated recovery over Windows 7 64bit. Nowadays I used as recommended all 32bit stuff, I will try the 64bit and Linux configuration later.

The setup is: Asrock H81 Pro BTC, Intel G3220, 2x 4GB RAM, 3x MSI R9 280X Twin Frozr with stock clocks.

Best results were with all combinations of --global-ws 32768, 65536 and --local-ws 64, 128, 256 averaging 11.25 kP/s. Pretty fast stuff.

Anyone have some other benchmarks to compare?

newbie
Activity: 1
Merit: 0
Need some help (but I have a feeling that no one will help me, the password is too long ...).





I used this script:

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

# Fill in your RPC username and password from your bitcoin.conf here.
$rpc_auth = "user", "pass"

max_bangs = 10
words = [
  [ "one"   , "One"   , "ONE"]   ,
  [ "two"   , "Two"   , "TWO"]   ,
  [ "three" , "Three" , "THREE"] ,
  [ "four"  , "Four"  , "FOUR"]  ,
]

def test(passphrase)
  puts passphrase
  request = Net::HTTP::Post.new("/")
  request.basic_auth *$rpc_auth
  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

def spin(phrase, array)
  return phrase if array.empty?
  array.first.map do |word|
    p = phrase.dup.push word
    spin(p, array[1,99])
  end
end

spin([], words).flatten(words.count - 1).each do |phrase|
  phrase.permutation(words.count) do |shuffled|
    (max_bangs + 1).times do |bangs|
      test shuffled.join(" ") + ("!" * bangs)
    end
  end
end

puts "No luck."


but script changes the order of the words and significantly prolongs the whole process.

3412

I do not believe in the success of the recovery password, but if you help me to recover a password that you will not regret ...


Greg

(google translate)
newbie
Activity: 9
Merit: 0
1) Go to http://rubyinstaller.org/downloads/ and download Ruby 2.0.0-p353. Once the file has downloaded, run the installer. Restart your computer.
 
2) COPY the code below and paste it into Notepad. Save the file as “brute.rb” (including the quotation marks – this is so Notepad doesn't automatically save it as a .txt.) Make sure the file is in the same folder as your protoshares-qt.exe file (this is for convenience later).

The following code is modified very slightly from the original code written by Revalin, but since he doesn't charge for his services, I hope he doesn't mind me using his code for this tutorial.

Code:
#!/usr/bin/ruby
require 'base64'
require 'digest/sha2'
require 'open3'
require 'openssl'
# Put your best guess at your passphrase here
passphrase = 'Oops I forgot'
# The full path to your Protoshares wallet file
wallet_file = ''
# Where to find Protoshares-qt client.
$protoshares = ''
def test(phrase)
 $cipher.reset
 $cipher.key = Digest::SHA256.digest(Digest::SHA256.digest(phrase))
 $cipher.update $seed
 $cipher.final
 puts phrase
 i,o,t = Open3.popen2e($protoshares, "-o", "getseed")
 i.puts(phrase)
 i.close
 if t.value.success?
  puts "Found it! #{phrase}"
  exit
 end
rescue OpenSSL::Cipher::CipherError
end
def scramble(passphrase)
 characters = " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
 list = []
 # transpose adjacent chars
 (passphrase.length - 1).times do |i|
  testphrase = passphrase.dup
  testphrase[i] = passphrase[i+1]
  testphrase[i+1] = passphrase[i]
  list << testphrase
 end
 # delete one char
 passphrase.length.times do |i|
  testphrase = passphrase.dup
  testphrase = testphrase[0,i] + testphrase[(i+1)..-1]
  list << testphrase
 end
 # substitutute one char
 passphrase.length.times do |i|
  characters.chars.each do |c|
   testphrase = passphrase.dup
   testphrase[i] = c
   list << testphrase
  end
 end
 # insert one char
 (passphrase.length + 1).times do |i|
  characters.chars.each do |c|
   testphrase = passphrase.dup
   testphrase.insert(i, c)
   list << testphrase
  end
 end
 return list.uniq
end
wallet = File.read(wallet_file)
seed_base64 = wallet.match(/'seed': '([^']+)'/).captures.first
$seed = Base64.decode64(seed_base64)
$cipher = OpenSSL::Cipher.new('aes-256-cbc')
$cipher.iv = $seed.slice!(0,16)
Dir.chdir File.dirname $protoshares
list1 = scramble(passphrase)
list1.each { |i| test i }
list1.each { |i| scramble(i).each { |j| test j }}
puts "No luck."
exit 1

4) EDIT brute.rb, filling in these values:
1. At the top; where the code says “oops I forgot”, edit this to be the password you believe should work for your wallet.
2. Inside the quotes after “$wallet_file =”, insert the full path to your wallet.dat file for protoshares-qt (e.g. C:\Protoshares\wallet.dat)
3. Inside the quotes after “$protoshares”, insert the full path to the protoshares-qt.exe file. (e.g. C:\Protoshares\protoshares-qt.exe)

5) Go to the start menu and choose “run...”

6) Type “cmd” and press enter

7) In the big black window that appears, type “cd”, followed by a space, and then the full path to the folder that proshares-qt.exe is in. E.g. “cd C:\Protoshares\”)

Cool Type the following, then press enter.

Code:
protoshares-qt -server -rpcpassword=some-password -rpcport=3838

9) Finally, type brute.rb and wait.


Hi thanks for your help so far couple of things I wanted to check.

I edited the file at the start while it was still in txt format and then saved to "brute.rb" is this correct? I couldn't find a way to edit it once I'd saved it as "brute.rb"

The part in the CMD window where you type rpcpassword=some-password what do I need to type in here? do I have to create a .conf file in the same file as the wallet.dat?

On the last step, I've tried using windows CMD and the Ruby version at step 8 I press enter and the protoshares-qt opens when I then type brute.rb in the CMD window and press enter I get the following message

C:\"filepath"\brute.rb:62:in '
' : undefined method 'captures' for nil:NILClass

Old post and old thread, but I found this browsing the web. having same error. any idea?
legendary
Activity: 1722
Merit: 1000
Did the OP get his BTC back.. with a 50-100 BTC reward that must of been a large amount of BTC :S.
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
Did you install Python 3 or Python 2? btcrecover requires Python 2, preferably the latest version (2.7.10 as of today).

I have Python 3.4.3. I guess I should use the one.

You can install Python 2.7 alongside 3.4 (if you need Python 3 for some other reason). Just change the install directory to a different location, e.g. C:\Python2, during installation. btcrecover depends on a number of features that were removed from Python 3 (although it would benefit from certain other features added to Python 3, it was a trade-off...).
legendary
Activity: 1647
Merit: 1012
Practising Hebrew before visiting Israel
BTChris,

I get

Code:
Traceback (most recent call last):
  File "C:\Users\me\Desktop\btcrecover-master\btcrecover.py", line 52, in
    import sys, argparse, itertools, string, re, multiprocessing, signal, os, cPickle, gc, \
ImportError: No module named 'cPickle'

with BTCRecover.

Did you install Python 3 or Python 2? btcrecover requires Python 2, preferably the latest version (2.7.10 as of today).

I have Python 3.4.3. I guess I should use the one.
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
BTChris,

I get

Code:
Traceback (most recent call last):
  File "C:\Users\me\Desktop\btcrecover-master\btcrecover.py", line 52, in
    import sys, argparse, itertools, string, re, multiprocessing, signal, os, cPickle, gc, \
ImportError: No module named 'cPickle'

with BTCRecover.

Did you install Python 3 or Python 2? btcrecover requires Python 2, preferably the latest version (2.7.10 as of today).
legendary
Activity: 1647
Merit: 1012
Practising Hebrew before visiting Israel
BTChris,

I get

Code:
Traceback (most recent call last):
  File "C:\Users\me\Desktop\btcrecover-master\btcrecover.py", line 52, in
    import sys, argparse, itertools, string, re, multiprocessing, signal, os, cPickle, gc, \
ImportError: No module named 'cPickle'

with BTCRecover.
legendary
Activity: 1540
Merit: 1060
May the force bit with you.
Here, I whipped up something quick and dirty.  Just fill in your passphrase as close as you can remember, and make sure bitcoind is in the current dir.  It should print lots of "The wallet passphrase entered was incorrect" if it's working.


Code:
#!/usr/bin/ruby -w

passphrase = "oops"
characters = " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"

def test(phrase)
  print phrase, "\t"
  msg=`openssl enc -d -aes-256-cbc -a -in bitcoin-wallet-backup-2014-12-06 -k #{phrase} |tr -cd "[:print:]" | awk '{print $1}'`
  msg = msg.chomp
  if msg == "org.bitcoin.production"
    puts "Found it!  #{phrase}"
    exit 0
  end
end

# transpose adjacent chars
(passphrase.length - 1).times do |i|
  testphrase = passphrase.dup
  testphrase[i] = passphrase[i+1]
  testphrase[i+1] = passphrase[i]
  test testphrase
end

# delete one char
passphrase.length.times do |i|
  testphrase = passphrase.dup
  testphrase = testphrase[0,i] + testphrase[(i+1)..-1]
  test testphrase
end

# substitutute one char
passphrase.length.times do |i|
  characters.chars.each do |c|
    testphrase = passphrase.dup
    testphrase[i] = c
    test testphrase
  end
end

# insert one char
(passphrase.length + 1).times do |i|
  characters.chars.each do |c|
    testphrase = passphrase.dup
    testphrase.insert(i, c)
    test testphrase
  end
end


puts "No luck."
exit 1


Good luck!

edit: This also requires a running bitcoind.
1. set "rpcpassword=somerandomcrap" in .bitcoin/bitcoin.conf
2. run "./bitcoind -daemon"
3. run "./bitcoind getinfo" until it starts returning data instead of errors
4. then run the script above.

Just wanted to say thanks for this. I had lost(mistyped) my Android backup wallet password. And I slightly modified this script (as shown). And I as able to get the correct password in a matter of seconds.  First time with ruby, so I cheated with some system calls. But it did the job, albeit it made a few crazy files in the process. Thanks!!
full member
Activity: 196
Merit: 100
Is there a space between the "#" and the "--" ? There can't be a space there... (actually I just now uploaded a fixed version that no longer minds extra spaces there so that nobody else gets tripped up with this).
i will check that but in the manual you explained that it needed a space to work.

Did I? From the manual here, it says "must begin with exactly #--". Maybe there's somewhere else I missed? I guess it doesn't really matter now that it works either way, though...


edit: now the problem i have is when i execute the script it says" unrecognized arguments: tokens.txt" i am doing something wrong with the token list file. does every possible password have to be in different lines?

I should have noticed that from your first response, sorry Roll Eyes

If you want to use the btcrecover-tokens-auto.txt feature, do not use a separate tokens.txt file. Remove "--tokenlist tokens.txt" from the first line, and then take the contents of the tokens.txt file and place them inside the btcrecover-tokens-auto.txt file after the first line so that it looks something like this, all in one file:

Code:
#--wallet wallet1.dat--autosave savefile
pass Pass
word Word

(which would try these passwords, where "pass" and "Pass" never appear together, "word" and Word" never appear together, but all the other combinations are tried:

Code:
pass
Pass
word
wordpass
password
wordPass
Password
Word
Wordpass
passWord
WordPass
PassWord
)

great, manage to do it  Cheesy

now the problems is that after checking for less than a minute it says out of memory, becuase it found 12800000 passwords  Huh. also it nitices that the dupchecks options will reduce memory usage.... and then it stops  Sad

edit: i took out some passwords that they were very similar and now it's going fine. hope to find the password
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
Is there a space between the "#" and the "--" ? There can't be a space there... (actually I just now uploaded a fixed version that no longer minds extra spaces there so that nobody else gets tripped up with this).
i will check that but in the manual you explained that it needed a space to work.

Did I? From the manual here, it says "must begin with exactly #--". Maybe there's somewhere else I missed? I guess it doesn't really matter now that it works either way, though...


edit: now the problem i have is when i execute the script it says" unrecognized arguments: tokens.txt" i am doing something wrong with the token list file. does every possible password have to be in different lines?

I should have noticed that from your first response, sorry Roll Eyes

If you want to use the btcrecover-tokens-auto.txt feature, do not use a separate tokens.txt file. Remove "--tokenlist tokens.txt" from the first line, and then take the contents of the tokens.txt file and place them inside the btcrecover-tokens-auto.txt file after the first line so that it looks something like this, all in one file:

Code:
#--wallet wallet1.dat--autosave savefile
pass Pass
word Word

(which would try these passwords, where "pass" and "Pass" never appear together, "word" and Word" never appear together, but all the other combinations are tried:

Code:
pass
Pass
word
wordpass
password
wordPass
Password
Word
Wordpass
passWord
WordPass
PassWord
)
full member
Activity: 196
Merit: 100
i have the tokens file for the passwords and i have the following command in btcrecover-tokens-auto.txt file:

# --wallet wallet1.dat --tokenlist tokens.txt --autosave savefile

this is in a .txt file and i am using the .py file as a command. i am not sure if i am experssing myself correctly.

thanks

Is that all on the first line? It can't be on any other line...

Is there a space between the "#" and the "--" ? There can't be a space there... (actually I just now uploaded a fixed version that no longer minds extra spaces there so that nobody else gets tripped up with this).

i will check that but in the manual you explained that it needed a space to work. i will try later because it had a space between. and yes, all is in the same line. i just have that line in the txt file.

thanks

edit: now the problem i have is when i execute the script it says" unrecognized arguments: tokens.txt" i am doing something wrong with the token list file. does every possible password have to be in different lines?
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
i have the tokens file for the passwords and i have the following command in btcrecover-tokens-auto.txt file:

# --wallet wallet1.dat --tokenlist tokens.txt --autosave savefile

this is in a .txt file and i am using the .py file as a command. i am not sure if i am experssing myself correctly.

thanks

Is that all on the first line? It can't be on any other line...

Is there a space between the "#" and the "--" ? There can't be a space there... (actually I just now uploaded a fixed version that no longer minds extra spaces there so that nobody else gets tripped up with this).
full member
Activity: 196
Merit: 100
hi chris,

i am trying to use your software but i don't know why i am always having the error that --wallet is required and suposedly is correct, i followed all the steps and later tried different options but always the same error. what i am doing wrong?

thanks mate.

Hi.

Could you show exactly what command you're typing in, and also exactly what the error message is please?

i have the tokens file for the passwords and i have the following command in btcrecover-tokens-auto.txt file:

# --wallet wallet1.dat --tokenlist tokens.txt --autosave savefile

this is in a .txt file and i am using the .py file as a command. i am not sure if i am experssing myself correctly.

thanks
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
hi chris,

i am trying to use your software but i don't know why i am always having the error that --wallet is required and suposedly is correct, i followed all the steps and later tried different options but always the same error. what i am doing wrong?

thanks mate.

Hi.

Could you show exactly what command you're typing in, and also exactly what the error message is please?
full member
Activity: 196
Merit: 100
EDIT: I got it!!!  Program worked flawlessly!

That's great, I'm glad it helped!!

For future reference, how WOULD you add a "$" into the token list?

You can use this escape sequence which will be replaced by a single "$": $S
(You only need to use it if you want a $ at the end of a token.) Here are the docs on which special characters need escape sequences: https://github.com/gurnec/btcrecover/blob/master/docs/Limitations_and_Caveats.md#delimiters-spaces-and-special-symbols-in-passwords

PS.  I sent some btc your way to 17LGpN2z62zp7RS825jXwYtE7zZ19Mxxu8 which was listed at github.
THANKS!!!!

Awesome, thank you so much!!! Cool

-Chris

hi chris,

i am trying to use your software but i don't know why i am always having the error that --wallet is required and suposedly is correct, i followed all the steps and later tried different options but always the same error. what i am doing wrong?

thanks mate.
full member
Activity: 182
Merit: 100
DaDice! Next Generation Dice Game
did u suveed in recovering your bitcoins yet.
sr. member
Activity: 322
Merit: 250
Did this issue be solved? it has past 3 years.
                                                                                     
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
EDIT: I got it!!!  Program worked flawlessly!

That's great, I'm glad it helped!!

For future reference, how WOULD you add a "$" into the token list?

You can use this escape sequence which will be replaced by a single "$": $S
(You only need to use it if you want a $ at the end of a token.) Here are the docs on which special characters need escape sequences: https://github.com/gurnec/btcrecover/blob/master/docs/Limitations_and_Caveats.md#delimiters-spaces-and-special-symbols-in-passwords

PS.  I sent some btc your way to 17LGpN2z62zp7RS825jXwYtE7zZ19Mxxu8 which was listed at github.
THANKS!!!!

Awesome, thank you so much!!! Cool

-Chris
Pages:
Jump to: