2 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
7 * This program is copyright Alec Muffett 1993. The author disclaims all
8 * responsibility or liability with respect to it's usage or its effect
9 * upon hardware or computer systems, and maintains copyright as set out
10 * in the "LICENCE" document which accompanies distributions of Crack v4.0
17 static char *r_destructors
[] = {
18 ":", /* noop - must do this to test raw word. */
19 "[", /* trimming leading/trailing junk */
26 "/?p@?p", /* purging out punctuation/symbols/junk */
29 /* attempt reverse engineering of password strings */
33 "/$s$s/0s0o/2s2a/3s3e",
34 "/$s$s/0s0o/2s2a/3s3e/5s5s",
35 "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1i",
36 "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1l",
37 "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1i/4s4a",
38 "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1i/4s4h",
39 "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1l/4s4a",
40 "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1l/4s4h",
41 "/$s$s/0s0o/2s2a/3s3e/5s5s/4s4a",
42 "/$s$s/0s0o/2s2a/3s3e/5s5s/4s4h",
43 "/$s$s/0s0o/2s2a/3s3e/5s5s/4s4a",
44 "/$s$s/0s0o/2s2a/3s3e/5s5s/4s4h",
45 "/$s$s/0s0o/2s2a/3s3e/1s1i",
46 "/$s$s/0s0o/2s2a/3s3e/1s1l",
47 "/$s$s/0s0o/2s2a/3s3e/1s1i/4s4a",
48 "/$s$s/0s0o/2s2a/3s3e/1s1i/4s4h",
49 "/$s$s/0s0o/2s2a/3s3e/1s1l/4s4a",
50 "/$s$s/0s0o/2s2a/3s3e/1s1l/4s4h",
51 "/$s$s/0s0o/2s2a/3s3e/4s4a",
52 "/$s$s/0s0o/2s2a/3s3e/4s4h",
53 "/$s$s/0s0o/2s2a/3s3e/4s4a",
54 "/$s$s/0s0o/2s2a/3s3e/4s4h",
55 "/$s$s/0s0o/2s2a/5s5s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3e/1s1l/4s4a",
137 "/$s$s/2s2a/3s3e/1s1l/4s4h",
138 "/$s$s/2s2a/3s3e/4s4a",
139 "/$s$s/2s2a/3s3e/4s4h",
140 "/$s$s/2s2a/3s3e/4s4a",
141 "/$s$s/2s2a/3s3e/4s4h",
143 "/$s$s/2s2a/5s5s/1s1i",
144 "/$s$s/2s2a/5s5s/1s1l",
145 "/$s$s/2s2a/5s5s/1s1i/4s4a",
146 "/$s$s/2s2a/5s5s/1s1i/4s4h",
147 "/$s$s/2s2a/5s5s/1s1l/4s4a",
148 "/$s$s/2s2a/5s5s/1s1l/4s4h",
149 "/$s$s/2s2a/5s5s/4s4a",
150 "/$s$s/2s2a/5s5s/4s4h",
151 "/$s$s/2s2a/5s5s/4s4a",
152 "/$s$s/2s2a/5s5s/4s4h",
155 "/$s$s/2s2a/1s1i/4s4a",
156 "/$s$s/2s2a/1s1i/4s4h",
157 "/$s$s/2s2a/1s1l/4s4a",
158 "/$s$s/2s2a/1s1l/4s4h",
165 "/$s$s/3s3e/5s5s/1s1i",
166 "/$s$s/3s3e/5s5s/1s1l",
167 "/$s$s/3s3e/5s5s/1s1i/4s4a",
168 "/$s$s/3s3e/5s5s/1s1i/4s4h",
169 "/$s$s/3s3e/5s5s/1s1l/4s4a",
170 "/$s$s/3s3e/5s5s/1s1l/4s4h",
171 "/$s$s/3s3e/5s5s/4s4a",
172 "/$s$s/3s3e/5s5s/4s4h",
173 "/$s$s/3s3e/5s5s/4s4a",
174 "/$s$s/3s3e/5s5s/4s4h",
177 "/$s$s/3s3e/1s1i/4s4a",
178 "/$s$s/3s3e/1s1i/4s4h",
179 "/$s$s/3s3e/1s1l/4s4a",
180 "/$s$s/3s3e/1s1l/4s4h",
188 "/$s$s/5s5s/1s1i/4s4a",
189 "/$s$s/5s5s/1s1i/4s4h",
190 "/$s$s/5s5s/1s1l/4s4a",
191 "/$s$s/5s5s/1s1l/4s4h",
209 "/0s0o/2s2a/3s3e/5s5s",
210 "/0s0o/2s2a/3s3e/5s5s/1s1i",
211 "/0s0o/2s2a/3s3e/5s5s/1s1l",
212 "/0s0o/2s2a/3s3e/5s5s/1s1i/4s4a",
213 "/0s0o/2s2a/3s3e/5s5s/1s1i/4s4h",
214 "/0s0o/2s2a/3s3e/5s5s/1s1l/4s4a",
215 "/0s0o/2s2a/3s3e/5s5s/1s1l/4s4h",
216 "/0s0o/2s2a/3s3e/5s5s/4s4a",
217 "/0s0o/2s2a/3s3e/5s5s/4s4h",
218 "/0s0o/2s2a/3s3e/5s5s/4s4a",
219 "/0s0o/2s2a/3s3e/5s5s/4s4h",
220 "/0s0o/2s2a/3s3e/1s1i",
221 "/0s0o/2s2a/3s3e/1s1l",
222 "/0s0o/2s2a/3s3e/1s1i/4s4a",
223 "/0s0o/2s2a/3s3e/1s1i/4s4h",
224 "/0s0o/2s2a/3s3e/1s1l/4s4a",
225 "/0s0o/2s2a/3s3e/1s1l/4s4h",
226 "/0s0o/2s2a/3s3e/4s4a",
227 "/0s0o/2s2a/3s3e/4s4h",
228 "/0s0o/2s2a/3s3e/4s4a",
229 "/0s0o/2s2a/3s3e/4s4h",
231 "/0s0o/2s2a/5s5s/1s1i",
232 "/0s0o/2s2a/5s5s/1s1l",
233 "/0s0o/2s2a/5s5s/1s1i/4s4a",
234 "/0s0o/2s2a/5s5s/1s1i/4s4h",
235 "/0s0o/2s2a/5s5s/1s1l/4s4a",
236 "/0s0o/2s2a/5s5s/1s1l/4s4h",
237 "/0s0o/2s2a/5s5s/4s4a",
238 "/0s0o/2s2a/5s5s/4s4h",
239 "/0s0o/2s2a/5s5s/4s4a",
240 "/0s0o/2s2a/5s5s/4s4h",
243 "/0s0o/2s2a/1s1i/4s4a",
244 "/0s0o/2s2a/1s1i/4s4h",
245 "/0s0o/2s2a/1s1l/4s4a",
246 "/0s0o/2s2a/1s1l/4s4h",
253 "/0s0o/3s3e/5s5s/1s1i",
254 "/0s0o/3s3e/5s5s/1s1l",
255 "/0s0o/3s3e/5s5s/1s1i/4s4a",
256 "/0s0o/3s3e/5s5s/1s1i/4s4h",
257 "/0s0o/3s3e/5s5s/1s1l/4s4a",
258 "/0s0o/3s3e/5s5s/1s1l/4s4h",
259 "/0s0o/3s3e/5s5s/4s4a",
260 "/0s0o/3s3e/5s5s/4s4h",
261 "/0s0o/3s3e/5s5s/4s4a",
262 "/0s0o/3s3e/5s5s/4s4h",
265 "/0s0o/3s3e/1s1i/4s4a",
266 "/0s0o/3s3e/1s1i/4s4h",
267 "/0s0o/3s3e/1s1l/4s4a",
268 "/0s0o/3s3e/1s1l/4s4h",
276 "/0s0o/5s5s/1s1i/4s4a",
277 "/0s0o/5s5s/1s1i/4s4h",
278 "/0s0o/5s5s/1s1l/4s4a",
279 "/0s0o/5s5s/1s1l/4s4h",
297 "/2s2a/3s3e/5s5s/1s1i",
298 "/2s2a/3s3e/5s5s/1s1l",
299 "/2s2a/3s3e/5s5s/1s1i/4s4a",
300 "/2s2a/3s3e/5s5s/1s1i/4s4h",
301 "/2s2a/3s3e/5s5s/1s1l/4s4a",
302 "/2s2a/3s3e/5s5s/1s1l/4s4h",
303 "/2s2a/3s3e/5s5s/4s4a",
304 "/2s2a/3s3e/5s5s/4s4h",
305 "/2s2a/3s3e/5s5s/4s4a",
306 "/2s2a/3s3e/5s5s/4s4h",
309 "/2s2a/3s3e/1s1i/4s4a",
310 "/2s2a/3s3e/1s1i/4s4h",
311 "/2s2a/3s3e/1s1l/4s4a",
312 "/2s2a/3s3e/1s1l/4s4h",
320 "/2s2a/5s5s/1s1i/4s4a",
321 "/2s2a/5s5s/1s1i/4s4h",
322 "/2s2a/5s5s/1s1l/4s4a",
323 "/2s2a/5s5s/1s1l/4s4h",
342 "/3s3e/5s5s/1s1i/4s4a",
343 "/3s3e/5s5s/1s1i/4s4h",
344 "/3s3e/5s5s/1s1l/4s4a",
345 "/3s3e/5s5s/1s1l/4s4h",
387 FascistLook(PWDICT
*pwp
, char *instring
)
392 char rpassword
[PATH_MAX
];
394 notfound
= PW_WORDS(pwp
);
396 (void) strlcpy(rpassword
, instring
, TRUNCSTRINGSIZE
);
397 password
= rpassword
;
399 (void) strcpy(password
, Lowercase(password
));
400 (void) Trim(password
);
403 * it should be safe to use Mangle with its reliance on PATH_SIZE
404 * since password cannot be longer than TRUNCSTRINGSIZE;
405 * nonetheless this is not an elegant solution
408 for (i
= 0; r_destructors
[i
]; i
++) {
411 if (!(a
= Mangle(password
, r_destructors
[i
]))) {
415 if (FindPW(pwp
, a
) != notfound
) {
416 return (DICTIONARY_WORD
);
420 (void) strlcpy(password
, Reverse(password
), PATH_MAX
);
422 for (i
= 0; r_destructors
[i
]; i
++) {
425 if (!(a
= Mangle(password
, r_destructors
[i
]))) {
428 if (FindPW(pwp
, a
) != notfound
) {
429 return (REVERSE_DICTIONARY_WORD
);
437 DictCheck(char *password
, char *path
)
442 if ((pwp
= PWOpen(path
, "rF")) == NULL
)
443 return (DATABASE_OPEN_FAIL
);
445 r
= FascistLook(pwp
, password
);