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