2 * rcracki_mt is a multithreaded implementation and fork of the original
\r
5 * Copyright 2009, 2010 Daniƫl Niggebrugge <niggebrugge@fox-it.com>
\r
6 * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
\r
8 * This file is part of rcracki_mt.
\r
10 * rcracki_mt is free software: you can redistribute it and/or modify
\r
11 * it under the terms of the GNU General Public License as published by
\r
12 * the Free Software Foundation, either version 2 of the License, or
\r
13 * (at your option) any later version.
\r
15 * rcracki_mt is distributed in the hope that it will be useful,
\r
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
18 * GNU General Public License for more details.
\r
20 * You should have received a copy of the GNU General Public License
\r
21 * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
\r
30 //#include "openssl/md4.h"
\r
36 using namespace std;
\r
38 class LM2NTLMcorrector
\r
44 map<unsigned char, map<int, unsigned char> > m_mapChar;
\r
45 uint64 progressCurrentCombination;
\r
46 uint64 totalCurrentCombination;
\r
47 uint64 counterOverall;
\r
48 unsigned char NTLMHash[16];
\r
50 int countCombinations;
\r
51 int countTotalCombinations;
\r
53 clock_t previousClock;
\r
54 unsigned char currentCharmap[16][128];
\r
59 bool checkNTLMPassword(unsigned char* pLMPassword, int nLMPasswordLen, string& sNTLMPassword);
\r
60 bool startCorrecting(string sLMPassword, string& sNTLMPassword, unsigned char* pLMPassword);
\r
61 void printString(unsigned char* muteThis, int length);
\r
62 void setupCombinationAtPositions(int length, unsigned char* pMuteMe, unsigned char* pTempMute, int* jAtPos, bool* fullAtPos, int* sizeAtPos);
\r
63 bool checkPermutations(int length, unsigned char* pTempMute, int* jAtPos, int* sizeAtPos, unsigned char* pLMPassword, string& sNTLMPassword);
\r
65 int calculateTotalCombinations(int length, int setSize);
\r
66 int factorial (int num);
\r
68 bool parseHexPassword(string hexPassword, string& sPlain);
\r
69 bool NormalizeHexString(string& sHash);
\r
70 void ParseHash(string sHash, unsigned char* pHash, int& nHashLen);
\r
71 string ByteToStr(const unsigned char* pData, int nLen);
\r
72 void addToMapW(unsigned char key, unsigned char value1, unsigned char value2);
\r
75 void writeEndStats();
\r
77 bool LMPasswordCorrectUnicode(string hexPassword, unsigned char* NTLMHash, string& sNTLMPassword);
\r