Debian Codegraph @

src/core/lmgerman.h

raw symbols SCIP
1 /*
2 *
3 * Ophcrack is a Lanmanager/NTLM hash cracker based on the faster time-memory
4 * trade-off using rainbow tables.
5 *
6 * Created with the help of: Maxime Mueller, Luca Wullschleger, Claude
7 * Hochreutiner, Andreas Huber and Etienne Dysli.
8 *
9 * Copyright (c) 2008 Philippe Oechslin, Cedric Tissieres, Bertrand Mesot
10 *
11 * Ophcrack is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * Ophcrack is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with Ophcrack; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 * This program is released under the GPL with the additional exemption
26 * that compiling, linking, and/or using OpenSSL is allowed.
27 *
28 *
29 *
30 *
31 */
32 #ifndef LMGERMAN_H
33 #define LMGERMAN_H
34
35 #include "misc.h"
36 #include "table.h"
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 typedef struct lmgerman_max_t_ {
43 char n;
44 char k;
45 uint32_t max;
46 } lmgerman_max_t;
47
48 static const uchar_t lmgerman_chars[73] = {
49 0x8e, 0x99, 0x9a, 0xe1, '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
50 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
51 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', '!', '"', '#', '$', '%', '&', '\'',
52 '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[',
53 '\\', ']', '^', '_', '`', '{', '|', '}', '~' };
54
55 static const uchar_t lmgerman_ranks[28][35] = {
56 {1,2,4,8,16,32,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
57 {3,5,9,17,33,65,6,10,18,34,66,12,20,36,68,24,40,72,48,80,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
58 {7,11,19,35,67,13,21,37,69,25,41,73,49,81,97,14,22,38,70,26,42,74,50,82,98,28,44,76,52,84,100,56,88,104,112},
59 {1,2,4,8,16,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
60 {3,5,9,17,33,6,10,18,34,12,20,36,24,40,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
61 {15,23,39,71,27,43,75,51,83,99,29,45,77,53,85,101,57,89,105,113,30,46,78,54,86,102,58,90,106,114,60,92,108,116,120},
62 {1,2,4,8,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
63 {7,11,19,35,13,21,37,25,41,49,14,22,38,26,42,50,28,44,52,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
64 {31,47,79,55,87,103,59,91,107,115,61,93,109,117,121,62,94,110,118,122,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
65 {3,5,9,17,6,10,18,12,20,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
66 {15,23,39,27,43,51,29,45,53,57,30,46,54,58,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
67 {1,2,4,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
68 {7,11,19,13,21,25,14,22,26,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
69 {63,95,111,119,123,125,126,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
84 };
85
86 static const char lmgerman_choose[8][8] =
87 { { 1, 0, 0, 0, 0, 0, 0, 0 },
88 { 1, 1, 0, 0, 0, 0, 0, 0 },
89 { 1, 2, 1, 0, 0, 0, 0, 0 },
90 { 1, 3, 3, 1, 0, 0, 0, 0 },
91 { 1, 4, 6, 4, 1, 0, 0, 0 },
92 { 1, 5, 10, 10, 5, 1, 0, 0 },
93 { 1, 6, 15, 20, 15, 6, 1, 0 },
94 { 1, 7, 21, 35, 35, 21, 7, 1 } };
95
96 static const lmgerman_max_t lmgerman_spec_max[28] = {
97 { 7, 1, 3560555371U },
98 { 7, 2, 4179782393U },
99 { 7, 3, 4239611091U },
100 { 6, 1, 4283841592U },
101 { 6, 2, 4290251810U },
102 { 7, 4, 4293720140U },
103 { 5, 1, 4294254325U },
104 { 6, 3, 4294749801U },
105 { 7, 5, 4294870439U },
106 { 5, 2, 4294932373U },
107 { 6, 4, 4294953915U },
108 { 4, 1, 4294960109U },
109 { 5, 3, 4294963699U },
110 { 7, 6, 4294966030U },
111 { 4, 2, 4294966569U },
112 { 6, 5, 4294967069U },
113 { 5, 4, 4294967173U },
114 { 3, 1, 4294967240U },
115 { 4, 3, 4294967261U },
116 { 7, 7, 4294967280U },
117 { 6, 6, 4294967285U },
118 { 3, 2, 4294967289U },
119 { 5, 5, 4294967290U },
120 { 2, 1, 4294967291U },
121 { 4, 4, 4294967292U },
122 { 3, 3, 4294967293U },
123 { 2, 2, 4294967294U },
124 { 1, 1, 4294967295U } };
125
126 int lmgerman_setup(void *tbl_);
127 void lmgerman_find(void *hsh_, void *tbl_, void *el_);
128 int lmgerman_lookup_srt(void *hsh_, void *tbl_, void *el_);
129 int lmgerman_check(void *hsh_, void *tbl_, void *el_);
130 int lmgerman_isvalid(void *hsh_, void *tbl_);
131
132 void lmgerman_mkredux(table_t *tbl, uchar_t *hash, uchar_t *pwd, int n_redux);
133
134 uint64_t lmgerman_bin73(uchar_t *input);
135 void lmgerman_unbin36(uint32_t input, uchar_t *output);
136
137 #ifdef __cplusplus
138 }
139 #endif
140 #endif