It is currently 30 Jul 2010, 11:52

All times are UTC + 1 hour [ DST ]




 Page 1 of 7 [ 93 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next
Author Message
 Post subject: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 09:09 
Site Admin

Joined: 11 Oct 2007, 21:17
Posts: 1218
Location: Copenhagen, Denmark
Hey guys!

I just wanted to post the sample code for dictionary based rainbow tables.
I had it finished for quite some time, but then forgot about it. :p
Its a rainbowtable generator which takes a dictionary file as a source, and then does word mangling rules on the words to generate new words based on the options. (password => password12, password => PaSSword etc)
It supports adding numbers in front of the word and in the end, full case permutation, title case, last character case mutation and 1337 permutations.
The 1337 permutations should probably be looked at. I have a feeling its not distribution the characters evenly.
Feel free to try it out. I attached both binary and source :)

To get help for rtgendict, just type rtgendict and it will show you the options.


Edit: Files updated to reflect the optimization changes


Attachments:
rdict.zip [565.25 KiB]
Downloaded 469 times
rdict-src.zip [33.26 KiB]
Downloaded 286 times
Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 10:36 
Perfect Table
User avatar

Joined: 29 Oct 2007, 12:35
Posts: 522
Location: Netherlands
Nice!



_________________
http://chrysaor.info
Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 12:00 
Developer

Joined: 03 Dec 2007, 11:37
Posts: 725
I think I'll need to look at this while not drunk but ohh well.



_________________
http://www.tobtu.com/
Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 12:08 
Developer

Joined: 03 Dec 2007, 11:37
Posts: 725
wow... CanLeetPerm and GetLeetPerm are very slow. Try using a map (an array with 256 elements that have the mapped char in it). wow i just noticed that's messed up, fixing code.

inline int CanLeetPerm(int nLetter)
{
//   return map[nLetter] != nLetter;
   return mapNum[nLetter];
}


inline int GetLeetPerm(int nLetter, int nNum)
{
//   return map[nLetter];
   return map[nLetter][nNum];
}



_________________
http://www.tobtu.com/
Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 12:46 
Developer

Joined: 03 Dec 2007, 11:37
Posts: 725
It "looks" like it is evenly distribution. Granted I haven't immersed myself into the code but doing the binary search thing will basically make it evenly distributed unless there is a collision in the dictionary, but this will be a rare occurrence.

btw: "pow((double)2, (double)nChar)" is the same as doing "1 << nChar" but much slower since pow deals with doubles and << is a bit shift on integers.



_________________
http://www.tobtu.com/
Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 13:04 
Site Admin

Joined: 11 Oct 2007, 21:17
Posts: 1218
Location: Copenhagen, Denmark
Hi Sc00bz.

I really appreciate your feedback. I will try to implement your suggestions to speedup the code :)


Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 16:00 
Site Admin

Joined: 11 Oct 2007, 21:17
Posts: 1218
Location: Copenhagen, Denmark
I've updated the source with Sc00bz suggestions and reattached new source and binary to the first post


Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 19:32 
Perfect Table

