Bitcoin Forum
November 08, 2024, 08:56:14 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BitCoin Core wallet Password Recovery help  (Read 196 times)
fr4gn4tic (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 30, 2018, 02:17:24 PM
 #1

Hi Guys, i have lost my BitcoinCore Password or Change it and dont remeber it.
I use many times the same Password with different numbers and at the end some symbol like ! or ?.

This script is working fine for me, but can someone help me please that the script ever put the Symbols at the end of the Password like "Passw0rd!".
It would helping me alot and saves much time.

I try to rewrite the script but i break it every time ;(


I talk about this script, i have found this Script here in the forum:



German:

Hi zusammen, könnte mir bitte jemand helfen das Script so anzupassen das er immer an das ende von den Wort/Zahl Kombinationen die Sonderzeichen setzt und nicht mittendrin.
Also so zum Beispiel: Password1234!
Das Script läuft super bei mir, leider benötigt das generieren der 100% Falschen Passwörter die z.b so ausehen "Passw0rd12!34" also mit dem sonderzeichen in der Mitte zu viel Zeit.
Ich habe es schon selbst versucht also das Script anzupassen, leider ohne erfolg.

Vielen Dank  Smiley


Code:
# Bitcoin encrypted wallet somewhat-brute-force-recovery.
# Also works for litecoins probably (untested).
# By Rahazan
#
# Originally created for veryveryinteresting (VVI)
# https://bitcointalk.org/index.php?topic=85495.120
# My first ever powershell script, by the way.
# Pardon any convention I broke in this language (for I did not study any conventions of this language).

################################################################
# Recovered your coin     using this? Consider a donation to   #
# the AI student who scripted this :)                          #
# Donations BTC:    1FkXY2WVG9X4WqVuKdrSrX64ZTj9HgG34U         #
# Donations LTC:    LKdLS4seKpE2MNmt4t618oZV7v7tNkD6zL         #
################################################################
 Function Pause($M="Press any key to continue . . . "){If($psISE){$S=New-Object -ComObject "WScript.Shell";$B=$S.Popup("Click OK to continue.",0,"Script Paused",0);Return};Write-Host -NoNewline $M;$I=16,17,18,20,91,92,93,144,145,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183;While($K.VirtualKeyCode -Eq $Null -Or $I -Contains $K.VirtualKeyCode){$K=$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")};Write-Host}

######################################################
# How does it work?
######################################################

# This script creates every possible combination in a depth-first order.
# After this it tries all of these. On my crappy laptop it achieved ~ 5 attempts per second.

######################################################
# How do I use this?
######################################################

# - Edit the values in the next block of this script to your likings, make sure you set your RPC password & username.
# - Run the daemon service found in Bitcoin\daemon  (bitcoind.exe)
# - Run this script (save as SOMENAME.ps1 and right click -> run with PowerShell.
# (To run it you might have to change some settings regarding allowing PowerShell scripts to run.. Google this.)
# (Press CTRL+C to cancel if you wish to stop it.)
# - Grab a cup of coffee as it tries a gazillion combinations.
# - Get your coin back.
# - Maybe donate a portion? ;)
# - DELETE THIS SCRIPT (Shred it!). It holds way too valuable information about your password!


######################################################
#Values you will probably want to set!
#Please note that the more free you make these variables, computation time will increase by A LOT.
######################################################

# Min/Max length of your password (included! so min:1 max: 3 would allow password length 1 but also length 3)
# So if you know the length, these should both be the same number.
[int] $global:minLength = 15
[int] $global:maxLength = 16

# If you know what your password starts with, enter it here!
[string]$startsWith = "Passw0rd";

1
#Word list
$wordsList = @('')
[int] $numWords = 1 #Amount of times one of these word blocks can exist in your pass

#Symbol list
$symbolList = @('!')
[int] $numSymbols = 1 #Amount of times one of these symbol blocks can exist in your pass

#Number list
$numberList = @('0','1','2','3','4','5','6','7','8','9') #Possible numbers, do not have to be single numbers. For instance it could be just "22" if you know you have that in your pass somewhere with numNumbers 1
[int] $numNumbers = 4 #Amount of times one of these number blocks can exist in your pass

#Option to print when adding a possibility to the list of possibilities.
#Consider making this false, it might make it somewhat faster (especially for very long passwords with small "blocks" in the lists.
$verbose = $FALSE

#Only if you are unsure the algorithm does what it is supposed to do, will slow it down!
#Will show you the current word and the depth of the recursion.
$global:debug = $true


# Please put the correct RPC username/password below
$h = new-object Net.WebClient
$h.Credentials = new-object Net.NetworkCredential('bitcoinrpc','FSkme14F')
$h.Encoding = [Text.Encoding]::Default
# Above "Default" works for original encryption from the command line
# Change to "UTF8" when the GUI was used to encrypt (Was not necessary when tested -Rahazan)

[string[]]  $global:allPossibilities = @() #Empty array, you can manually add possibilities if you want (that you think will not be generated by the algorithm).

######################################################
# Time to create an array of all the possibilities! No need to change anything past this point.
######################################################

# Algorithm is next, it recursively builds the array of all possibilities.

Function generateAllPossibilities([string]$wordSoFar, $wordsList, $symbolList, $numberList, [int]$numWords, [int]$numSymbols, [int]$numNumbers, [int]$depth)
{

    if ($global:debug -and $wordSoFar.length -le $global:maxLength) {
        Write-Host ""
        for ($i = 0; $i -lt $depth; $i++) {
            Write-Host -NoNewline " "
        }
        Write-Host -NoNewline $wordSoFar " " $depth
    }
   
    #Base case: Length of the created pass is too big, no need to further explore this node, go up one step in the tree.
if ($wordSoFar.length -gt $global:maxLength) {
        #Too long! Done with this branch!
        return
    }
   
   #Add the word to the possibilities if the right length
if ($wordSoFar.length -gt $global:minLength) {
$global:allPossibilities += $wordSoFar
}
    #Word is max length, no point in adding anything else to it!
    if ($wordSoFar.length -eq $global:maxLength) {
        return
    }
if ($numWords -gt 0) {#Have not added max amount of words to this possibility yet.
        for ($i=0;$i -lt $wordsList.length; $i++) {
      generateAllPossibilities ($wordSoFar+$wordsList[$i]) $wordsList $symbolList $numberList ($numWords-1) $numSymbols $numNumbers ($depth+1)
        }
}
   
if ($numSymbols -gt 0) {#Have not added max amount of symbols to this branch yet.
for ($i=0;$i -lt $symbolList.length; $i++) {
       
          generateAllPossibilities ($wordSoFar+$symbolList[$i]) $wordsList $symbolList $numberList $numWords ($numSymbols-1) $numNumbers ($depth+1)
    #  generateAllPossibilities ($wordSoFar + $symbolList[$i]) $wordsList $symbolList $numberList $numWords ($numSymbols-1) $numNumbers ($depth+1)
        }
}

if ($numNumbers -gt 0) {#Have not added max amount of nums to this branch yet.
for ($i=0;$i -lt $numberList.length; $i++) {
      generateAllPossibilities ($wordSoFar + $numberList[$i] ) $wordsList $symbolList $numberList $numWords $numSymbols ($numNumbers-1) ($depth+1)
        }
}

}


Write-Host "Generating all possibilities, may take a long time depending on the amount + size of the \"blocks\" you have given !"

#Calling the algorithm (function) above to fill the list!
generateAllPossibilities $startsWith $wordsList $symbolList $numberList $numWords $numSymbols $numNumbers 0

Write-Host "DONE Generating!"
Write-Host "Note: There seems to be a slight bug, about 1 in 100 of these strings break the rules (for instance 2 symbols where numSymbols was 1).. don't know why."
Write-Host "Will be printing all possibilities now:"

Write-Host $global:allPossibilities

Write-Host "===================="
Write-Host "Amount to be tested:"  $global:allPossibilities.length
Write-Host "Starting bruteforce!"
Write-Host "===================="
######################################################
# Time to start trying them one by one!
######################################################

$i = 0

# Somewhat altered code by 2112 -> from https://bitcointalk.org/index.php?topic=85495.msg1756901#msg1756901
$global:allPossibilities | foreach {
    $i++
    try {
        $p = $_
       
        if ($i%4 -eq 0) {
            Write-Host "   '$p' " $i "/" $global:allPossibilities.length
        }
        else {
         Write-Host "   '$p'" -nonewline
        }
       
        $r = $h.UploadString('http://localhost:8332/','{"method":"walletpassphrase","params":["'+$p+'",1]}')
        # Write-Output $r
        Write-Output "Correct password found!:" $p
        Write-Output "'$p'"
        Write-Output "Remember to delete this script as it cointains (too) valuable info about your passphrase, write it down!"
        Pause("a")
       
        break
    }
    catch [Net.WebException] {
        $e = $_
        switch -wildcard ($e.Exception.Message) {
             "*(401) Unauthorized*" {
                  Write-Output "Fix the user/pass!"
                  Exit-PSSession
             }
             "*(500) Internal Server Error*" {
                  continue
             }
             default {
                  $e | Format-List -Force
                  Exit-PSSession
            }
        }
    }
}
#
# Exiting without success!
#
Write-Output "===================="

Write-Output "Exiting!"

teddy5145
Hero Member
*****
Offline Offline

Activity: 714
Merit: 528


View Profile
March 30, 2018, 02:32:14 PM
 #2

I'm not sure if this the right section.
Anyway, you might want to contact the guy who created the script, since he's from Bitcointalk it should be easy to contact him via PM.
Otherwise, just try to brute force it via this script and wait Roll Eyes
You can also edit these values to optimize the script
Quote
# Min/Max length of your password (included! so min:1 max: 3 would allow password length 1 but also length 3)
# So if you know the length, these should both be the same number.
[int] $global:minLength = 15
[int] $global:maxLength = 16
Only use this if you know the length of your password.
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
March 30, 2018, 02:58:31 PM
 #3

You have two options to achieve the functionality.

The first would be to use btcrecover (https://github.com/gurnec/btcrecover).
It allows to create a token file to reach all of your criteria. You can read about the token file here: https://github.com/gurnec/btcrecover/blob/master/TUTORIAL.md#the-token-file

The second would be to modify the function generateAllPossibilities in your script.
Simply add another argument (the lost character).

Or just iterate through the wordlist (created without your special character) and add your char at the end of each combination.

fr4gn4tic (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 30, 2018, 03:18:35 PM
Last edit: March 30, 2018, 11:53:50 PM by fr4gn4tic
 #4

Thanks for the fast Response.

I know my Password starts with Passw0rd then it must be a 4 Digit Numer and a Symmbol !
Like Passw0rd1234!

I will try to contact the Author and hope he can help me out.



Quote
The second would be to modify the function generateAllPossibilities in your script.
Simply add another argument (the lost character).

Or just iterate through the wordlist (created without your special character) and add your char at the end of each combination.


I give it a try, the wordlist is a good idea, dont got it.

I will reply if i found my Password Wink


UPDATE:

For all who have the same Password "Style" like me this is the Tokenlist in btcrecover look like this.

My Password: MYPassword1234!

This is my Tokens.txt: MYPassword%4,4d%y

I try to explain:

%4,4d = 0000 - 9999
%y = One Symbol like this ! or " or § or &

If you dont know exactly you have used 1,2 or 4 digits in your Password you can use %1,4d so it will test 1-9999.


Thanks for the Help, now i need to wait i get around 2.28kP/s with my Nvidia GTX 1060 i think this will take some time.





HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
March 31, 2018, 02:10:16 AM
 #5

Seems like 10,000 * number of symbols... shouldn't be too bad... especially if you actually specify the set of likely symbols using %[symbols], rather than just using the %y wildcard.

Something like:
MYPassword%4,4d%[~!@#$%^&*?]

That'll be like 100,000 combinations which should only take around 50 seconds if you're testing over 2,000 passwords/second

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!