diff --git a/src/interface_migrate.c b/src/interface_migrate.c deleted file mode 100644 index 3f1e624f7..000000000 --- a/src/interface_migrate.c +++ /dev/null @@ -1,1470 +0,0 @@ - - " 30 | md5(utf16le($pass).$salt) | Raw Hash, Salted and/or Iterated", - " 120 | sha1($salt.$pass) | Raw Hash, Salted and/or Iterated", - " 130 | sha1(utf16le($pass).$salt) | Raw Hash, Salted and/or Iterated", - " 140 | sha1($salt.utf16le($pass)) | Raw Hash, Salted and/or Iterated", - " 1410 | sha256($pass.$salt) | Raw Hash, Salted and/or Iterated", - " 1420 | sha256($salt.$pass) | Raw Hash, Salted and/or Iterated", - " 1430 | sha256(utf16le($pass).$salt) | Raw Hash, Salted and/or Iterated", - " 1440 | sha256($salt.utf16le($pass)) | Raw Hash, Salted and/or Iterated", - " 1710 | sha512($pass.$salt) | Raw Hash, Salted and/or Iterated", - " 1720 | sha512($salt.$pass) | Raw Hash, Salted and/or Iterated", - " 1730 | sha512(utf16le($pass).$salt) | Raw Hash, Salted and/or Iterated", - " 1740 | sha512($salt.utf16le($pass)) | Raw Hash, Salted and/or Iterated", - " 50 | HMAC-MD5 (key = $pass) | Raw Hash, Authenticated", - " 60 | HMAC-MD5 (key = $salt) | Raw Hash, Authenticated", - " 150 | HMAC-SHA1 (key = $pass) | Raw Hash, Authenticated", - " 160 | HMAC-SHA1 (key = $salt) | Raw Hash, Authenticated", - " 1450 | HMAC-SHA256 (key = $pass) | Raw Hash, Authenticated", - " 1460 | HMAC-SHA256 (key = $salt) | Raw Hash, Authenticated", - " 1750 | HMAC-SHA512 (key = $pass) | Raw Hash, Authenticated", - " 1760 | HMAC-SHA512 (key = $salt) | Raw Hash, Authenticated", - " 22 | Juniper NetScreen/SSG (ScreenOS) | Operating Systems", - -static const char *ST_HASH_00021 = "e983672a03adcc9767b24584338eb378:00"; -static const char *ST_HASH_00022 = "nKjiFErqK7TPcZdFZsZMNWPtw4Pv8n:26506173"; -static const char *ST_HASH_00030 = "1169500a7dfece72e1f7fc9c9410867a:687430237020"; -static const char *ST_HASH_00050 = "e28e4e37e972a945e464b5226053bac0:40"; -static const char *ST_HASH_00060 = "7f51edecfa6fb401a0b5e63d33fc8c0e:84143"; -static const char *ST_HASH_00120 = "a428863972744b16afef28e0087fc094b44bb7b1:465727565"; -static const char *ST_HASH_00130 = "0a9e4591f539a77cd3af67bae207d250bc86bac6:23240710432"; -static const char *ST_HASH_00140 = "03b83421e2aa6d872d1f8dee001dc226ef01722b:818436"; -static const char *ST_HASH_00150 = "02b256705348a28b1d6c0f063907979f7e0c82f8:10323"; -static const char *ST_HASH_00160 = "8d7cb4d4a27a438059bb83a34d1e6cc439669168:2134817"; -static const char *ST_HASH_01410 = "5bb7456f43e3610363f68ad6de82b8b96f3fc9ad24e9d1f1f8d8bd89638db7c0:12480864321"; -static const char *ST_HASH_01420 = "816d1ded1d621873595048912ea3405d9d42afd3b57665d9f5a2db4d89720854:36176620"; -static const char *ST_HASH_01430 = "b2d0db162e30dfef1bfd606689a3acbc213c47ef3fd11968394191886075249d:32002"; -static const char *ST_HASH_01440 = "84ebe1bc3d59919a8c4f9337d66bd163661586c828b24b8067a27a6dc4228c64:05662"; -static const char *ST_HASH_01450 = "b435ffbacea34d5eb0dbc4d69a92f0152f2cf4cd364d34c2ece322ca22d8b334:21217"; -static const char *ST_HASH_01460 = "8b9472281c36c3a693703de0e0f1ffab8fc0ecdd3bc5ead04c76dd74ef431e49:70108387805"; -static const char *ST_HASH_01600 = "$apr1$62722340$zGjeAwVP2KwY6MtumUI1N/"; -static const char *ST_HASH_01710 = "3f749c84d00c6f94a6651b5c195c71dacae08f3cea6fed760232856cef701f7bf60d7f38a587f69f159d4e4cbe00435aeb9c8c0a4927b252d76a744e16e87e91:388026522082"; -static const char *ST_HASH_01720 = "efc5dd0e4145970917abdc311e1d4e23ba0afa9426d960cb28569f4d585cb031af5c936f57fbcb0a08368a1b302573cf582100d40bd7c632f3d8aecd1a1a8eb1:812"; -static const char *ST_HASH_01730 = "eefb67342d62a5d8ac84e8ae89d0f157f03749bd0427c80637003a4760feefdb36cbe11ba35ab2015b3691e2e83803178c986aa85f29e6f56938b469a31ccd7a:6576666"; -static const char *ST_HASH_01740 = "ce77bf8a8ca9b9cf0ed67edde58ed7fafd4542ce1378fc8bd87b05656ebf92e5711517d5930c18de93a71990e77e1037423e5b64c2f293be7d859d7b6921622e:1512373"; -static const char *ST_HASH_01750 = "138c00f17a1a0363f274817c91118f019aff09f937bfdaea844280a0c0e7811267cc4735d967d8640eed1218268c1c4a76fec8f7aa551491b353829f3a654270:885142"; -static const char *ST_HASH_01760 = "7d02921299935179d509e6dd4f3d0f2944e3451ea9de3af16baead6a7297e5653577d2473a0fff743d9fe78a89bd49296114319989dc7e7870fc7f62bc96accb:114"; - -static const char *HT_00030 = "md5(utf16le($pass).$salt)"; -static const char *HT_00050 = "HMAC-MD5 (key = $pass)"; -static const char *HT_00060 = "HMAC-MD5 (key = $salt)"; -static const char *HT_00100 = "SHA1"; -static const char *HT_00110 = "sha1($pass.$salt)"; -static const char *HT_00120 = "sha1($salt.$pass)"; -static const char *HT_00130 = "sha1(utf16le($pass).$salt)"; -static const char *HT_00140 = "sha1($salt.utf16le($pass))"; -static const char *HT_00150 = "HMAC-SHA1 (key = $pass)"; -static const char *HT_00160 = "HMAC-SHA1 (key = $salt)"; -static const char *HT_01410 = "sha256($pass.$salt)"; -static const char *HT_01420 = "sha256($salt.$pass)"; -static const char *HT_01430 = "sha256(utf16le($pass).$salt)"; -static const char *HT_01440 = "sha256($salt.utf16le($pass))"; -static const char *HT_01450 = "HMAC-SHA256 (key = $pass)"; -static const char *HT_01460 = "HMAC-SHA256 (key = $salt)"; -static const char *HT_01600 = "Apache $apr1$ MD5, md5apr1, MD5 (APR)"; -static const char *HT_01710 = "sha512($pass.$salt)"; -static const char *HT_01720 = "sha512($salt.$pass)"; -static const char *HT_01730 = "sha512(utf16le($pass).$salt)"; -static const char *HT_01740 = "sha512($salt.utf16le($pass))"; -static const char *HT_01750 = "HMAC-SHA512 (key = $pass)"; -static const char *HT_01760 = "HMAC-SHA512 (key = $salt)"; - -static const char *HT_00022 = "Juniper NetScreen/SSG (ScreenOS)"; - -/** - * decoder / encoder - */ - -int netscreen_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u32 *digest = (u32 *) hash_buf->digest; - - salt_t *salt = hash_buf->salt; - - token_t token; - - token.token_cnt = 2; - - token.sep[0] = hashconfig->separator; - token.len_min[0] = 30; - token.len_max[0] = 30; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_BASE64A; - - token.len_min[1] = 1; - token.len_max[1] = SALT_MAX; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - // unscramble - - u8 clean_input_buf[32] = { 0 }; - - char sig[6] = { 'n', 'r', 'c', 's', 't', 'n' }; - int pos[6] = { 0, 6, 12, 17, 23, 29 }; - - for (int i = 0, j = 0, k = 0; i < 30; i++) - { - if (i == pos[j]) - { - if (sig[j] != hash_pos[i]) return (PARSER_SIGNATURE_UNMATCHED); - - j++; - } - else - { - clean_input_buf[k] = hash_pos[i]; - - k++; - } - } - - // base64 decode - - u32 a, b, c, d, e, f; - - a = base64_to_int (clean_input_buf[ 0] & 0x7f); - b = base64_to_int (clean_input_buf[ 1] & 0x7f); - c = base64_to_int (clean_input_buf[ 2] & 0x7f); - d = base64_to_int (clean_input_buf[ 3] & 0x7f); - e = base64_to_int (clean_input_buf[ 4] & 0x7f); - f = base64_to_int (clean_input_buf[ 5] & 0x7f); - - digest[0] = (((a << 12) | (b << 6) | (c)) << 16) - | (((d << 12) | (e << 6) | (f)) << 0); - - a = base64_to_int (clean_input_buf[ 6] & 0x7f); - b = base64_to_int (clean_input_buf[ 7] & 0x7f); - c = base64_to_int (clean_input_buf[ 8] & 0x7f); - d = base64_to_int (clean_input_buf[ 9] & 0x7f); - e = base64_to_int (clean_input_buf[10] & 0x7f); - f = base64_to_int (clean_input_buf[11] & 0x7f); - - digest[1] = (((a << 12) | (b << 6) | (c)) << 16) - | (((d << 12) | (e << 6) | (f)) << 0); - - a = base64_to_int (clean_input_buf[12] & 0x7f); - b = base64_to_int (clean_input_buf[13] & 0x7f); - c = base64_to_int (clean_input_buf[14] & 0x7f); - d = base64_to_int (clean_input_buf[15] & 0x7f); - e = base64_to_int (clean_input_buf[16] & 0x7f); - f = base64_to_int (clean_input_buf[17] & 0x7f); - - digest[2] = (((a << 12) | (b << 6) | (c)) << 16) - | (((d << 12) | (e << 6) | (f)) << 0); - - a = base64_to_int (clean_input_buf[18] & 0x7f); - b = base64_to_int (clean_input_buf[19] & 0x7f); - c = base64_to_int (clean_input_buf[20] & 0x7f); - d = base64_to_int (clean_input_buf[21] & 0x7f); - e = base64_to_int (clean_input_buf[22] & 0x7f); - f = base64_to_int (clean_input_buf[23] & 0x7f); - - digest[3] = (((a << 12) | (b << 6) | (c)) << 16) - | (((d << 12) | (e << 6) | (f)) << 0); - - digest[0] = byte_swap_32 (digest[0]); - digest[1] = byte_swap_32 (digest[1]); - digest[2] = byte_swap_32 (digest[2]); - digest[3] = byte_swap_32 (digest[3]); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= MD5M_A; - digest[1] -= MD5M_B; - digest[2] -= MD5M_C; - digest[3] -= MD5M_D; - } - - const u8 *salt_pos = token.buf[1]; - const int salt_len = token.len[1]; - - const bool parse_rc = parse_and_store_generic_salt ((u8 *) salt->salt_buf, (int *) &salt->salt_len, salt_pos, salt_len, hashconfig); - - if (parse_rc == false) return (PARSER_SALT_LENGTH); - - // max. salt length: 55 (max for MD5) - 22 (":Administration Tools:") - 1 (0x80) = 32 - // 32 - 4 bytes (to fit w0lr for all attack modes) = 28 - - if (salt->salt_len > 28) return (PARSER_SALT_LENGTH); - - u8 *salt_buf_ptr = (u8 *) salt->salt_buf; - - static const char *adm = ":Administration Tools:"; - - memcpy (salt_buf_ptr + salt->salt_len, adm, strlen (adm)); - - salt->salt_len += strlen (adm); - - return (PARSER_OK); -} - -int md4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u32 *digest = (u32 *) hash_buf->digest; - - token_t token; - - token.token_cnt = 1; - - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u32 (hash_pos + 0); - digest[1] = hex_to_u32 (hash_pos + 8); - digest[2] = hex_to_u32 (hash_pos + 16); - digest[3] = hex_to_u32 (hash_pos + 24); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= MD4M_A; - digest[1] -= MD4M_B; - digest[2] -= MD4M_C; - digest[3] -= MD4M_D; - } - - return (PARSER_OK); -} - -int md4s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u32 *digest = (u32 *) hash_buf->digest; - - salt_t *salt = hash_buf->salt; - - token_t token; - - token.token_cnt = 2; - - token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - token.len_min[1] = SALT_MIN; - token.len_max[1] = SALT_MAX; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; - - if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) - { - token.len_min[1] *= 2; - token.len_max[1] *= 2; - - token.attr[1] |= TOKEN_ATTR_VERIFY_HEX; - } - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u32 (hash_pos + 0); - digest[1] = hex_to_u32 (hash_pos + 8); - digest[2] = hex_to_u32 (hash_pos + 16); - digest[3] = hex_to_u32 (hash_pos + 24); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= MD4M_A; - digest[1] -= MD4M_B; - digest[2] -= MD4M_C; - digest[3] -= MD4M_D; - } - - const u8 *salt_pos = token.buf[1]; - const int salt_len = token.len[1]; - - const bool parse_rc = parse_and_store_generic_salt ((u8 *) salt->salt_buf, (int *) &salt->salt_len, salt_pos, salt_len, hashconfig); - - if (parse_rc == false) return (PARSER_SALT_LENGTH); - - return (PARSER_OK); -} - -int md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u32 *digest = (u32 *) hash_buf->digest; - - token_t token; - - token.token_cnt = 1; - - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u32 (hash_pos + 0); - digest[1] = hex_to_u32 (hash_pos + 8); - digest[2] = hex_to_u32 (hash_pos + 16); - digest[3] = hex_to_u32 (hash_pos + 24); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= MD5M_A; - digest[1] -= MD5M_B; - digest[2] -= MD5M_C; - digest[3] -= MD5M_D; - } - - return (PARSER_OK); -} - -int md5s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u32 *digest = (u32 *) hash_buf->digest; - - salt_t *salt = hash_buf->salt; - - token_t token; - - token.token_cnt = 2; - - token.sep[0] = hashconfig->separator; - token.len_min[0] = 32; - token.len_max[0] = 32; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - token.len_min[1] = SALT_MIN; - token.len_max[1] = SALT_MAX; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; - - if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) - { - token.len_min[1] *= 2; - token.len_max[1] *= 2; - - token.attr[1] |= TOKEN_ATTR_VERIFY_HEX; - } - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u32 (hash_pos + 0); - digest[1] = hex_to_u32 (hash_pos + 8); - digest[2] = hex_to_u32 (hash_pos + 16); - digest[3] = hex_to_u32 (hash_pos + 24); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= MD5M_A; - digest[1] -= MD5M_B; - digest[2] -= MD5M_C; - digest[3] -= MD5M_D; - } - - const u8 *salt_pos = token.buf[1]; - const int salt_len = token.len[1]; - - const bool parse_rc = parse_and_store_generic_salt ((u8 *) salt->salt_buf, (int *) &salt->salt_len, salt_pos, salt_len, hashconfig); - - if (parse_rc == false) return (PARSER_SALT_LENGTH); - - if (hashconfig->opts_type & OPTS_TYPE_ST_HASH_MD5) - { - // precompute md5 of the salt - - precompute_salt_md5 (salt->salt_buf, salt->salt_len, (u8 *) salt->salt_buf_pc); - } - - return (PARSER_OK); -} - -int sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u32 *digest = (u32 *) hash_buf->digest; - - token_t token; - - token.token_cnt = 1; - - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u32 (hash_pos + 0); - digest[1] = hex_to_u32 (hash_pos + 8); - digest[2] = hex_to_u32 (hash_pos + 16); - digest[3] = hex_to_u32 (hash_pos + 24); - digest[4] = hex_to_u32 (hash_pos + 32); - - digest[0] = byte_swap_32 (digest[0]); - digest[1] = byte_swap_32 (digest[1]); - digest[2] = byte_swap_32 (digest[2]); - digest[3] = byte_swap_32 (digest[3]); - digest[4] = byte_swap_32 (digest[4]); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= SHA1M_A; - digest[1] -= SHA1M_B; - digest[2] -= SHA1M_C; - digest[3] -= SHA1M_D; - digest[4] -= SHA1M_E; - } - - return (PARSER_OK); -} - -int sha1s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u32 *digest = (u32 *) hash_buf->digest; - - salt_t *salt = hash_buf->salt; - - token_t token; - - token.token_cnt = 2; - - token.sep[0] = hashconfig->separator; - token.len_min[0] = 40; - token.len_max[0] = 40; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - token.len_min[1] = SALT_MIN; - token.len_max[1] = SALT_MAX; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; - - if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) - { - token.len_min[1] *= 2; - token.len_max[1] *= 2; - - token.attr[1] |= TOKEN_ATTR_VERIFY_HEX; - } - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u32 (hash_pos + 0); - digest[1] = hex_to_u32 (hash_pos + 8); - digest[2] = hex_to_u32 (hash_pos + 16); - digest[3] = hex_to_u32 (hash_pos + 24); - digest[4] = hex_to_u32 (hash_pos + 32); - - digest[0] = byte_swap_32 (digest[0]); - digest[1] = byte_swap_32 (digest[1]); - digest[2] = byte_swap_32 (digest[2]); - digest[3] = byte_swap_32 (digest[3]); - digest[4] = byte_swap_32 (digest[4]); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= SHA1M_A; - digest[1] -= SHA1M_B; - digest[2] -= SHA1M_C; - digest[3] -= SHA1M_D; - digest[4] -= SHA1M_E; - } - - const u8 *salt_pos = token.buf[1]; - const int salt_len = token.len[1]; - - const bool parse_rc = parse_and_store_generic_salt ((u8 *) salt->salt_buf, (int *) &salt->salt_len, salt_pos, salt_len, hashconfig); - - if (parse_rc == false) return (PARSER_SALT_LENGTH); - - return (PARSER_OK); -} - -int sha224_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u32 *digest = (u32 *) hash_buf->digest; - - token_t token; - - token.token_cnt = 1; - - token.len_min[0] = 56; - token.len_max[0] = 56; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u32 (hash_pos + 0); - digest[1] = hex_to_u32 (hash_pos + 8); - digest[2] = hex_to_u32 (hash_pos + 16); - digest[3] = hex_to_u32 (hash_pos + 24); - digest[4] = hex_to_u32 (hash_pos + 32); - digest[5] = hex_to_u32 (hash_pos + 40); - digest[6] = hex_to_u32 (hash_pos + 48); - - digest[0] = byte_swap_32 (digest[0]); - digest[1] = byte_swap_32 (digest[1]); - digest[2] = byte_swap_32 (digest[2]); - digest[3] = byte_swap_32 (digest[3]); - digest[4] = byte_swap_32 (digest[4]); - digest[5] = byte_swap_32 (digest[5]); - digest[6] = byte_swap_32 (digest[6]); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= SHA224M_A; - digest[1] -= SHA224M_B; - digest[2] -= SHA224M_C; - digest[3] -= SHA224M_D; - digest[4] -= SHA224M_E; - digest[5] -= SHA224M_F; - digest[6] -= SHA224M_G; - } - - return (PARSER_OK); -} - -int sha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u32 *digest = (u32 *) hash_buf->digest; - - token_t token; - - token.token_cnt = 1; - - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u32 (hash_pos + 0); - digest[1] = hex_to_u32 (hash_pos + 8); - digest[2] = hex_to_u32 (hash_pos + 16); - digest[3] = hex_to_u32 (hash_pos + 24); - digest[4] = hex_to_u32 (hash_pos + 32); - digest[5] = hex_to_u32 (hash_pos + 40); - digest[6] = hex_to_u32 (hash_pos + 48); - digest[7] = hex_to_u32 (hash_pos + 56); - - digest[0] = byte_swap_32 (digest[0]); - digest[1] = byte_swap_32 (digest[1]); - digest[2] = byte_swap_32 (digest[2]); - digest[3] = byte_swap_32 (digest[3]); - digest[4] = byte_swap_32 (digest[4]); - digest[5] = byte_swap_32 (digest[5]); - digest[6] = byte_swap_32 (digest[6]); - digest[7] = byte_swap_32 (digest[7]); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= SHA256M_A; - digest[1] -= SHA256M_B; - digest[2] -= SHA256M_C; - digest[3] -= SHA256M_D; - digest[4] -= SHA256M_E; - digest[5] -= SHA256M_F; - digest[6] -= SHA256M_G; - digest[7] -= SHA256M_H; - } - - return (PARSER_OK); -} - -int sha256s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u32 *digest = (u32 *) hash_buf->digest; - - salt_t *salt = hash_buf->salt; - - token_t token; - - token.token_cnt = 2; - - token.sep[0] = hashconfig->separator; - token.len_min[0] = 64; - token.len_max[0] = 64; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - token.len_min[1] = SALT_MIN; - token.len_max[1] = SALT_MAX; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; - - if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) - { - token.len_min[1] *= 2; - token.len_max[1] *= 2; - - token.attr[1] |= TOKEN_ATTR_VERIFY_HEX; - } - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u32 (hash_pos + 0); - digest[1] = hex_to_u32 (hash_pos + 8); - digest[2] = hex_to_u32 (hash_pos + 16); - digest[3] = hex_to_u32 (hash_pos + 24); - digest[4] = hex_to_u32 (hash_pos + 32); - digest[5] = hex_to_u32 (hash_pos + 40); - digest[6] = hex_to_u32 (hash_pos + 48); - digest[7] = hex_to_u32 (hash_pos + 56); - - digest[0] = byte_swap_32 (digest[0]); - digest[1] = byte_swap_32 (digest[1]); - digest[2] = byte_swap_32 (digest[2]); - digest[3] = byte_swap_32 (digest[3]); - digest[4] = byte_swap_32 (digest[4]); - digest[5] = byte_swap_32 (digest[5]); - digest[6] = byte_swap_32 (digest[6]); - digest[7] = byte_swap_32 (digest[7]); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= SHA256M_A; - digest[1] -= SHA256M_B; - digest[2] -= SHA256M_C; - digest[3] -= SHA256M_D; - digest[4] -= SHA256M_E; - digest[5] -= SHA256M_F; - digest[6] -= SHA256M_G; - digest[7] -= SHA256M_H; - } - - const u8 *salt_pos = token.buf[1]; - const int salt_len = token.len[1]; - - const bool parse_rc = parse_and_store_generic_salt ((u8 *) salt->salt_buf, (int *) &salt->salt_len, salt_pos, salt_len, hashconfig); - - if (parse_rc == false) return (PARSER_SALT_LENGTH); - - return (PARSER_OK); -} - -int sha384_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u64 *digest = (u64 *) hash_buf->digest; - - token_t token; - - token.token_cnt = 1; - - token.len_min[0] = 96; - token.len_max[0] = 96; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u64 (hash_pos + 0); - digest[1] = hex_to_u64 (hash_pos + 16); - digest[2] = hex_to_u64 (hash_pos + 32); - digest[3] = hex_to_u64 (hash_pos + 48); - digest[4] = hex_to_u64 (hash_pos + 64); - digest[5] = hex_to_u64 (hash_pos + 80); - digest[6] = 0; - digest[7] = 0; - - digest[0] = byte_swap_64 (digest[0]); - digest[1] = byte_swap_64 (digest[1]); - digest[2] = byte_swap_64 (digest[2]); - digest[3] = byte_swap_64 (digest[3]); - digest[4] = byte_swap_64 (digest[4]); - digest[5] = byte_swap_64 (digest[5]); - digest[6] = 0; - digest[7] = 0; - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= SHA384M_A; - digest[1] -= SHA384M_B; - digest[2] -= SHA384M_C; - digest[3] -= SHA384M_D; - digest[4] -= SHA384M_E; - digest[5] -= SHA384M_F; - digest[6] -= 0; - digest[7] -= 0; - } - - return (PARSER_OK); -} - -int sha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u64 *digest = (u64 *) hash_buf->digest; - - token_t token; - - token.token_cnt = 1; - - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u64 (hash_pos + 0); - digest[1] = hex_to_u64 (hash_pos + 16); - digest[2] = hex_to_u64 (hash_pos + 32); - digest[3] = hex_to_u64 (hash_pos + 48); - digest[4] = hex_to_u64 (hash_pos + 64); - digest[5] = hex_to_u64 (hash_pos + 80); - digest[6] = hex_to_u64 (hash_pos + 96); - digest[7] = hex_to_u64 (hash_pos + 112); - - digest[0] = byte_swap_64 (digest[0]); - digest[1] = byte_swap_64 (digest[1]); - digest[2] = byte_swap_64 (digest[2]); - digest[3] = byte_swap_64 (digest[3]); - digest[4] = byte_swap_64 (digest[4]); - digest[5] = byte_swap_64 (digest[5]); - digest[6] = byte_swap_64 (digest[6]); - digest[7] = byte_swap_64 (digest[7]); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= SHA512M_A; - digest[1] -= SHA512M_B; - digest[2] -= SHA512M_C; - digest[3] -= SHA512M_D; - digest[4] -= SHA512M_E; - digest[5] -= SHA512M_F; - digest[6] -= SHA512M_G; - digest[7] -= SHA512M_H; - } - - return (PARSER_OK); -} - -int sha512s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) -{ - u64 *digest = (u64 *) hash_buf->digest; - - salt_t *salt = hash_buf->salt; - - token_t token; - - token.token_cnt = 2; - - token.sep[0] = hashconfig->separator; - token.len_min[0] = 128; - token.len_max[0] = 128; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_HEX; - - token.len_min[1] = SALT_MIN; - token.len_max[1] = SALT_MAX; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; - - if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) - { - token.len_min[1] *= 2; - token.len_max[1] *= 2; - - token.attr[1] |= TOKEN_ATTR_VERIFY_HEX; - } - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - const u8 *hash_pos = token.buf[0]; - - digest[0] = hex_to_u64 (hash_pos + 0); - digest[1] = hex_to_u64 (hash_pos + 16); - digest[2] = hex_to_u64 (hash_pos + 32); - digest[3] = hex_to_u64 (hash_pos + 48); - digest[4] = hex_to_u64 (hash_pos + 64); - digest[5] = hex_to_u64 (hash_pos + 80); - digest[6] = hex_to_u64 (hash_pos + 96); - digest[7] = hex_to_u64 (hash_pos + 112); - - digest[0] = byte_swap_64 (digest[0]); - digest[1] = byte_swap_64 (digest[1]); - digest[2] = byte_swap_64 (digest[2]); - digest[3] = byte_swap_64 (digest[3]); - digest[4] = byte_swap_64 (digest[4]); - digest[5] = byte_swap_64 (digest[5]); - digest[6] = byte_swap_64 (digest[6]); - digest[7] = byte_swap_64 (digest[7]); - - if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) - { - digest[0] -= SHA512M_A; - digest[1] -= SHA512M_B; - digest[2] -= SHA512M_C; - digest[3] -= SHA512M_D; - digest[4] -= SHA512M_E; - digest[5] -= SHA512M_F; - digest[6] -= SHA512M_G; - digest[7] -= SHA512M_H; - } - - const u8 *salt_pos = token.buf[1]; - const int salt_len = token.len[1]; - - const bool parse_rc = parse_and_store_generic_salt ((u8 *) salt->salt_buf, (int *) &salt->salt_len, salt_pos, salt_len, hashconfig); - - if (parse_rc == false) return (PARSER_SALT_LENGTH); - - return (PARSER_OK); -} - -int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const int out_size, const u32 salt_pos, const u32 digest_pos) -{ - if (hash_mode == 22) - { - char username[30] = { 0 }; - - memcpy (username, salt.salt_buf, salt.salt_len - 22); - - char sig[6] = { 'n', 'r', 'c', 's', 't', 'n' }; - - u16 *ptr = (u16 *) digest_buf; - - tmp_buf[ 0] = sig[0]; - tmp_buf[ 1] = int_to_base64 (((ptr[1]) >> 12) & 0x3f); - tmp_buf[ 2] = int_to_base64 (((ptr[1]) >> 6) & 0x3f); - tmp_buf[ 3] = int_to_base64 (((ptr[1]) >> 0) & 0x3f); - tmp_buf[ 4] = int_to_base64 (((ptr[0]) >> 12) & 0x3f); - tmp_buf[ 5] = int_to_base64 (((ptr[0]) >> 6) & 0x3f); - tmp_buf[ 6] = sig[1]; - tmp_buf[ 7] = int_to_base64 (((ptr[0]) >> 0) & 0x3f); - tmp_buf[ 8] = int_to_base64 (((ptr[3]) >> 12) & 0x3f); - tmp_buf[ 9] = int_to_base64 (((ptr[3]) >> 6) & 0x3f); - tmp_buf[10] = int_to_base64 (((ptr[3]) >> 0) & 0x3f); - tmp_buf[11] = int_to_base64 (((ptr[2]) >> 12) & 0x3f); - tmp_buf[12] = sig[2]; - tmp_buf[13] = int_to_base64 (((ptr[2]) >> 6) & 0x3f); - tmp_buf[14] = int_to_base64 (((ptr[2]) >> 0) & 0x3f); - tmp_buf[15] = int_to_base64 (((ptr[5]) >> 12) & 0x3f); - tmp_buf[16] = int_to_base64 (((ptr[5]) >> 6) & 0x3f); - tmp_buf[17] = sig[3]; - tmp_buf[18] = int_to_base64 (((ptr[5]) >> 0) & 0x3f); - tmp_buf[19] = int_to_base64 (((ptr[4]) >> 12) & 0x3f); - tmp_buf[20] = int_to_base64 (((ptr[4]) >> 6) & 0x3f); - tmp_buf[21] = int_to_base64 (((ptr[4]) >> 0) & 0x3f); - tmp_buf[22] = int_to_base64 (((ptr[7]) >> 12) & 0x3f); - tmp_buf[23] = sig[4]; - tmp_buf[24] = int_to_base64 (((ptr[7]) >> 6) & 0x3f); - tmp_buf[25] = int_to_base64 (((ptr[7]) >> 0) & 0x3f); - tmp_buf[26] = int_to_base64 (((ptr[6]) >> 12) & 0x3f); - tmp_buf[27] = int_to_base64 (((ptr[6]) >> 6) & 0x3f); - tmp_buf[28] = int_to_base64 (((ptr[6]) >> 0) & 0x3f); - tmp_buf[29] = sig[5]; - - snprintf (out_buf, out_size, "%s:%s", - tmp_buf, - username); - } - else - { - if (hash_type == HASH_TYPE_MD4) - { - snprintf (out_buf, out_size, "%08x%08x%08x%08x", - digest_buf[0], - digest_buf[1], - digest_buf[2], - digest_buf[3]); - } - else if (hash_type == HASH_TYPE_MD5) - { - snprintf (out_buf, out_size, "%08x%08x%08x%08x", - digest_buf[0], - digest_buf[1], - digest_buf[2], - digest_buf[3]); - } - else if (hash_type == HASH_TYPE_SHA1) - { - snprintf (out_buf, out_size, "%08x%08x%08x%08x%08x", - digest_buf[0], - digest_buf[1], - digest_buf[2], - digest_buf[3], - digest_buf[4]); - } - else if (hash_type == HASH_TYPE_SHA224) - { - snprintf (out_buf, out_size, "%08x%08x%08x%08x%08x%08x%08x", - digest_buf[0], - digest_buf[1], - digest_buf[2], - digest_buf[3], - digest_buf[4], - digest_buf[5], - digest_buf[6]); - } - else if (hash_type == HASH_TYPE_SHA256) - { - snprintf (out_buf, out_size, "%08x%08x%08x%08x%08x%08x%08x%08x", - digest_buf[0], - digest_buf[1], - digest_buf[2], - digest_buf[3], - digest_buf[4], - digest_buf[5], - digest_buf[6], - digest_buf[7]); - } - else if (hash_type == HASH_TYPE_SHA384) - { - u32 *ptr = digest_buf; - - snprintf (out_buf, out_size, "%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x", - ptr[ 1], ptr[ 0], - ptr[ 3], ptr[ 2], - ptr[ 5], ptr[ 4], - ptr[ 7], ptr[ 6], - ptr[ 9], ptr[ 8], - ptr[11], ptr[10]); - } - else if (hash_type == HASH_TYPE_SHA512) - { - u32 *ptr = digest_buf; - - snprintf (out_buf, out_size, "%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x", - ptr[ 1], ptr[ 0], - ptr[ 3], ptr[ 2], - ptr[ 5], ptr[ 4], - ptr[ 7], ptr[ 6], - ptr[ 9], ptr[ 8], - ptr[11], ptr[10], - ptr[13], ptr[12], - ptr[15], ptr[14]); - } - else if (hash_type == HASH_TYPE_MYSQL) - { - snprintf (out_buf, out_size, "%08x%08x", - digest_buf[0], - digest_buf[1]); - } - } -} - -int hashconfig_init (hashcat_ctx_t *hashcat_ctx) -{ - case 22: hashconfig->hash_type = HASH_TYPE_MD5; - hashconfig->salt_type = SALT_TYPE_EMBEDDED; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE - | OPTS_TYPE_PT_ADD80 - | OPTS_TYPE_PT_ADDBITS14; - hashconfig->kern_type = KERN_TYPE_MD5_SLTPW; - hashconfig->dgst_size = DGST_SIZE_4_4; - hashconfig->parse_func = netscreen_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_PREPENDED_SALT - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 0; - hashconfig->dgst_pos1 = 3; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 1; - hashconfig->st_hash = ST_HASH_00022; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 30: hashconfig->hash_type = HASH_TYPE_MD5; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE - | OPTS_TYPE_PT_UTF16LE - | OPTS_TYPE_ST_ADD80 - | OPTS_TYPE_ST_ADDBITS14; - hashconfig->kern_type = KERN_TYPE_MD5_PWUSLT; - hashconfig->dgst_size = DGST_SIZE_4_4; - hashconfig->parse_func = md5s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_MEET_IN_MIDDLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_APPENDED_SALT - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 0; - hashconfig->dgst_pos1 = 3; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 1; - hashconfig->st_hash = ST_HASH_00030; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 50: hashconfig->hash_type = HASH_TYPE_MD5; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE - | OPTS_TYPE_ST_ADD80 - | OPTS_TYPE_ST_ADDBITS14; - hashconfig->kern_type = KERN_TYPE_HMACMD5_PW; - hashconfig->dgst_size = DGST_SIZE_4_4; - hashconfig->parse_func = md5s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_NOT_ITERATED; - hashconfig->dgst_pos0 = 0; - hashconfig->dgst_pos1 = 3; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 1; - hashconfig->st_hash = ST_HASH_00050; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 60: hashconfig->hash_type = HASH_TYPE_MD5; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE - | OPTS_TYPE_PT_ADD80 - | OPTS_TYPE_PT_ADDBITS14; - hashconfig->kern_type = KERN_TYPE_HMACMD5_SLT; - hashconfig->dgst_size = DGST_SIZE_4_4; - hashconfig->parse_func = md5s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_NOT_ITERATED; - hashconfig->dgst_pos0 = 0; - hashconfig->dgst_pos1 = 3; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 1; - hashconfig->st_hash = ST_HASH_00060; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 120: hashconfig->hash_type = HASH_TYPE_SHA1; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_ADD80 - | OPTS_TYPE_PT_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_SHA1_SLTPW; - hashconfig->dgst_size = DGST_SIZE_4_5; - hashconfig->parse_func = sha1s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_PREPENDED_SALT - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 3; - hashconfig->dgst_pos1 = 4; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 1; - hashconfig->st_hash = ST_HASH_00120; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 130: hashconfig->hash_type = HASH_TYPE_SHA1; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_UTF16LE - | OPTS_TYPE_ST_ADD80 - | OPTS_TYPE_ST_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_SHA1_PWUSLT; - hashconfig->dgst_size = DGST_SIZE_4_5; - hashconfig->parse_func = sha1s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_APPENDED_SALT - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 3; - hashconfig->dgst_pos1 = 4; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 1; - hashconfig->st_hash = ST_HASH_00130; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 140: hashconfig->hash_type = HASH_TYPE_SHA1; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_ADD80 - | OPTS_TYPE_PT_ADDBITS15 - | OPTS_TYPE_PT_UTF16LE; - hashconfig->kern_type = KERN_TYPE_SHA1_SLTPWU; - hashconfig->dgst_size = DGST_SIZE_4_5; - hashconfig->parse_func = sha1s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_PREPENDED_SALT - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 3; - hashconfig->dgst_pos1 = 4; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 1; - hashconfig->st_hash = ST_HASH_00140; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 150: hashconfig->hash_type = HASH_TYPE_SHA1; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_ST_ADD80 - | OPTS_TYPE_ST_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_HMACSHA1_PW; - hashconfig->dgst_size = DGST_SIZE_4_5; - hashconfig->parse_func = sha1s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_NOT_ITERATED; - hashconfig->dgst_pos0 = 3; - hashconfig->dgst_pos1 = 4; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 1; - hashconfig->st_hash = ST_HASH_00150; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 160: hashconfig->hash_type = HASH_TYPE_SHA1; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_ADD80 - | OPTS_TYPE_PT_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_HMACSHA1_SLT; - hashconfig->dgst_size = DGST_SIZE_4_5; - hashconfig->parse_func = sha1s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_NOT_ITERATED; - hashconfig->dgst_pos0 = 3; - hashconfig->dgst_pos1 = 4; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 1; - hashconfig->st_hash = ST_HASH_00160; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1410: hashconfig->hash_type = HASH_TYPE_SHA256; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_ST_ADD80 - | OPTS_TYPE_ST_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_SHA256_PWSLT; - hashconfig->dgst_size = DGST_SIZE_4_8; - hashconfig->parse_func = sha256s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_APPENDED_SALT - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 3; - hashconfig->dgst_pos1 = 7; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 6; - hashconfig->st_hash = ST_HASH_01410; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1420: hashconfig->hash_type = HASH_TYPE_SHA256; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_ADD80 - | OPTS_TYPE_PT_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_SHA256_SLTPW; - hashconfig->dgst_size = DGST_SIZE_4_8; - hashconfig->parse_func = sha256s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_PREPENDED_SALT - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 3; - hashconfig->dgst_pos1 = 7; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 6; - hashconfig->st_hash = ST_HASH_01420; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1430: hashconfig->hash_type = HASH_TYPE_SHA256; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_UTF16LE - | OPTS_TYPE_ST_ADD80 - | OPTS_TYPE_ST_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_SHA256_PWUSLT; - hashconfig->dgst_size = DGST_SIZE_4_8; - hashconfig->parse_func = sha256s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_APPENDED_SALT - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 3; - hashconfig->dgst_pos1 = 7; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 6; - hashconfig->st_hash = ST_HASH_01430; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1440: hashconfig->hash_type = HASH_TYPE_SHA256; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_ADD80 - | OPTS_TYPE_PT_ADDBITS15 - | OPTS_TYPE_PT_UTF16LE; - hashconfig->kern_type = KERN_TYPE_SHA256_SLTPWU; - hashconfig->dgst_size = DGST_SIZE_4_8; - hashconfig->parse_func = sha256s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_PREPENDED_SALT - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 3; - hashconfig->dgst_pos1 = 7; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 6; - hashconfig->st_hash = ST_HASH_01440; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1450: hashconfig->hash_type = HASH_TYPE_SHA256; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_ST_ADD80; - hashconfig->kern_type = KERN_TYPE_HMACSHA256_PW; - hashconfig->dgst_size = DGST_SIZE_4_8; - hashconfig->parse_func = sha256s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_NOT_ITERATED; - hashconfig->dgst_pos0 = 3; - hashconfig->dgst_pos1 = 7; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 6; - hashconfig->st_hash = ST_HASH_01450; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1460: hashconfig->hash_type = HASH_TYPE_SHA256; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_ADD80 - | OPTS_TYPE_PT_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_HMACSHA256_SLT; - hashconfig->dgst_size = DGST_SIZE_4_8; - hashconfig->parse_func = sha256s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_NOT_ITERATED; - hashconfig->dgst_pos0 = 3; - hashconfig->dgst_pos1 = 7; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 6; - hashconfig->st_hash = ST_HASH_01460; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1710: hashconfig->hash_type = HASH_TYPE_SHA512; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_ST_ADD80 - | OPTS_TYPE_ST_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_SHA512_PWSLT; - hashconfig->dgst_size = DGST_SIZE_8_8; - hashconfig->parse_func = sha512s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_APPENDED_SALT - | OPTI_TYPE_USES_BITS_64 - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 14; - hashconfig->dgst_pos1 = 15; - hashconfig->dgst_pos2 = 6; - hashconfig->dgst_pos3 = 7; - hashconfig->st_hash = ST_HASH_01710; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1720: hashconfig->hash_type = HASH_TYPE_SHA512; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_ADD80 - | OPTS_TYPE_PT_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_SHA512_SLTPW; - hashconfig->dgst_size = DGST_SIZE_8_8; - hashconfig->parse_func = sha512s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_PREPENDED_SALT - | OPTI_TYPE_USES_BITS_64 - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 14; - hashconfig->dgst_pos1 = 15; - hashconfig->dgst_pos2 = 6; - hashconfig->dgst_pos3 = 7; - hashconfig->st_hash = ST_HASH_01720; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1730: hashconfig->hash_type = HASH_TYPE_SHA512; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_UTF16LE - | OPTS_TYPE_ST_ADD80 - | OPTS_TYPE_ST_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_SHA512_PWSLTU; - hashconfig->dgst_size = DGST_SIZE_8_8; - hashconfig->parse_func = sha512s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_APPENDED_SALT - | OPTI_TYPE_USES_BITS_64 - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 14; - hashconfig->dgst_pos1 = 15; - hashconfig->dgst_pos2 = 6; - hashconfig->dgst_pos3 = 7; - hashconfig->st_hash = ST_HASH_01730; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1740: hashconfig->hash_type = HASH_TYPE_SHA512; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_ADD80 - | OPTS_TYPE_PT_ADDBITS15 - | OPTS_TYPE_PT_UTF16LE; - hashconfig->kern_type = KERN_TYPE_SHA512_SLTPWU; - hashconfig->dgst_size = DGST_SIZE_8_8; - hashconfig->parse_func = sha512s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_PRECOMPUTE_INIT - | OPTI_TYPE_PRECOMPUTE_MERKLE - | OPTI_TYPE_EARLY_SKIP - | OPTI_TYPE_NOT_ITERATED - | OPTI_TYPE_PREPENDED_SALT - | OPTI_TYPE_USES_BITS_64 - | OPTI_TYPE_RAW_HASH; - hashconfig->dgst_pos0 = 14; - hashconfig->dgst_pos1 = 15; - hashconfig->dgst_pos2 = 6; - hashconfig->dgst_pos3 = 7; - hashconfig->st_hash = ST_HASH_01740; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1750: hashconfig->hash_type = HASH_TYPE_SHA512; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_ST_ADD80; - hashconfig->kern_type = KERN_TYPE_HMACSHA512_PW; - hashconfig->dgst_size = DGST_SIZE_8_8; - hashconfig->parse_func = sha512s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_USES_BITS_64 - | OPTI_TYPE_NOT_ITERATED; - hashconfig->dgst_pos0 = 14; - hashconfig->dgst_pos1 = 15; - hashconfig->dgst_pos2 = 6; - hashconfig->dgst_pos3 = 7; - hashconfig->st_hash = ST_HASH_01750; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - case 1760: hashconfig->hash_type = HASH_TYPE_SHA512; - hashconfig->salt_type = SALT_TYPE_GENERIC; - hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE - | OPTS_TYPE_PT_ADD80 - | OPTS_TYPE_PT_ADDBITS15; - hashconfig->kern_type = KERN_TYPE_HMACSHA512_SLT; - hashconfig->dgst_size = DGST_SIZE_8_8; - hashconfig->parse_func = sha512s_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_USES_BITS_64 - | OPTI_TYPE_NOT_ITERATED; - hashconfig->dgst_pos0 = 14; - hashconfig->dgst_pos1 = 15; - hashconfig->dgst_pos2 = 6; - hashconfig->dgst_pos3 = 7; - hashconfig->st_hash = ST_HASH_01760; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - - } -}