Advertisement
Guest User

Steal BTC 2

a guest
Nov 30th, 2018
2,753
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.96 KB | None | 0 0
  1. The Target
  2. We’re making progress! Following the instructions in part one, you’ve gained access to an encrypted USB drive. Looking around, you notice a some interesting files - perhaps in a hidden folder called .bitcoin. Inside that folder, look for a file called wallet.dat - that contains all of the information needed to access a bitcoin wallet and its associated funds.
  3.  
  4. You can also search for other .dat files, as these can be manual backups created by the user.
  5.  
  6. Let’s assume you’ve already tried to import the file into a wallet application and are prompted to enter a password. If you haven’t yet tried this - do it now. You might get lucky.
  7.  
  8. Locked!
  9. Nah, that would have been too easy!
  10.  
  11. Tools
  12. Cracking these wallets can be fairly hardware-intensive, especially when using really long wordlists. For this tutorial, we are using a Linux-based computer with an Nvidia GPU.
  13.  
  14. You’ll need a few things ready to go:
  15.  
  16. Bitcoin2john. This is a fork of pywallet modified to extract the password hash in a format that hashcat can understand.
  17. Hashcat. Get the newest version from this link, some Linux package managers are woefully behind on this stuff.
  18. A text file that contains your encryption passphrase. While you are practicing, just make a short text file with 10 lines in it, one of them being the passphrase you set on your practice wallet. Here are some good resources for cracking the real stuff:
  19. My passphrase wordlist. This is a work in progress aimed at collecting common short phrases.
  20. Crackstation’s wordlist. This holds more common passwords, as most people aren’t really using phrases yet.
  21. For advanced cracking, a rule list. I like these:
  22. Hob0Rules.
  23. OneRule.
  24. First Up - Extract the Password Hash
  25. In this step, we’ll extract a hash that can be used to crack the password. Place both bitcoin2john.py and wallet.dat in the same folder. Inside the terminal, run the python script as follows:
  26.  
  27. python ./bitcoin2john.py ./wallet.dat
  28. Take the line that starts with $bitcoin and place it in a file called hash.txt in the working directory.
  29.  
  30. Hash
  31.  
  32. Note: If you’re reading this because you’ve forgotten your own password and are unable to crack it yourself, you can share this hash with a reuptable wallet recovery service. Cracking this hash will not allow them to access your Bitcoins unless they also have access to your wallet.dat file. However, it you’ve re-used this password elsewhere, it may allow them to log in to those services and otherwise fuck your shit up.
  33.  
  34. Get Cracking - Standard Dictionary Attack
  35. Now comes the fun. Cracking passwords is an art, and consistent success requires really fine tuning your approach. If you want to learn some advanced methods, Google around a bit or check out this great book.
  36.  
  37. Assumptions:
  38.  
  39. You’ve downloaded hashcat and placed the files into /opt/hashcat.
  40. You’ve configured your drivers as recommended here. This is important.
  41. You’ve created a short text file, with one potential password per line, your password being one of them. That text file is at called wordlist.txt and is in the working folder with your hash.txt file.
  42. First, we are going to run a straight-up dictionary attack. This means that password has to be found in your wordlist exactly - with correct case, special characters, etc.
  43.  
  44. Here we go:
  45.  
  46. # Try it this way first, with some hardware optimization parameters:
  47. /opt/hashcat/hashcat64.bin -a 0 -m 11300 ./hash.txt ./wordlist.txt -O -w 3
  48.  
  49. # If that doesn't work, try this:
  50. /opt/hashcat/hashcat64.bin -a 0 -m 11300 ./hash.txt ./wordlist.txt
  51. Press the S key at any time to see that status of your cracking session.
  52.  
  53. If your session completes successfully, you should see an output with your password. If the session completed and you aren’t sure it was successful, running the command as follows will show you all successfully cracked passwords for a given target:
  54.  
  55. /opt/hashcat/hashcat64.bin -a 0 -m 11300 ~/hash.txt --show
  56. If the output of the above command is blank, the password has not yet been cracked.
  57.  
  58. Getting Tricky - Rule-Based Attacks
  59. As humans, we are pretty dumb when it comes to making passwords. We think doing things like adding an ! or replacing an S with a $ makes them more secure.
  60.  
  61. When it comes to password cracking, this may slow us down a bit but certainly doesn’t stop us. We can use a pre-defined set of rules for transforming files in a wordlist to many possible permutations.
  62.  
  63. If you’d like to test this out, use a password like ThisPasswordSucks! for your wallet.dat, but in the wordlist you create enter only ThisPasswordSucks. This isn’t really stressing your rule list, but you get the idea.
  64.  
  65. Assumptions:
  66.  
  67. You’ve downloaded Hob0Rules and placed it in /opt/rules/.
  68. Follow the same process as before, but alter the command to use one of the rule sets as follows:
  69.  
  70. /opt/hashcat/hashcat64.bin -a 0 -m 11300 ./hash.txt ./wordlist.txt -r /opt/rules/Hob0Rules/hob064.rule -O -w 3
  71. Cracked! As you can see, this password sucks. I hope the hash above didn’t get you too excited.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement