| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
#ifndef HASH_H |
| 33 |
#define HASH_H |
| 34 |
|
| 35 |
#include <stdio.h> |
| 36 |
|
| 37 |
#include "misc.h" |
| 38 |
#include "list.h" |
| 39 |
#include "table.h" |
| 40 |
|
| 41 |
#ifdef __cplusplus |
| 42 |
extern "C" { |
| 43 |
#endif |
| 44 |
|
| 45 |
static const uchar_t empty_lmhash[8] = {0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee}; |
| 46 |
static const uchar_t empty_nthash[16] = {0x31, 0xd6, 0xcf, 0xe0, 0xd1, 0x6a, 0xe9, 0x31, |
| 47 |
0xb7, 0x3c, 0x59, 0xd7, 0xe0, 0xc0, 0x89, 0xc0 }; |
| 48 |
static const char pwdump_nopwd[33] = "NO PASSWORD*********************"; |
| 49 |
static const char samdump_nopwd[33] = "00000000000000000000000000000000"; |
| 50 |
static const char empty_pwd[8] = "/EMPTY/"; |
| 51 |
|
| 52 |
typedef enum { lm1, lm2, nt } hash_kind_t; |
| 53 |
|
| 54 |
typedef struct htbl_t_ { |
| 55 |
table_t *tbl; |
| 56 |
int col; |
| 57 |
int covered; |
| 58 |
} htbl_t; |
| 59 |
|
| 60 |
typedef struct hash_t_ { |
| 61 |
hash_kind_t kind; |
| 62 |
int id; |
| 63 |
|
| 64 |
int uid; |
| 65 |
int done; |
| 66 |
|
| 67 |
uchar_t *hash; |
| 68 |
char *pwd; |
| 69 |
char *str; |
| 70 |
char *status; |
| 71 |
char info[64]; |
| 72 |
|
| 73 |
int length; |
| 74 |
int category; |
| 75 |
int time; |
| 76 |
char *table; |
| 77 |
|
| 78 |
list_t *tables; |
| 79 |
list_nd_t *tnd; |
| 80 |
|
| 81 |
struct hash_t_ *lmhsh1; |
| 82 |
struct hash_t_ *lmhsh2; |
| 83 |
} hash_t; |
| 84 |
|
| 85 |
uchar_t *hash_alloc_hash(hash_kind_t kind); |
| 86 |
char *hash_alloc_pwd(hash_kind_t kind); |
| 87 |
|
| 88 |
hash_t *hash_alloc(hash_kind_t kind, int hlen, int plen, int idx); |
| 89 |
void hash_free(hash_t *hsh); |
| 90 |
|
| 91 |
void hash_add_table(hash_t *hsh, table_t *tbl); |
| 92 |
int hash_extract_lmnt(char *buff, list_t *hashes, int id); |
| 93 |
int hash_load_pwdump(list_t *hashes, FILE *file, int id); |
| 94 |
int hash_load_sam(list_t *hashes, const char *dir, int id); |
| 95 |
int hash_dump_sam(list_t *hashes, int id); |
| 96 |
void hash_print(hash_t *hsh, FILE *file, int nice, int status, int hide); |
| 97 |
|
| 98 |
#ifdef __cplusplus |
| 99 |
} |
| 100 |
#endif |
| 101 |
#endif |