Recovering a Trezor Wallet Passphrase
A TREZOR hardware wallet is a security device that protects the user from key loggers and phishing e-mail, keeping the user’s Bitcoin and crypto safe. Various hacking groups could open the device by mitigating side-channel attacks; however, the method was only possible because ‘a passphrase was not used’. When making a transaction, the user only enters a PIN and therefore protects the private key of the Bitcoin. The only backup is a 12/24-word mnemonic that determines which addresses are stored on the device.
The KeyChainX team split the job into two phrases (or three). But before the team could start, the client wanted to meet face-to-face. As travelling to South America was out of the question as we had a security presentation scheduled in Europe, the client agreed to a Skype “interview”. After 2 hours, the team convinced him that the team would not run away with his funds.
How Did the Team Crack It Open and Brute Force It?
The first part is data sourcing. First, the team gathered information about the possible hints to the passphrase, as a six characters passphrase would take forever to brute force with conventional tools. For example, a GITHUB repo by the user gurnec has a tool called Btcrecover that brute forces a couple of hundred passwords per second on average. For example, to break a 5-character password would take two days; if you add capital letters and numbers six months.
The client’s password consisted of more than 5-characters with both upper- and lower-case characters, possibly numbers and a unique character, which could approximately take 2+ years to brute force with the tool; that is, if the main wallet was the first created on the TREZOR. This was not the case. Instead, the “fake” wallet was created; first, there were transactions, and the genuine wallet was created later. Then, the team was forced to search for multiple wallet addresses and change addresses, which multiplied the time required to break the encryption.
Since this was not the first time the team had received a request to open a TREZOR, the team decided to build a custom-made tool that uses GPUs about a year ago. The custom tool speed is 240,000 passwords per second, an increase by 1000x compared to the gurnec GitHub source.
Customizing Mask Attack
The client gave the KeyChainX team 5 wallet addresses he had used in the past, a list of hints, and the 24-word mnemonic. First, the team had to determine if the 24 words were valid and if the mnemonic was valid.
Next, they had to choose which derivation path to search for; a TREZOR can use both LEGACY and SEGWIT addresses, and their specifications can easily be distinguished by looking at the first character of the address. LEGACY starts with one and SEGWIT with 3. They also use different derivation paths depending on the BIP version, so the team had to specify which wallet type and derivation path to use. Finally, SEGWIT uses m/49’/0’/0’/0 and LEGACY has several options. Finally, TREZOR fired up the custom tool with 8 x 1080Ti Founders Edition GPU cards (they cost up to 1000USD each depending on specification and model).
At first, the team searched an ample space of characters and words, but the mask and algorithm took approximately two months too long. The team had to change tactics and look at the TREZOR owner’s hints and find a pattern. The pattern used small/capital characters as the first password character. Then several lower-case characters, and then limited combinations of numbers (birth dates, months, pin codes to safe etc.). Two unique characters were also used, so the team had to add that into account. The mask was modified again, and BOOM, the team found the password within 24 hours after the “interview”.
A quick message on WeChat, asking the client for their BTC wallet (the team advised him not to use the same TREZOR again). The team transferred the client’s funds to them within the hour.
Crypto Wallets Recovery Experts
KeychainX has relocated in 2021 from its birthplace in the U.S., to Zug, Switzerland – a part of the world known in the blockchain community as Crypto Valley due to its concentration of relevant companies. Robert Rhodin, the CEO of the company, is naturally one of the leading experts in the field of crypto wallet recovery.