From 371055825f09b5dc2ad00e5702ef4ffe18c419b0 Mon Sep 17 00:00:00 2001 From: James Nobis Date: Sun, 24 Oct 2010 14:30:07 -0500 Subject: [PATCH] 0.6.5 release synced from rcracki.sourceforge.net --- .../rcracki_mt/BaseRTReader.cpp | 2 +- Client Applications/rcracki_mt/BaseRTReader.h | 2 +- .../rcracki_mt/ChainWalkContext.cpp | 39 +++--- .../rcracki_mt/ChainWalkContext.h | 2 +- .../rcracki_mt/ChainWalkSet.cpp | 4 +- Client Applications/rcracki_mt/ChainWalkSet.h | 2 +- Client Applications/rcracki_mt/ChangeLog.txt | 131 +++++++++++------- .../rcracki_mt/CrackEngine.cpp | 62 +++++++-- Client Applications/rcracki_mt/CrackEngine.h | 2 +- .../rcracki_mt/HashAlgorithm.cpp | 32 ++--- .../rcracki_mt/HashAlgorithm.h | 7 +- .../rcracki_mt/HashRoutine.cpp | 4 +- Client Applications/rcracki_mt/HashRoutine.h | 2 +- Client Applications/rcracki_mt/HashSet.cpp | 4 +- Client Applications/rcracki_mt/HashSet.h | 2 +- Client Applications/rcracki_mt/Makefile | 72 ++++++++-- Client Applications/rcracki_mt/MemoryPool.cpp | 8 +- Client Applications/rcracki_mt/MemoryPool.h | 2 +- Client Applications/rcracki_mt/Public.cpp | 29 ++-- Client Applications/rcracki_mt/Public.h | 11 +- Client Applications/rcracki_mt/README.txt | 25 ++-- Client Applications/rcracki_mt/RTI2Reader.cpp | 18 ++- Client Applications/rcracki_mt/RTI2Reader.h | 8 +- .../rcracki_mt/RainbowCrack.cpp | 12 +- Client Applications/rcracki_mt/TODO | 25 ++-- Client Applications/rcracki_mt/fast_md5.cpp | 2 +- Client Applications/rcracki_mt/fast_md5.h | 7 +- Client Applications/rcracki_mt/global.h | 2 +- Client Applications/rcracki_mt/lm2ntlm.cpp | 4 +- Client Applications/rcracki_mt/lm2ntlm.h | 2 +- Client Applications/rcracki_mt/md4.cpp | 2 +- Client Applications/rcracki_mt/md4.h | 2 +- .../rcracki_mt/rcrackiThread.cpp | 4 +- .../rcracki_mt/rcrackiThread.h | 2 +- Client Applications/rcracki_mt/rcracki_mt.ini | 64 ++++----- Client Applications/rcracki_mt/sha1.cpp | 2 +- Client Applications/rcracki_mt/sha1.h | 2 +- 37 files changed, 360 insertions(+), 242 deletions(-) diff --git a/Client Applications/rcracki_mt/BaseRTReader.cpp b/Client Applications/rcracki_mt/BaseRTReader.cpp index cae94f8..9b797ec 100644 --- a/Client Applications/rcracki_mt/BaseRTReader.cpp +++ b/Client Applications/rcracki_mt/BaseRTReader.cpp @@ -6,7 +6,7 @@ * Copyright 2010 Daniël Niggebrugge * Copyright 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/BaseRTReader.h b/Client Applications/rcracki_mt/BaseRTReader.h index b95f930..17a93ac 100644 --- a/Client Applications/rcracki_mt/BaseRTReader.h +++ b/Client Applications/rcracki_mt/BaseRTReader.h @@ -6,7 +6,7 @@ * Copyright 2010 Daniël Niggebrugge * Copyright 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/ChainWalkContext.cpp b/Client Applications/rcracki_mt/ChainWalkContext.cpp index 1158dc6..ae58f77 100644 --- a/Client Applications/rcracki_mt/ChainWalkContext.cpp +++ b/Client Applications/rcracki_mt/ChainWalkContext.cpp @@ -8,7 +8,7 @@ * Copyright 2009, 2010 James Nobis * Copyright 2010 Yngve AAdlandsvik * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -76,22 +76,18 @@ bool CChainWalkContext::LoadCharset(string sName) return true; } if(sName.substr(0, 6) == "hybrid") // Hybrid charset consisting of 2 charsets - { m_nHybridCharset = 1; - } else - { m_nHybridCharset = 0; - } bool readCharset = false; vector vLine; - if (ReadLinesFromFile("charset.txt", vLine)) { + + if ( ReadLinesFromFile("charset.txt", vLine) ) readCharset = true; - } - else if (ReadLinesFromFile(GetApplicationPath() + "charset.txt", vLine)) { + else if ( ReadLinesFromFile(GetApplicationPath() + "charset.txt", vLine) ) readCharset = true; - } + if (readCharset) { UINT4 i; @@ -268,11 +264,11 @@ bool CChainWalkContext::SetupWithPathName(string sPathName, int& nRainbowChainLe // something like lm_alpha#1-7_0_100x16_test.rt #ifdef _WIN32 - int nIndex = sPathName.find_last_of('\\'); + string::size_type nIndex = sPathName.find_last_of('\\'); #else - int nIndex = (int) sPathName.find_last_of('/'); + string::size_type nIndex = sPathName.find_last_of('/'); #endif - if (nIndex != -1) + if (nIndex != string::npos) sPathName = sPathName.substr(nIndex + 1); if (sPathName.size() < 3) @@ -324,7 +320,7 @@ bool CChainWalkContext::SetupWithPathName(string sPathName, int& nRainbowChainLe } else { - if (sCharsetDefinition.find('#') == (unsigned long)-1) // For backward compatibility, "#1-7" is implied + if ( sCharsetDefinition.find('#') == string::npos ) // For backward compatibility, "#1-7" is implied { sCharsetName = sCharsetDefinition; nPlainLenMin = 1; @@ -473,10 +469,10 @@ void CChainWalkContext::IndexToPlain() m_nPlainLen = m_nPlainLenMinTotal; uint64 nIndexOfX = m_nIndex - m_nPlainSpaceUpToX[m_nPlainLen - 1]; -// this is the generic code for non x86/x86-64 platforms -#if !defined(_M_X64) && !defined(_M_X86) && !defined(__i386__) && !defined(__x86_64__) +// this is the generic code for non x86/x86_64 platforms +#if !defined(_M_X64) && !defined(_M_IX86) && !defined(__i386__) && !defined(__x86_64__) - // Slow/generic version + // generic version (slow for non 64-bit platforms and gcc < 4.5.x) for (i = m_nPlainLen - 1; i >= 0; i--) { int nCharsetLen = 0; @@ -491,14 +487,14 @@ void CChainWalkContext::IndexToPlain() } } } -#else +#elif defined(_M_X64) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) // Fast ia32 version for (i = m_nPlainLen - 1; i >= 0; i--) { // 0x100000000 = 2^32 -#if defined(_M_X64) || defined(_M_X86) +#ifdef _M_IX86 if (nIndexOfX < 0x100000000I64) break; #else @@ -519,7 +515,7 @@ void CChainWalkContext::IndexToPlain() } } - unsigned int nIndexOfX32 = (unsigned int)nIndexOfX; + UINT4 nIndexOfX32 = (UINT4)nIndexOfX; for (; i >= 0; i--) { int nCharsetLen = 0; @@ -540,11 +536,14 @@ void CChainWalkContext::IndexToPlain() #if defined(_WIN32) && !defined(__GNUC__) + // VC++ still needs this + unsigned int nPlainCharsetLen = m_vCharset[j].m_nPlainCharsetLen; + __asm { mov eax, nIndexOfX32 xor edx, edx - div m_vCharset[j].m_nPlainCharsetLen + div nPlainCharsetLen mov nIndexOfX32, eax mov nTemp, edx } diff --git a/Client Applications/rcracki_mt/ChainWalkContext.h b/Client Applications/rcracki_mt/ChainWalkContext.h index 566f9f2..154daee 100644 --- a/Client Applications/rcracki_mt/ChainWalkContext.h +++ b/Client Applications/rcracki_mt/ChainWalkContext.h @@ -6,7 +6,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/ChainWalkSet.cpp b/Client Applications/rcracki_mt/ChainWalkSet.cpp index 488280a..84db65f 100644 --- a/Client Applications/rcracki_mt/ChainWalkSet.cpp +++ b/Client Applications/rcracki_mt/ChainWalkSet.cpp @@ -7,7 +7,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ * along with rcracki_mt. If not, see . */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__GNUC__) #pragma warning(disable : 4786) #endif diff --git a/Client Applications/rcracki_mt/ChainWalkSet.h b/Client Applications/rcracki_mt/ChainWalkSet.h index 3c29bcf..7578007 100644 --- a/Client Applications/rcracki_mt/ChainWalkSet.h +++ b/Client Applications/rcracki_mt/ChainWalkSet.h @@ -7,7 +7,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/ChangeLog.txt b/Client Applications/rcracki_mt/ChangeLog.txt index 0b07cd0..4c0eefd 100644 --- a/Client Applications/rcracki_mt/ChangeLog.txt +++ b/Client Applications/rcracki_mt/ChangeLog.txt @@ -1,52 +1,79 @@ -[rcracki_mt ChangeLog] - -0.6.2 (2 Juli 2009, 13:37): -* Fixed linux support (tty stuff and now actually compiles) -* Fixed precalculation code - -0.6.1 (14 May 2009, 22:12): -* bug fixed where the list of rainbow tables is doubled when you resume a session and you have default RT locations in your ini - -0.6 (14 May 2009, 20:47): -* Finding .rti files recursively -* Fixed memory allocation bugs (also trying to save appropriate amount of memory for chainwalksets... these can become really large with the new tables) -* Real pause/resume function, you can resume a session with -r -* Session support, use -s session_name. Combine this with -r to resume a session other then the default -* Ini file support, store some default values such as rainbow table directories. -* Tab separated results (stdout) -* Support pause during cracking and 'skip' during unicode correction for Linux -* A readme / 'manual' ! - -0.5 (16 Apr 2009, 22:47): -* Support for the old non-indexed .rt format, it should work with both type of tables in one run... I didn't test this feature thoroughly -* Using some other pieces of code for algorithms -* Support for .lst files from Cain as input (patch from James Dickson) - use for example -c LMNT.lst -* Fixed some bugs -* Dunno anymore, left this version lying around for too long... - -0.4 (oops, a second 0.4) (13 Dec 2008, 18:20): -* Improved file reading performance - -0.4 (27 Nov 2008, 00:09): -* Source included -* Memory usage down to about 50% (tnx sc00bz for pointing out the inefficiency, tnx jci for helping with the code) -* Works under Linux! (using pthreads now instead of Windows threads) -* Speed up: implemented MD4 reference implementation, not using OpenSSL for NTLM anymore (tnx Bitweasil for supplying 98% of the code) -* Speed up: using OpenSSL a lot faster (tnx jci for pointing that out) -* Probably some more small things i forgot - -0.3 (16 Nov 2008, 01:01): -* Improved command line argument parsing (order no longer matters) -* Option to write (temporary) output to a file, use -o pick_a_nice_filename.txt -* Option to pause, press 'P' to pause/unpause (Windows only) -* For pwdump searches: unicode correction is done when case correction fails - -0.2 (28 Oct 2008, 01:42): -* False alarm checking now also multi threaded -* Search one level of subdirectories for rainbow table files - -0.1 (27 Oct 2008, 00:14): -* Initial multithreaded version, using Windows threads. -* Using multiple threads for the pre-calculation part. -* Added a simple 'progress' message, so you can see how many hashes are being pre-calculated - +[rcracki_mt ChangeLog] + +0.6.5 (24 Oct 2010, 18:21:25): +* code changes to allow building via mingw and avoid VC++ +* linux thread priority set to nice value of 2 +* rti2 support +* replaced clock_t usage with gettimeofday +* add pre-calculation timing per feature request #3025688 from sourceforge +* fix bug #3050821 from sourceforge - missing break for non x86/x86_64 arch +* improve hash performance by moving off openssl to the local faster methods +* sha1 local implementation was *slower* than openssl for x86/x86_64 + +0.6.4 (05 Jul 2010, 03:12): +* add -m to allow users to limit memory usage - courtesy of uroskn +* fix memory code that made incorrect assumptions about the MemoryPool +* fix linux memory code - using only info.freeram is incorrect +* cleanup of the nested if/elif/else stuctures +* annotate x86 specific sections of code +* licensing review and GPLv2 compliance +* cleanup of unused items +* restructure Makefile +* cleanup memory leaks + +0.6.3 (21 Oct 2009, 21:05): +* Fixed x86_64 linux compilation +* Fixed x86_64 linux segmentation fault +* Fixed 64bit support in md4 code +* Added support for: FreeBSD, NetBSD, OpenBSD, and MacOSX + +0.6.2 (2 Jul 2009, 13:37): +* Fixed linux support (tty stuff and now actually compiles) +* Fixed precalculation code + +0.6.1 (14 May 2009, 22:12): +* bug fixed where the list of rainbow tables is doubled when you resume a session and you have default RT locations in your ini + +0.6 (14 May 2009, 20:47): +* Finding .rti files recursively +* Fixed memory allocation bugs (also trying to save appropriate amount of memory for chainwalksets... these can become really large with the new tables) +* Real pause/resume function, you can resume a session with -r +* Session support, use -s session_name. Combine this with -r to resume a session other then the default +* Ini file support, store some default values such as rainbow table directories. +* Tab separated results (stdout) +* Support pause during cracking and 'skip' during unicode correction for Linux +* A readme / 'manual' ! + +0.5 (16 Apr 2009, 22:47): +* Support for the old non-indexed .rt format, it should work with both type of tables in one run... I didn't test this feature thoroughly +* Using some other pieces of code for algorithms +* Support for .lst files from Cain as input (patch from James Dickson) - use for example -c LMNT.lst +* Fixed some bugs +* Dunno anymore, left this version lying around for too long... + +0.4 (oops, a second 0.4) (13 Dec 2008, 18:20): +* Improved file reading performance + +0.4 (27 Nov 2008, 00:09): +* Source included +* Memory usage down to about 50% (tnx sc00bz for pointing out the inefficiency, tnx jci for helping with the code) +* Works under Linux! (using pthreads now instead of Windows threads) +* Speed up: implemented MD4 reference implementation, not using OpenSSL for NTLM anymore (tnx Bitweasil for supplying 98% of the code) +* Speed up: using OpenSSL a lot faster (tnx jci for pointing that out) +* Probably some more small things i forgot + +0.3 (16 Nov 2008, 01:01): +* Improved command line argument parsing (order no longer matters) +* Option to write (temporary) output to a file, use -o pick_a_nice_filename.txt +* Option to pause, press 'P' to pause/unpause (Windows only) +* For pwdump searches: unicode correction is done when case correction fails + +0.2 (28 Oct 2008, 01:42): +* False alarm checking now also multi threaded +* Search one level of subdirectories for rainbow table files + +0.1 (27 Oct 2008, 00:14): +* Initial multithreaded version, using Windows threads. +* Using multiple threads for the pre-calculation part. +* Added a simple 'progress' message, so you can see how many hashes are being pre-calculated + diff --git a/Client Applications/rcracki_mt/CrackEngine.cpp b/Client Applications/rcracki_mt/CrackEngine.cpp index 0021610..8adc182 100644 --- a/Client Applications/rcracki_mt/CrackEngine.cpp +++ b/Client Applications/rcracki_mt/CrackEngine.cpp @@ -8,7 +8,7 @@ * Copyright 2009, 2010 James Nobis * Copyright 2010 uroskn * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,13 +24,17 @@ * along with rcracki_mt. If not, see . */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__GNUC__) #pragma warning(disable : 4786 4267 4018) #endif #include "CrackEngine.h" #include "RTI2Reader.h" +#ifndef _WIN32 + #include +#endif + CCrackEngine::CCrackEngine() { ResetStatistics(); @@ -299,15 +303,28 @@ void CCrackEngine::SearchTableChunkOld(RainbowChainO* pChain, int nRainbowChainL vector threadPool; vector pThreads; + #ifndef _WIN32 + /* + * On linux you cannot set the priority of a thread in the non real time + * scheduling groups. You can set the priority of the process. In + * windows BELOW_NORMAL represents a 1/8th drop in priority and this would + * be 20 * 1/8 on linux or about 2.5 + */ + setpriority( PRIO_PROCESS, 0, 2 ); + #endif + pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #ifdef _WIN32 sched_param param; + /* + * windows scheduling is 0 to 32 (low to high) with 8 as normal and 7 as + * BELOW_NORMAL + */ param.sched_priority = THREAD_PRIORITY_BELOW_NORMAL; pthread_attr_setschedparam (&attr, ¶m); #endif - // XXX else set it to 5 or something (for linux)? bool pausing = false; @@ -615,6 +632,16 @@ void CCrackEngine::SearchTableChunk(RainbowChain* pChain, int nRainbowChainLen, vector threadPool; vector pThreads; + + #ifndef _WIN32 + /* + * On linux you cannot set the priority of a thread in the non real time + * scheduling groups. You can set the priority of the process. In + * windows BELOW_NORMAL represents a 1/8th drop in priority and this would + * be 20 * 1/8 on linux or about 2.5 + */ + setpriority( PRIO_PROCESS, 0, 2 ); + #endif pthread_attr_t attr; pthread_attr_init(&attr); @@ -943,12 +970,12 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs) // FileName #ifdef _WIN32 - int nIndex = sPathName.find_last_of('\\'); + string::size_type nIndex = sPathName.find_last_of('\\'); #else - int nIndex = (int) sPathName.find_last_of('/'); + string::size_type nIndex = sPathName.find_last_of('/'); #endif string sFileName; - if (nIndex != -1) + if (nIndex != string::npos) sFileName = sPathName.substr(nIndex + 1); else sFileName = sPathName; @@ -1018,7 +1045,12 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs) static CMemoryPool mp(bytesForChainWalkSet, debug, maxMem); RainbowChainO* pChain = (RainbowChainO*)mp.Allocate(nFileLen, nAllocatedSize); - if (debug) printf("Allocated %llu bytes, filelen %lu\n", nAllocatedSize, (unsigned long)nFileLen); + #ifdef _WIN32 + if (debug) printf("Allocated %I64u bytes, filelen %lu\n", nAllocatedSize, (unsigned long)nFileLen); + #else + if (debug) printf("Allocated %llu bytes, filelen %lu\n", nAllocatedSize, (unsigned long)nFileLen); + #endif + if (pChain != NULL) { nAllocatedSize = nAllocatedSize / sizeOfChain * sizeOfChain; // Round to sizeOfChain boundary @@ -1136,7 +1168,11 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs) //printf("index nSize: %d\n", nSize); //pIndex = (IndexChain*)new unsigned char[nSize]; IndexChain *pIndex = (IndexChain*)mpIndex.Allocate(nFileLenIndex, nAllocatedSizeIndex); - if (debug) printf("Debug: Allocated %llu bytes for index with filelen %u\n", nAllocatedSizeIndex, nFileLenIndex); + #ifdef _WIN32 + if (debug) printf("Debug: Allocated %I64u bytes for index with filelen %u\n", nAllocatedSizeIndex, nFileLenIndex); + #else + if (debug) printf("Debug: Allocated %llu bytes for index with filelen %u\n", nAllocatedSizeIndex, nFileLenIndex); + #endif static CMemoryPool mp(bytesForChainWalkSet + nAllocatedSizeIndex, debug, maxMem); @@ -1149,7 +1185,11 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs) while ( (unsigned long)ftell(fIndex) != nFileLenIndex ) // Index chunk read loop { // Load index chunk +#ifdef _WIN32 + if (debug) printf("Debug: Setting index to 0x00 in memory, %I64u bytes\n", nAllocatedSizeIndex); +#else if (debug) printf("Debug: Setting index to 0x00 in memory, %llu bytes\n", nAllocatedSizeIndex); +#endif memset(pIndex, 0x00, nAllocatedSizeIndex); printf("reading index... "); gettimeofday( &tv, NULL ); @@ -1172,7 +1212,11 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs) //RainbowChain* pChain = (RainbowChain*)mp.Allocate(nFileLen, nAllocatedSize); RainbowChain* pChain = (RainbowChain*)mp.Allocate(nCoveredRainbowTableChains * sizeOfChain, nAllocatedSize); - if (debug) printf("Debug: Allocated %llu bytes for %u chains, filelen %lu\n", nAllocatedSize, nCoveredRainbowTableChains, (unsigned long)nFileLen); + #ifdef _WIN32 + if (debug) printf("Debug: Allocated %I64u bytes for %u chains, filelen %lu\n", nAllocatedSize, nCoveredRainbowTableChains, (unsigned long)nFileLen); + #else + if (debug) printf("Debug: Allocated %llu bytes for %u chains, filelen %lu\n", nAllocatedSize, nCoveredRainbowTableChains, (unsigned long)nFileLen); + #endif if (pChain != NULL && nAllocatedSize > 0) { diff --git a/Client Applications/rcracki_mt/CrackEngine.h b/Client Applications/rcracki_mt/CrackEngine.h index 5826e7f..a5bc6a6 100644 --- a/Client Applications/rcracki_mt/CrackEngine.h +++ b/Client Applications/rcracki_mt/CrackEngine.h @@ -8,7 +8,7 @@ * Copyright 2009, 2010 James Nobis * Copyright 2010 uroskn * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/HashAlgorithm.cpp b/Client Applications/rcracki_mt/HashAlgorithm.cpp index caf30d6..bf04682 100644 --- a/Client Applications/rcracki_mt/HashAlgorithm.cpp +++ b/Client Applications/rcracki_mt/HashAlgorithm.cpp @@ -7,7 +7,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,13 +32,12 @@ #include //#include #include -//#include #include //#include #include "fast_md5.h" #include "md4.h" //#include "sha1.h" -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__GNUC__) #pragma comment(lib, "libeay32.lib") #endif @@ -166,7 +165,6 @@ void HashNTLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)&pHash[16], ks, DES_ENCRYPT); } - void HashORACLE(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) { char ToEncrypt[256]; @@ -177,11 +175,17 @@ void HashORACLE(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) DES_key_schedule ks1,ks2; unsigned char deskey_fixed[]={ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}; int i,j; - - strcpy (username, "SYS"); +#if defined(_WIN32) && !defined(__GNUC__) + strcpy_s(username, sizeof(username), "SYS"); +#else + strcpy(username, "SYS"); +#endif int userlen = 3; - - strupr ((char*) pPlain); +#if defined(_WIN32) && !defined(__GNUC__) + _strupr((char*) pPlain); +#else + strupr((char*) pPlain); +#endif memset (ToEncrypt,0,sizeof(ToEncrypt)); for (i=1,j=0; j * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,22 +28,25 @@ void HashLM(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); void HashNTLM(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); -void HashMD2(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); +//void HashMD2(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); void HashMD4(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); void HashMD5(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); void HashDoubleMD5(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); void HashSHA1(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); //void HashRIPEMD160(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); void HashMSCACHE(unsigned char *pPlain, int nPlainLen, unsigned char* pHash); + //**************************************************************************** // MySQL Password Hashing //**************************************************************************** + void HashMySQL323(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); void HashMySQLSHA1(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); //**************************************************************************** // Cisco PIX Password Hashing //**************************************************************************** + void HashPIX(unsigned char* pPlain, int nPlainLen, unsigned char* pHash); //**************************************************************************** diff --git a/Client Applications/rcracki_mt/HashRoutine.cpp b/Client Applications/rcracki_mt/HashRoutine.cpp index e4dc811..c85193f 100644 --- a/Client Applications/rcracki_mt/HashRoutine.cpp +++ b/Client Applications/rcracki_mt/HashRoutine.cpp @@ -7,7 +7,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ * along with rcracki_mt. If not, see . */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__GNUC__) #pragma warning(disable : 4786 4267 4018) #endif diff --git a/Client Applications/rcracki_mt/HashRoutine.h b/Client Applications/rcracki_mt/HashRoutine.h index ebd0a17..2d53125 100644 --- a/Client Applications/rcracki_mt/HashRoutine.h +++ b/Client Applications/rcracki_mt/HashRoutine.h @@ -7,7 +7,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/HashSet.cpp b/Client Applications/rcracki_mt/HashSet.cpp index 853efca..683af0b 100644 --- a/Client Applications/rcracki_mt/HashSet.cpp +++ b/Client Applications/rcracki_mt/HashSet.cpp @@ -7,7 +7,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ * along with rcracki_mt. If not, see . */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__GNUC__) #pragma warning(disable : 4786 4267 4018) #endif diff --git a/Client Applications/rcracki_mt/HashSet.h b/Client Applications/rcracki_mt/HashSet.h index 17ed129..d3f410a 100644 --- a/Client Applications/rcracki_mt/HashSet.h +++ b/Client Applications/rcracki_mt/HashSet.h @@ -7,7 +7,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/Makefile b/Client Applications/rcracki_mt/Makefile index a19f0c0..3be2121 100644 --- a/Client Applications/rcracki_mt/Makefile +++ b/Client Applications/rcracki_mt/Makefile @@ -5,7 +5,7 @@ # Copyright 2009, 2010 Daniël Niggebrugge # Copyright 2009, 2010 James Nobis # -# This file is part of racrcki_mt. +# This file is part of rcracki_mt. # # rcracki_mt is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,16 +23,18 @@ SHELL = /bin/sh BIN = $(DESTDIR)/usr/bin CC = g++ -OPTIMIZATION = -O3 -INCLUDES = -I../../Common/rt\ api +OPTIMIZATION = -O3 -mtune=native CFLAGS = -Wall -ansi $(OPTIMIZATION) -c $(DEBUG) -LFLAGS = -Wall -ansi $(OPTIMIZATION) $(DEBUG) +LFLAGS = -Wall -ansi -filt $(OPTIMIZATION) $(DEBUG) LIBS = -lcrypto -lpthread -OBJS = BaseRTReader.o ChainWalkContext.o ChainWalkSet.o CrackEngine.o fast_md5.o HashAlgorithm.o HashRoutine.o HashSet.o lm2ntlm.o md4.o MemoryPool.o Public.o RainbowCrack.o rcrackiThread.o RTI2Reader.o sha1.o -COMMON_API_PATH = ../../Common/rt\ api +OBJS = BaseRTReader.o ChainWalkContext.o ChainWalkSet.o CrackEngine.o fast_md5.o HashAlgorithm.o HashRoutine.o HashSet.o lm2ntlm.o md4.o MemoryPool.o Public.o RainbowCrack.o rcrackiThread.o RTI2Reader.o +#sha1.o +WARNALL = -Wextra -Wunused-macros -Wunsafe-loop-optimizations -Wundef -Woverlength-strings -Wdisabled-optimization -Wformat-extra-args -Wformat-security -Winline OSNAME = $(shell uname -s) -STRIP = $(shell which strip) --strip-debug +# apparently --string-debug works on Linux, OpenBSD, NetBSD, and FreeBSD +# but not on OSX so to the short name -S +STRIP = $(shell which strip) -S #LIBS_Darwin = -lcrypto LIBS_NetBSD = -ldes @@ -51,9 +53,51 @@ clean: debug: DEBUG += -DDEBUG -g debug: rcracki_mt -debugall: DEBUG += -DDEBUG -g -Wextra -Wunused-macros -Wunsafe-loop-optimizations -Wundef -Woverlength-strings -Wdisabled-optimization -Wformat-extra-args -Wformat-security -Winline +debugall: DEBUG += -DDEBUG -g $(WARNALL) debugall: rcracki_mt +dumpasmall: DEBUG += -S -fverbose-asm +dumpasmall: rcracki_mt + +dumpasmprofileuseall: DEBUG += -S -fverbose-asm +dumpasmprofileuseall: profileuseall + +debugprofileuseall: DEBUG += -fprofile-use +debugprofileuseall: debugall + +m32: DEBUG += -m32 +m32: rcracki_mt + +m32debug: DEBUG += -m32 +m32debug: debug + +m32debugall: DEBUG += -m32 +m32debugall: debugll + +m32dumpasmall: DEBUG += -m32 +m32dumpasmall: dumpasmall + +m32dumpasmprofileuseall: DEBUG += -S -fverbose-asm -m32 +m32dumpasmprofileuseall: profileuseall + +m32profilegenall: DEBUG += -m32 +m32profilegenall: profilegenall + +m32profileuseall: DEBUG += -m32 +m32profileuseall: profileuseall + +profilegenall: DEBUG += -fprofile-generate $(WARNALL) +profilegenall: rcracki_mt + +profileuseall: DEBUG += -fprofile-use $(WARNALL) +profileuseall: rcracki_mt + +gcovall: DEBUG += -DDEBUG -g -fprofile-arcs -ftest-coverage +gcovall: rcracki_mt + +gprofall: DEBUG += -DDEBUG -g -pg +gprofall: rcracki_mt + install: install -d $(BIN) install --group=root --owner=root --mode=755 rcracki_mt $(BIN) @@ -78,13 +122,11 @@ ChainWalkSet.o: Public.h ChainWalkSet.h ChainWalkSet.cpp CrackEngine.o: CrackEngine.h CrackEngine.cpp Public.h HashSet.h ChainWalkContext.h MemoryPool.h ChainWalkSet.h rcrackiThread.h RTI2Reader.h $(CC) $(CFLAGS) CrackEngine.cpp -fast_md5.o: $(COMMON_API_PATH)/fast_md5.h $(COMMON_API_PATH)/fast_md5.cpp \ - $(COMMON_API_PATH)/global.h - $(CC) $(CFLAGS) $(COMMON_API_PATH)/fast_md5.cpp +fast_md5.o: fast_md5.h fast_md5.cpp global.h + $(CC) $(CFLAGS) fast_md5.cpp #HashAlgorithm.o: HashAlgorithm.h HashAlgorithm.cpp Public.h fast_md5.h md4.h sha1.h -HashAlgorithm.o: HashAlgorithm.h HashAlgorithm.cpp Public.h \ - $(COMMON_API_PATH)/fast_md5.h md4.h +HashAlgorithm.o: HashAlgorithm.h HashAlgorithm.cpp Public.h fast_md5.h md4.h $(CC) $(CFLAGS) HashAlgorithm.cpp HashRoutine.o: HashRoutine.h HashRoutine.cpp global.h HashAlgorithm.h @@ -114,5 +156,5 @@ rcrackiThread.o: rcrackiThread.h rcrackiThread.cpp ChainWalkContext.h Public.h H RTI2Reader.o: RTI2Reader.h RTI2Reader.cpp BaseRTReader.h $(CC) $(CFLAGS) RTI2Reader.cpp -sha1.o: sha1.h sha1.cpp global.h - $(CC) $(CFLAGS) sha1.cpp +#sha1.o: sha1.h sha1.cpp global.h +# $(CC) $(CFLAGS) sha1.cpp diff --git a/Client Applications/rcracki_mt/MemoryPool.cpp b/Client Applications/rcracki_mt/MemoryPool.cpp index f48961d..3673446 100644 --- a/Client Applications/rcracki_mt/MemoryPool.cpp +++ b/Client Applications/rcracki_mt/MemoryPool.cpp @@ -8,7 +8,7 @@ * Copyright 2009, 2010 James Nobis * Copyright 2010 uroskn * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,11 @@ CMemoryPool::CMemoryPool(unsigned int bytesSaved, bool bDebug, uint64 maxMem) if ( debug ) { - printf( "Debug: nAvailPhys: %llu\n", nAvailPhys ); + #ifdef _WIN32 + printf( "Debug: nAvailPhys: %I64u\n", nAvailPhys ); + #else + printf( "Debug: nAvailPhys: %llu\n", nAvailPhys ); + #endif printf( "Debug: bytesSaved: %d\n", bytesSaved ); } diff --git a/Client Applications/rcracki_mt/MemoryPool.h b/Client Applications/rcracki_mt/MemoryPool.h index a53c486..62ae527 100644 --- a/Client Applications/rcracki_mt/MemoryPool.h +++ b/Client Applications/rcracki_mt/MemoryPool.h @@ -8,7 +8,7 @@ * Copyright 2009, 2010 James Nobis * Copyright 2010 uroskn * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/Public.cpp b/Client Applications/rcracki_mt/Public.cpp index 0aba1a8..41a9515 100644 --- a/Client Applications/rcracki_mt/Public.cpp +++ b/Client Applications/rcracki_mt/Public.cpp @@ -7,7 +7,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ * along with rcracki_mt. If not, see . */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__GNUC__) #pragma warning(disable : 4786 4267 4018) #endif @@ -30,6 +30,10 @@ #ifdef _WIN32 #include +#endif + +#if defined(_WIN32) && !defined(__GNUC__) + #include #include #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) @@ -161,8 +165,8 @@ bool GetHybridCharsets(string sCharset, vector& vCharset) if(sCharset.substr(0, 6) != "hybrid") // Not hybrid charset return false; - UINT4 nEnd = (int) sCharset.rfind(')'); - UINT4 nStart = (int) sCharset.rfind('('); + string::size_type nEnd = sCharset.rfind(')'); + string::size_type nStart = (int) sCharset.rfind('('); string sChar = sCharset.substr(nStart + 1, nEnd - nStart - 1); vector vParts; SeperateString(sChar, ",", vParts); @@ -202,8 +206,8 @@ bool ReadLinesFromFile(string sPathName, vector& vLine) content[i] = '\n'; } - int n; - while ((n = content.find("\n", 0)) != -1) + string::size_type n; + while ((n = content.find("\n", 0)) != string::npos) { string line = content.substr(0, n); line = TrimString(line); @@ -241,8 +245,8 @@ bool SeperateString(string s, string sSeperator, vector& vPart) unsigned int i; for (i = 0; i < sSeperator.size(); i++) { - int n = s.find(sSeperator[i]); - if (n != -1) + string::size_type n; + if ( (n = s.find(sSeperator[i])) != string::npos) { vPart.push_back(s.substr(0, n)); s = s.substr(n + 1); @@ -301,7 +305,7 @@ string HexToStr(const unsigned char* pData, int nLen) uint64 GetAvailPhysMemorySize() { -#ifdef _WIN32 +#if defined(_WIN32) MEMORYSTATUS ms; GlobalMemoryStatus(&ms); return ms.dwAvailPhys; @@ -331,6 +335,7 @@ string GetApplicationPath() GetModuleFileName(NULL, fullPath, FILENAME_MAX); #else char szTmp[32]; + // XXX linux/proc file system dependen sprintf(szTmp, "/proc/%d/exe", getpid()); int bytes = readlink(szTmp, fullPath, FILENAME_MAX); if(bytes >= 0) @@ -339,12 +344,12 @@ string GetApplicationPath() string sApplicationPath = fullPath; #ifdef _WIN32 - int nIndex = sApplicationPath.find_last_of('\\'); + string::size_type nIndex = sApplicationPath.find_last_of('\\'); #else - int nIndex = sApplicationPath.find_last_of('/'); + string::size_type nIndex = sApplicationPath.find_last_of('/'); #endif - if (nIndex != -1) + if ( nIndex != string::npos ) sApplicationPath = sApplicationPath.substr(0, nIndex+1); //printf ("\n\nDebug: The application directory is %s\n", sApplicationPath.c_str()); diff --git a/Client Applications/rcracki_mt/Public.h b/Client Applications/rcracki_mt/Public.h index 13fb0d3..27d4dcd 100644 --- a/Client Applications/rcracki_mt/Public.h +++ b/Client Applications/rcracki_mt/Public.h @@ -6,7 +6,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -109,13 +109,16 @@ void tty_done(); void tty_init(); void tty_flush(void); // end nmap code +#endif -#include - -#else +#if defined(_WIN32) && !defined(__GNUC__) int gettimeofday( struct timeval *tv, struct timezone *tz ); #endif +#if !defined(_WIN32) || defined(__GNUC__) + #include +#endif + timeval sub_timeofday( timeval tv2, timeval tv ); unsigned int GetFileLen(FILE* file); diff --git a/Client Applications/rcracki_mt/README.txt b/Client Applications/rcracki_mt/README.txt index 873c868..3719dd6 100644 --- a/Client Applications/rcracki_mt/README.txt +++ b/Client Applications/rcracki_mt/README.txt @@ -92,7 +92,8 @@ faster and smaller. Rcracki also supported hybrid tables. Daniël Niggebrugge further enhanced this version and made it multi threaded, creating rcracki_mt. More features were added over time, making it less of an unofficial version with every release. -James Nobis - is making improvements on the *nix compatibility. +James Nobis - improved *nix compatibility and 64-bit compatability and +continues work on the project. SUPPORTED HASH ALGORITHMS @@ -108,22 +109,22 @@ SUPPORTED PLATFORMS ================ Rcracki_mt is released both as win32 binary and as source package. Rcracki_mt should work on any Microsoft Windows system, but is only tested on a 32 bit Windows XP. -The source should work on Linux versions. It has been tested on: -32-bit Ubuntu 8.10 (Intrepid Ibex) -32-bit Debian GNU/Linux 5.0 (Lenny) -64-bit Debian GNU/Linux 5.0 (Lenny) +The source should work on Linux distributions. It has been tested on: +32-bit Ubuntu +32-bit Debian GNU/Linux +64-bit Debian GNU/Linux The source should also work on other platforms and has been tested on: -32-bit MacOSX (10.5) +32-bit MacOSX -32-bit FreeBSD (7.2) -64-bit FreeBSD (7.2) -32-bit NetBSD (5.0) -32-bit OpenBSD (4.5) - you must install and use eg++ (g++ 4.2 from ports) -64-bit OpenBSD (4.5) +32-bit FreeBSD +64-bit FreeBSD +32-bit NetBSD +32-bit OpenBSD - you must install and use eg++ from ports +64-bit OpenBSD Only compilation has been tested on: -64-bit MacOSX (10.6) +64-bit MacOSX Please note that to compile under the BSDs you must use gmake. diff --git a/Client Applications/rcracki_mt/RTI2Reader.cpp b/Client Applications/rcracki_mt/RTI2Reader.cpp index 3d8154d..692c73e 100644 --- a/Client Applications/rcracki_mt/RTI2Reader.cpp +++ b/Client Applications/rcracki_mt/RTI2Reader.cpp @@ -6,7 +6,7 @@ * Copyright 2010 Daniël Niggebrugge * Copyright 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,8 +59,8 @@ RTI2Reader::RTI2Reader(string Filename) memcpy(m_pHeader, m_pIndex, sizeof(RTI2Header)); m_pHeader->m_cppos = (unsigned int*)(m_pIndex + 8); m_pHeader->prefixstart = *(uint64*)(m_pIndex + 8 + (m_pHeader->rti_cplength * 4)); - m_chainsizebytes = ceil((float)(m_pHeader->rti_startptlength + m_pHeader->rti_endptlength + m_pHeader->rti_cplength) / 8); // Get the size of each chain in bytes - m_indexrowsizebytes = ceil((float)m_pHeader->rti_index_numchainslength / 8); + m_chainsizebytes = (UINT4)ceil((float)(m_pHeader->rti_startptlength + m_pHeader->rti_endptlength + m_pHeader->rti_cplength) / 8); // Get the size of each chain in bytes + m_indexrowsizebytes = (UINT4)ceil((float)m_pHeader->rti_index_numchainslength / 8); // Check the filesize fseek(m_pFile, 0, SEEK_END); len = ftell(m_pFile); @@ -121,7 +121,7 @@ int RTI2Reader::ReadChains(unsigned int &numChains, RainbowChainO *pData) uint64 chainrow = 0; // Buffer to store a single read chain unsigned int chainsProcessed = 0; // Number of chains processed - // ALERT: same problem with unsigned char here. + // XXX: same problem with unsigned char here. unsigned int NumChainsInRow = *(pNumChains + indexRow); while(chainsProcessed < numChains && fread(&chainrow, 1, m_chainsizebytes, m_pFile) == m_chainsizebytes) { @@ -138,13 +138,17 @@ int RTI2Reader::ReadChains(unsigned int &numChains, RainbowChainO *pData) curRowPosition = 0; } // Load the starting point from the data - pData[chainsProcessed].nIndexS = chainrow << 64 - m_pHeader->rti_startptlength; - pData[chainsProcessed].nIndexS = pData[chainsProcessed].nIndexS >> 64 - m_pHeader->rti_startptlength; + pData[chainsProcessed].nIndexS = chainrow << ( 64 - m_pHeader->rti_startptlength ); + pData[chainsProcessed].nIndexS = pData[chainsProcessed].nIndexS >> ( 64 - m_pHeader->rti_startptlength ); // Load the ending point prefix - pData[chainsProcessed].nIndexE = m_pHeader->prefixstart + indexRow << m_pHeader->rti_endptlength; + pData[chainsProcessed].nIndexE = ( m_pHeader->prefixstart + indexRow ) << m_pHeader->rti_endptlength; // Append the ending point suffix +#if defined(_WIN32) && !defined(__GNUC__) + pData[chainsProcessed].nIndexE |= (chainrow & (0xFFFFFFFFFFFFFFFFI64 >> m_pHeader->rti_cplength)) >> m_pHeader->rti_startptlength; +#else pData[chainsProcessed].nIndexE |= (chainrow & (0xFFFFFFFFFFFFFFFFllu >> m_pHeader->rti_cplength)) >> m_pHeader->rti_startptlength; +#endif //pData[chainsProcessed].nCheckPoint = (chainrow >> m_pHeader->rti_startptlength + m_pHeader->rti_endptlength); curRowPosition++; chainsProcessed++; diff --git a/Client Applications/rcracki_mt/RTI2Reader.h b/Client Applications/rcracki_mt/RTI2Reader.h index c3fc3bb..cd36e7d 100644 --- a/Client Applications/rcracki_mt/RTI2Reader.h +++ b/Client Applications/rcracki_mt/RTI2Reader.h @@ -6,7 +6,7 @@ * Copyright 2010 Daniël Niggebrugge * Copyright 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,12 +49,12 @@ class RTI2Reader : BaseRTReader { private: FILE *m_pFile; - unsigned int m_chainPosition; + UINT4 m_chainPosition; unsigned char *m_pPos, *m_pChainPos; static RTI2Header *m_pHeader; unsigned char *m_pIndex; - unsigned int m_chainsizebytes; - unsigned int m_indexrowsizebytes; + UINT4 m_chainsizebytes; + UINT4 m_indexrowsizebytes; public: diff --git a/Client Applications/rcracki_mt/RainbowCrack.cpp b/Client Applications/rcracki_mt/RainbowCrack.cpp index 9814834..2959787 100644 --- a/Client Applications/rcracki_mt/RainbowCrack.cpp +++ b/Client Applications/rcracki_mt/RainbowCrack.cpp @@ -16,7 +16,7 @@ * 2009-01-04 - - Slightly modified (or "fulhack" as * we say in sweden) to support cain .lst files. * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ * along with rcracki_mt. If not, see . */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__GNUC__) #pragma warning(disable : 4786 4267 4018) #endif @@ -49,7 +49,7 @@ #include #endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__GNUC__) #pragma comment(lib, "libeay32.lib") #endif @@ -61,15 +61,15 @@ void GetTableList(string sWildCharPathName, vector& vPathName) //vPathName.clear(); string sPath; - int n = sWildCharPathName.find_last_of('\\'); + string::size_type n = sWildCharPathName.find_last_of('\\'); - if (n == (sWildCharPathName.size() - 1)) + if ( n == (sWildCharPathName.size() - 1) ) { sWildCharPathName = sWildCharPathName.substr(0, n); n = sWildCharPathName.find_last_of('\\'); } - if (n != -1) + if (n != string::npos) sPath = sWildCharPathName.substr(0, n + 1); _finddata_t fd; diff --git a/Client Applications/rcracki_mt/TODO b/Client Applications/rcracki_mt/TODO index 98700d5..ad8273c 100644 --- a/Client Applications/rcracki_mt/TODO +++ b/Client Applications/rcracki_mt/TODO @@ -1,10 +1,7 @@ -* linux thread priorities * testing/benchmarking suite * remove openssl dependencies - ChainWalkContext.cpp - rand.h HashAlgorithm.cpp - des.h + des.h - can't use frt upstream as it's BSD licensed ad clause and is GPL incompatible md4.h (fix md4 so it can handle mscache lengths) sha.h (the local sha1 impl is slower than openssl's) * more generic method for path seperator than _WIN32 ifdef? @@ -12,20 +9,20 @@ OpenBSD threading misc warnings: -/tmp//ccWUTqDK.o(.text+0xcc7): In function `HashORACLE(unsigned char*, int, unsigned char*)': -: warning: strcpy() is almost always misused, please use strlcpy() -/usr/lib/libstdc++.so.47.0: warning: strcat() is almost always misused, please use strlcat() +################################################################################ +OpenBSD x86_64 -/tmp//ccmjYwuS.o(.text+0xbf9): In function `CChainWalkSet::CheckOrRotatePreCalcFile()': +/usr/local/lib/gcc/amd64-unknown-openbsd4.5/4.2.0/../../../libestdc++.so.8.0: warning: vsprintf() is often misused, please use vsnprintf() +/usr/local/lib/gcc/amd64-unknown-openbsd4.5/4.2.0/../../../libestdc++.so.8.0: warning: strcpy() is almost always misused, please use strlcpy() +/usr/local/lib/gcc/amd64-unknown-openbsd4.5/4.2.0/../../../libestdc++.so.8.0: warning: strcat() is almost always misused, please use strlcat() +ChainWalkSet.o(.text+0x121): In function `CChainWalkSet::CheckOrRotatePreCalcFile()': : warning: sprintf() is often misused, please use snprintf() -ChainWalkSet.cpp: In member function 'bool CChainWalkSet::FindInFile(long long -unsigned int*, unsigned char*, int)': -ChainWalkSet.cpp:154: warning: 'offset' may be used uninitialized in this -function +################################################################################ +only on win32 mingw32 ChainWalkContext.cpp: In member function 'void CChainWalkContext::HashToIndex(int)': -ChainWalkContext.cpp:544: warning: dereferencing type-punned pointer will break strict-aliasing rules +ChainWalkContext.cpp:574: warning: dereferencing type-punned pointer will break strict-aliasing rules HashAlgorithm.cpp: In function 'void HashPIX(unsigned char*, int, unsigned char*)': -HashAlgorithm.cpp:396: warning: dereferencing type-punned pointer will break strict-aliasing rules +HashAlgorithm.cpp:406: warning: dereferencing type-punned pointer will break strict-aliasing rules diff --git a/Client Applications/rcracki_mt/fast_md5.cpp b/Client Applications/rcracki_mt/fast_md5.cpp index 3df6afb..514be09 100644 --- a/Client Applications/rcracki_mt/fast_md5.cpp +++ b/Client Applications/rcracki_mt/fast_md5.cpp @@ -16,7 +16,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/fast_md5.h b/Client Applications/rcracki_mt/fast_md5.h index 47549f7..b3db17f 100644 --- a/Client Applications/rcracki_mt/fast_md5.h +++ b/Client Applications/rcracki_mt/fast_md5.h @@ -13,7 +13,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,7 +29,6 @@ * along with rcracki_mt. If not, see . */ - #ifndef FAST_MD5_H #define FAST_MD5_H @@ -37,8 +36,6 @@ #define MD5_DIGEST_LENGTH 16 -void -fast_MD5(unsigned char *pData, int len, unsigned char *pDigest); - +void fast_MD5(unsigned char *pData, int len, unsigned char *pDigest); #endif // FAST_MD5_H diff --git a/Client Applications/rcracki_mt/global.h b/Client Applications/rcracki_mt/global.h index 04c4e80..952aab4 100644 --- a/Client Applications/rcracki_mt/global.h +++ b/Client Applications/rcracki_mt/global.h @@ -5,7 +5,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/lm2ntlm.cpp b/Client Applications/rcracki_mt/lm2ntlm.cpp index d2afd27..33fd94d 100644 --- a/Client Applications/rcracki_mt/lm2ntlm.cpp +++ b/Client Applications/rcracki_mt/lm2ntlm.cpp @@ -5,7 +5,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * along with rcracki_mt. If not, see . */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__GNUC__) #pragma warning(disable : 4786 4267 4018) #endif diff --git a/Client Applications/rcracki_mt/lm2ntlm.h b/Client Applications/rcracki_mt/lm2ntlm.h index e608040..6a423f5 100644 --- a/Client Applications/rcracki_mt/lm2ntlm.h +++ b/Client Applications/rcracki_mt/lm2ntlm.h @@ -5,7 +5,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/md4.cpp b/Client Applications/rcracki_mt/md4.cpp index a35cdb5..e5d9c2f 100644 --- a/Client Applications/rcracki_mt/md4.cpp +++ b/Client Applications/rcracki_mt/md4.cpp @@ -6,7 +6,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/md4.h b/Client Applications/rcracki_mt/md4.h index fd11278..91753cb 100644 --- a/Client Applications/rcracki_mt/md4.h +++ b/Client Applications/rcracki_mt/md4.h @@ -6,7 +6,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/rcrackiThread.cpp b/Client Applications/rcracki_mt/rcrackiThread.cpp index 8123ba5..0b64a7a 100644 --- a/Client Applications/rcracki_mt/rcrackiThread.cpp +++ b/Client Applications/rcracki_mt/rcrackiThread.cpp @@ -5,7 +5,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * along with rcracki_mt. If not, see . */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__GNUC__) #pragma warning(disable : 4786 4267 4018) #endif diff --git a/Client Applications/rcracki_mt/rcrackiThread.h b/Client Applications/rcracki_mt/rcrackiThread.h index c5abeb4..37fa289 100644 --- a/Client Applications/rcracki_mt/rcrackiThread.h +++ b/Client Applications/rcracki_mt/rcrackiThread.h @@ -5,7 +5,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/rcracki_mt.ini b/Client Applications/rcracki_mt/rcracki_mt.ini index 17edb0a..27ab17e 100644 --- a/Client Applications/rcracki_mt/rcracki_mt.ini +++ b/Client Applications/rcracki_mt/rcracki_mt.ini @@ -1,33 +1,33 @@ -# Default settings for rcracki_mt -# Command line arguments override these defaults - -# Specify default amount of threads -Threads=1 - -# Set a default file to store temporary results. -# Set AlwaysStoreResultsToFile=1 or use -o to actually store results. -DefaultResultsFile=e:\default_rcracki_results.txt - -# This option requires DefaultResultsFile to be set to a file -#AlwaysStoreResultsToFile=1 - -# Set some default file locations to search for rainbow tables. -# You need to use these in combination with the command line argument -a [algorithm] -# Or you can set a default algorithm here with 'DefaultAlgorithm'. -# Algorithm is the name you use as specifier after 'DefaultRainbowTablesPath.' -# You can specify multiple lines per algorithm, one path/directory per line. -# Any locations you specify on the command line will be added to the list as well. -# For Windows users: locations in this file with a different case -# as on the command line are treated as separate locations (run through twice) -#DefaultRainbowTablePath.MD5=X:\RTI\MD5 -#DefaultRainbowTablePath.NTLM=X:\RTI\NTLM\ntlm_loweralpha-space#1-9_* - -# This option requires at least one 'DefaultRainbowTablePath.[algorithm]' to be set -#DefaultAlgorithm=MD5 - -# Always show debugging infomation (command line option -v) -# AlwaysDebug=1 - -# Always keep precalculation files after cracking, don't remove them. -# These files are saved by session name. So you can store precalculations over multiple jobs. +# Default settings for rcracki_mt +# Command line arguments override these defaults + +# Specify default amount of threads +Threads=1 + +# Set a default file to store temporary results. +# Set AlwaysStoreResultsToFile=1 or use -o to actually store results. +DefaultResultsFile=e:\default_rcracki_results.txt + +# This option requires DefaultResultsFile to be set to a file +#AlwaysStoreResultsToFile=1 + +# Set some default file locations to search for rainbow tables. +# You need to use these in combination with the command line argument -a [algorithm] +# Or you can set a default algorithm here with 'DefaultAlgorithm'. +# Algorithm is the name you use as specifier after 'DefaultRainbowTablesPath.' +# You can specify multiple lines per algorithm, one path/directory per line. +# Any locations you specify on the command line will be added to the list as well. +# For Windows users: locations in this file with a different case +# as on the command line are treated as separate locations (run through twice) +#DefaultRainbowTablePath.MD5=X:\RTI\MD5 +#DefaultRainbowTablePath.NTLM=X:\RTI\NTLM\ntlm_loweralpha-space#1-9_* + +# This option requires at least one 'DefaultRainbowTablePath.[algorithm]' to be set +#DefaultAlgorithm=MD5 + +# Always show debugging infomation (command line option -v) +# AlwaysDebug=1 + +# Always keep precalculation files after cracking, don't remove them. +# These files are saved by session name. So you can store precalculations over multiple jobs. #AlwaysKeepPrecalcFiles=1 \ No newline at end of file diff --git a/Client Applications/rcracki_mt/sha1.cpp b/Client Applications/rcracki_mt/sha1.cpp index c1af774..40c0e9f 100644 --- a/Client Applications/rcracki_mt/sha1.cpp +++ b/Client Applications/rcracki_mt/sha1.cpp @@ -7,7 +7,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client Applications/rcracki_mt/sha1.h b/Client Applications/rcracki_mt/sha1.h index 0e59270..231077b 100644 --- a/Client Applications/rcracki_mt/sha1.h +++ b/Client Applications/rcracki_mt/sha1.h @@ -5,7 +5,7 @@ * Copyright 2009, 2010 Daniël Niggebrugge * Copyright 2009, 2010 James Nobis * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by -- 2.39.2