Rainbow Crack Tutorial
Rainbow Crack Tutorial
Rainbow Crack Tutorial
Introduction
RainbowCrack is a general propose implementation of Philippe Oechslin's faster time-memory trade-off technique. Function of this software is to crack hash. The straightforward way to crack hash is brute force. In brute force approach, all candidate plaintexts and corresponding hashes are computed one by one. The computed hashes are compared with the target hash. If one of them matches, the plaintext is found. Otherwise the process continues until finish searching all candidate plaintexts. In time-memory tradeoff approach, the task of hash computing is done in advance with the results stored in files called "rainbow table". After that, hashes can be looked up from the rainbow tables whenever needed. The pre-computation process needs several times the effort of full key space brute force. But once the one time pre-computation is complete, the table lookup performance can be hundreds or thousands times faster than brute force. This document explains the steps to make the RainbowCrack software working for first time user. Most contents in this document are implementation specific, while others are generic to time-memory tradeoff algorithm. The RainbowCrack software includes three tools that must be used in sequence to make things working. Step 1: Use rtgen program to generate rainbow tables. Step 2: Use rtsort program to sort rainbow tables generated by rtgen. Step 3: Use rcrack program to lookup rainbow tables sorted by rtsort. The table lookup process in final step is equivalent to the hash cracking process. The way to use these programs will be explained in this document. All of them are command line programs.
plaintext_len_max 7 chain_len 3800 chain_num 33554432 36^1 + 36^2 + 36^3 + 36^4 + 36^5 + 36^6 + 36^7 = 80603140212 key space table size key space is the number of possible plaintexts for the charset, plaintext_len_min and plaintext_len_max selected. 3 GB 0.999 The time-memory tradeoff algorithm is a probabilistic algorithm. Whatever the parameters are selected, there is always probability that the plaintext within the selected charset and plaintext length range is not covered. The success rate is 99.9% with the parameters used in this example. The actual rtgen commands used to generate the rainbow tables are: rtgen md5 loweralpha-numeric 1 7 0 3800 33554432 0 rtgen md5 loweralpha-numeric 1 7 1 3800 33554432 0 rtgen md5 loweralpha-numeric 1 7 2 3800 33554432 0 rtgen md5 loweralpha-numeric 1 7 3 3800 33554432 0 rtgen md5 loweralpha-numeric 1 7 4 3800 33554432 0 rtgen md5 loweralpha-numeric 1 7 5 3800 33554432 0 If ntlm or lm table is desired, replace "md5" in commands above with "ntlm" or "lm". If alpha-numeric charset is desired, replace "loweralpha-numeric" in commands above with "alpha-numeric". If lm table is to be generated, please CONFIRM the charset is alpha-numeric instead of loweralpha-numeric. The lm algorithm NEVER uses lowercase letters as plaintext. Now it is time to generate rainbow table. Change the current directory of your command prompt to RainbowCrack's directory, and execute following command: rtgen md5 loweralpha-numeric 1 7 0 3800 33554432 0 This command takes about 4 hours to complete on Core2 Duo E7300 processor. It is safe to stop the computation any time by pressing Ctrl+C. Next time if the rtgen program is executed with exactly same command line parameters, it will resume from where the computation is stopped and continue the table generation. When the command is finished, a file named "md5_loweralpha-numeric#1-
success rate
7_0_3800x33554432_0.rt" sized 512 MB will be in place. The file name is simply all the command line parameters connected, with the "rt" extension. The rcrack program to be explained later need this piece of information to know parameters of the rainbow table. So don't rename the file. Remaining tables can be generated in same way with commands: rtgen md5 loweralpha-numeric 1 7 1 3800 33554432 0 rtgen md5 loweralpha-numeric 1 7 2 3800 33554432 0 rtgen md5 loweralpha-numeric 1 7 3 3800 33554432 0 rtgen md5 loweralpha-numeric 1 7 4 3800 33554432 0 rtgen md5 loweralpha-numeric 1 7 5 3800 33554432 0 Finally, these files are generated: md5_loweralpha-numeric#1-7_0_3800x33554432_0.rt md5_loweralpha-numeric#1-7_1_3800x33554432_0.rt md5_loweralpha-numeric#1-7_2_3800x33554432_0.rt md5_loweralpha-numeric#1-7_3_3800x33554432_0.rt md5_loweralpha-numeric#1-7_4_3800x33554432_0.rt md5_loweralpha-numeric#1-7_5_3800x33554432_0.rt Now the rainbow table generation process complete.
If the free memory size of your system is smaller than the size of the rainbow table being sorted, temporary hard disk space as large as the rainbow table size will be needed to store intermediate data. Now the rainbow table sorting process complete.
rcrack c:\rt\*.rt -f pwdump_file The lm hash algorithm converts all lowercase letters in plaintext to uppercase; as a result all the plaintexts cracked via the lm hash never contain lowercase letters, while the actual plaintext may contain lowercase letters. The rcrack program will try to do case correction with the ntlm hashes stored in same file and output the original plaintext.