]> git.sesse.net Git - freerainbowtables/blob - Client Applications/rcracki_mt/lm2ntlm.h
rcracki_mt updated to rti2
[freerainbowtables] / Client Applications / rcracki_mt / lm2ntlm.h
1 #include <stdio.h>
2 #include <string>
3 #include <map>
4 #ifdef _WIN32
5 #include <conio.h>
6 #endif
7 #include "openssl/md4.h"
8 #include "time.h"
9 #include "signal.h"
10 #include "Public.h"
11 using namespace std;
12
13 class LM2NTLMcorrector
14 {
15 public:
16         LM2NTLMcorrector();
17
18 private:
19         map<unsigned char, map<int, unsigned char> > m_mapChar;
20         uint64 progressCurrentCombination;
21         uint64 totalCurrentCombination;
22         uint64 counterOverall;
23         unsigned char NTLMHash[16];
24         clock_t startClock;
25         int countCombinations;
26         int countTotalCombinations;
27         int counter;
28         clock_t previousClock;
29         unsigned char currentCharmap[16][128];
30         bool aborting;
31         string sBinary;
32
33 private:
34         bool checkNTLMPassword(unsigned char* pLMPassword, int nLMPasswordLen, string& sNTLMPassword);
35         bool startCorrecting(string sLMPassword, unsigned char* pNTLMHash, string& sNTLMPassword, unsigned char* pLMPassword);
36         void printString(unsigned char* muteThis, int length);
37         void setupCombinationAtPositions(int length, unsigned char* pMuteMe, unsigned char* pTempMute, int* jAtPos, bool* fullAtPos, int* sizeAtPos);
38         bool checkPermutations(int length, unsigned char* pMuteMe, unsigned char* pTempMute, int* jAtPos, int* sizeAtPos, unsigned char* pLMPassword, string& sNTLMPassword);
39
40         int calculateTotalCombinations(int length, int setSize);
41         int factorial (int num);
42
43         bool parseHexPassword(string hexPassword, string& sPlain);
44         bool NormalizeHexString(string& sHash);
45         void ParseHash(string sHash, unsigned char* pHash, int& nHashLen);
46         string ByteToStr(const unsigned char* pData, int nLen);
47         void addToMapW(unsigned char key, unsigned char value1, unsigned char value2);
48         void fillMapW();
49         void checkAbort();
50         void writeEndStats();
51 public:
52         bool LMPasswordCorrectUnicode(string hexPassword, unsigned char* NTLMHash, string& sNTLMPassword);
53         string getBinary();
54 };
55