A friend of mine lost one of his 12 mnemonics, so I am trying a brute-force recovery of his wallet. when i manually recover a wallet with 12 existing mnemonics, the cli works as expected. however when i try to automatize this part and when prompted write the mnemonics to stdin, the cli crashes or doesn’t receive the input as expected. before i dive too deep into rust and the cli source, any idea how to solve this?
cardano-cli wallet recover --daedalus-seed --derivation-scheme=v1 --mnemonics-length=12 --wallet-scheme=random_index_2levels MyWallet <<<"my 12 private words"
Please enter all your 12 mnemonics: my 12 private words
Set a wallet password. This is for local usage only, allows you to protect your cached private key and prevent from creating non desired transactions.
spending password: thread ‘main’ panicked at ‘called Result::unwrap() on an Err value: Os { code: 9, kind: Other, message: “Bad file descriptor” }’, src/libcore/result.rs:1165:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.
If he lost it, and no any long part of it with the correct order is known, then you CANNOT brute force it.
I mean you can try but it won’t happen in your and in long deep generations of your anchestors’ life.
Ok, but why stop at brute forcing only your friend’s wallet? I would go for the whales - obviously
As @_ilap mentionned, good luck to you and your grand, grand, grand-kids
he lost the last one of 12 words, so there are just around 120 possibilities left.
Please, if you don’t know anything about my actual problem, which is piping stdin to cardano-cli, don’t respond to this thread, thank you!
Cardano-cli; as other commands that use password inputs; dynamically opens new file descriptors for those password inputs (it does not use stdin a.k.a. fd=0 for passwords), therefore piping and redirecting wont work. However, you can try an expect script for redirecting the mnemonics, see below:
From here you can create a bash scripts calling that expect script /w the index and mnemonics and then push the enter two times
The 0 is the postfix for the MyWallet e.g. MyWallet0
Hi @Frigus , what are the chances you can provide the script? A friend of mine is missing the final two words. Looks like his hands might become a bit sore around attempt #10,000