Joined: 02 Apr 2008, 15:10
Posts: 833
Location: Romania
if i have a wordlist with 100.000 words (let's say no permutation is used) and i want my rainbow table to have 100% "success " (to cover all the words in the wordlist)
the chain count to be 655360 (10Mb) what would be the chain length?
and how to compute that value ?
thx


Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 19:45 
Perfect Table

Joined: 02 Apr 2008, 15:10
Posts: 833
Location: Romania
the dictionary based table must be sorted :-w ... include please rtsort in the archive...


Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 20:08 
Guesser

Joined: 26 Apr 2008, 12:27
Posts: 40
Hi,
I have some problemens bye compiling under linux.
goodvirus@goodvirus-laptop:~/Desktop/rdict-src$ make
g++ Public.cpp ChainWalkContext.cpp HashAlgorithm.cpp HashRoutine.cpp RainbowTableGenerate.cpp -lssl -O3 -o rtgen
ChainWalkContext.cpp: In member function »void CChainWalkContext::IndexToPlain()«:
ChainWalkContext.cpp:765: Fehler: »itoa« wurde in diesem Gültigkeitsbereich nicht definiert
ChainWalkContext.cpp:796: Fehler: »itoa« wurde in diesem Gültigkeitsbereich nicht definiert
HashAlgorithm.cpp: In function »void HashORACLE(unsigned char*, int, unsigned char*)«:
HashAlgorithm.cpp:150: Fehler: »strupr« wurde in diesem Gültigkeitsbereich nicht definiert
make: *** [rtgen] Fehler 1

Openssl and libcurl are installt. I use g++ 4.2.3
I heart that itoa is not C/C++ Standartconform and are only avalibel under windows, is this right?
Or missed I something to include.
Sincerly goodvirus

Edit: I just looked around the code and found a lot of goto statements. Is this realy usefull? My programming professor would kill me... :D


Last edited by goodvirus on 21 Jun 2008, 22:39, edited 1 time in total.

Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 20:41 
Perfect Table

Joined: 02 Apr 2008, 15:10
Posts: 833
Location: Romania
wouldn't be nice if we could use 2 other files like : prefix.txt and suffix.txt to use with the words ? not only numbers ;)
eg :
.com .net .im .org for suffix.txt
www. www2. http// .. etc for prefix.txt or anything else ?


Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 20:56 
Perfect Table

Joined: 02 Apr 2008, 15:10
Posts: 833
Location: Romania
the optimization found by sc00bz isn't working :|
rtgendict md5 mil-dic.txt 0 2400 6553600 test caseperm,6;1337perm,6;numprefix,4;numsuffix,4
tried this on the second upload of rdict and it creates lots of errors :|
on the first everything is working ok :P
Image


Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 22:57 
Site Admin

Joined: 11 Oct 2007, 21:17
Posts: 1218
Location: Copenhagen, Denmark
_haxxor_ wrote:
the dictionary based table must be sorted :-w ... include please rtsort in the archive...


You can use the standard rtsort from rainbowcrack.


Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 22:58 
Site Admin

Joined: 11 Oct 2007, 21:17
Posts: 1218
Location: Copenhagen, Denmark
goodvirus wrote:
Hi,
I have some problemens bye compiling under linux.
goodvirus@goodvirus-laptop:~/Desktop/rdict-src$ make
g++ Public.cpp ChainWalkContext.cpp HashAlgorithm.cpp HashRoutine.cpp RainbowTableGenerate.cpp -lssl -O3 -o rtgen
ChainWalkContext.cpp: In member function »void CChainWalkContext::IndexToPlain()«:
ChainWalkContext.cpp:765: Fehler: »itoa« wurde in diesem Gültigkeitsbereich nicht definiert
ChainWalkContext.cpp:796: Fehler: »itoa« wurde in diesem Gültigkeitsbereich nicht definiert
HashAlgorithm.cpp: In function »void HashORACLE(unsigned char*, int, unsigned char*)«:
HashAlgorithm.cpp:150: Fehler: »strupr« wurde in diesem Gültigkeitsbereich nicht definiert
make: *** [rtgen] Fehler 1

Openssl and libcurl are installt. I use g++ 4.2.3
I heart that itoa is not C/C++ Standartconform and are only avalibel under windows, is this right?
Or missed I something to include.
Sincerly goodvirus

Edit: I just looked around the code and found a lot of goto statements. Is this realy usefull? My programming professor would kill me... :D



The goto statements is from the original rainbowcrack code. I didn't make those.
To compile on Linux you need to remove the oracle hash routine. (Just comment out the stuff inside the hashing function in HashAlgorithm.cpp)

Quote:
wouldn't be nice if we could use 2 other files like : prefix.txt and suffix.txt to use with the words ? not only numbers ;)
eg :
.com .net .im .org for suffix.txt
www. www2. http// .. etc for prefix.txt or anything else ?


Maybe i will add it in a future release. My main thoughts of making the dictionary tables has been to perform full case mutation/leet mutation in a quick way.

Quote:
the optimization found by sc00bz isn't working :|
rtgendict md5 mil-dic.txt 0 2400 6553600 test caseperm,6;1337perm,6;numprefix,4;numsuffix,4
tried this on the second upload of rdict and it creates lots of errors :|
on the first everything is working ok :P


Uhm.. im pretty sure i tested out the code before i released it.. strange.


Offline
 Profile  
 
 Post subject: Re: Dictionary based rainbow tables
PostPosted: 21 Jun 2008, 23:25 
Site Admin

Joined: 11 Oct 2007, 21:17
Posts: 1218
Location: Copenhagen, Denmark
_haxxor_ wrote:
the optimization found by sc00bz isn't working :|
rtgendict md5 mil-dic.txt 0 2400 6553600 test caseperm,6;1337perm,6;numprefix,4;numsuffix,4
tried this on the second upload of rdict and it creates lots of errors :|
on the first everything is working ok :P


I just tested it again, and its working fine here..
I have no idea whats wrong at your side..


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 7 [ 93 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

cron