mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 08:08:10 +00:00
Add module -m 2410
This commit is contained in:
parent
bf85dd5c53
commit
ac1e4bc458
@ -383,7 +383,6 @@ typedef enum kern_type
|
||||
KERN_TYPE_SHA512_SLTPWU = 1740,
|
||||
KERN_TYPE_HMACSHA512_PW = 1750,
|
||||
KERN_TYPE_HMACSHA512_SLT = 1760,
|
||||
KERN_TYPE_MD5ASA = 2410,
|
||||
KERN_TYPE_MD55 = 2600,
|
||||
KERN_TYPE_MD55_PWSLT1 = 2610,
|
||||
KERN_TYPE_MD55_PWSLT2 = 2710,
|
||||
|
@ -90,7 +90,6 @@
|
||||
" 6700 | AIX {ssha1} | Operating Systems",
|
||||
" 6400 | AIX {ssha256} | Operating Systems",
|
||||
" 6500 | AIX {ssha512} | Operating Systems",
|
||||
" 2410 | Cisco-ASA MD5 | Operating Systems",
|
||||
" 500 | Cisco-IOS $1$ (MD5) | Operating Systems",
|
||||
" 5700 | Cisco-IOS type 4 (SHA256) | Operating Systems",
|
||||
" 9200 | Cisco-IOS $8$ (PBKDF2-SHA256) | Operating Systems",
|
||||
@ -130,7 +129,6 @@
|
||||
" 15500 | JKS Java Key Store Private Keys (SHA1) | Password Managers",
|
||||
" 16300 | Ethereum Pre-Sale Wallet, PBKDF2-HMAC-SHA256 | Password Managers",
|
||||
|
||||
|
||||
/**
|
||||
* Missing self-test hashes:
|
||||
*
|
||||
@ -177,7 +175,6 @@ static const char *ST_HASH_01722 = "07543781b07e905f6f947db8ae305c248b9e12f509b4
|
||||
static const char *ST_HASH_01731 = "0x02003788006711b2e74e7d8cb4be96b1d187c962c5591a02d5a6ae81b3a4a094b26b7877958b26733e45016d929a756ed30d0a5ee65d3ce1970f9b7bf946e705c595f07625b1";
|
||||
static const char *ST_HASH_01750 = "138c00f17a1a0363f274817c91118f019aff09f937bfdaea844280a0c0e7811267cc4735d967d8640eed1218268c1c4a76fec8f7aa551491b353829f3a654270:885142";
|
||||
static const char *ST_HASH_01760 = "7d02921299935179d509e6dd4f3d0f2944e3451ea9de3af16baead6a7297e5653577d2473a0fff743d9fe78a89bd49296114319989dc7e7870fc7f62bc96accb:114";
|
||||
static const char *ST_HASH_02410 = "YjDBNr.A0AN7DA8s:4684";
|
||||
static const char *ST_HASH_02600 = "a936af92b0ae20b1ff6c3347a72e5fbe";
|
||||
static const char *ST_HASH_02611 = "28f9975808ae2bdc5847b1cda26033ea:308";
|
||||
static const char *ST_HASH_02612 = "$PHPS$30353031383437363132$f02b0b2f25e5754edb04522c346ba243";
|
||||
@ -291,7 +288,6 @@ 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_02410 = "Cisco-ASA MD5";
|
||||
static const char *HT_02600 = "md5(md5($pass))";
|
||||
static const char *HT_03100 = "Oracle H: Type (Oracle 7+)";
|
||||
static const char *HT_03710 = "md5($salt.md5($pass))";
|
||||
@ -2312,72 +2308,6 @@ int md5pix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
int md5asa_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] = ':';
|
||||
token.len_min[0] = 16;
|
||||
token.len_max[0] = 16;
|
||||
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
| TOKEN_ATTR_VERIFY_BASE64B;
|
||||
|
||||
token.len_min[1] = 1;
|
||||
token.len_max[1] = 4;
|
||||
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];
|
||||
|
||||
digest[0] = itoa64_to_int (hash_pos[ 0]) << 0
|
||||
| itoa64_to_int (hash_pos[ 1]) << 6
|
||||
| itoa64_to_int (hash_pos[ 2]) << 12
|
||||
| itoa64_to_int (hash_pos[ 3]) << 18;
|
||||
digest[1] = itoa64_to_int (hash_pos[ 4]) << 0
|
||||
| itoa64_to_int (hash_pos[ 5]) << 6
|
||||
| itoa64_to_int (hash_pos[ 6]) << 12
|
||||
| itoa64_to_int (hash_pos[ 7]) << 18;
|
||||
digest[2] = itoa64_to_int (hash_pos[ 8]) << 0
|
||||
| itoa64_to_int (hash_pos[ 9]) << 6
|
||||
| itoa64_to_int (hash_pos[10]) << 12
|
||||
| itoa64_to_int (hash_pos[11]) << 18;
|
||||
digest[3] = itoa64_to_int (hash_pos[12]) << 0
|
||||
| itoa64_to_int (hash_pos[13]) << 6
|
||||
| itoa64_to_int (hash_pos[14]) << 12
|
||||
| itoa64_to_int (hash_pos[15]) << 18;
|
||||
|
||||
if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE)
|
||||
{
|
||||
digest[0] -= MD5M_A;
|
||||
digest[1] -= MD5M_B;
|
||||
digest[2] -= MD5M_C;
|
||||
digest[3] -= MD5M_D;
|
||||
}
|
||||
|
||||
digest[0] &= 0x00ffffff;
|
||||
digest[1] &= 0x00ffffff;
|
||||
digest[2] &= 0x00ffffff;
|
||||
digest[3] &= 0x00ffffff;
|
||||
|
||||
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 md5md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig)
|
||||
{
|
||||
u32 *digest = (u32 *) hash_buf->digest;
|
||||
@ -8798,7 +8728,6 @@ int sha1cx_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
|
||||
int itunes_backup_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig)
|
||||
{
|
||||
u32 hash_mode = hashconfig->hash_mode;
|
||||
@ -8978,7 +8907,6 @@ int itunes_backup_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MA
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
|
||||
int fortigate_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig)
|
||||
{
|
||||
u32 *digest = (u32 *) hash_buf->digest;
|
||||
@ -10316,39 +10244,6 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const int out_size,
|
||||
ptr[13], ptr[12],
|
||||
ptr[15], ptr[14]);
|
||||
}
|
||||
else if ((hash_mode == 2400) || (hash_mode == 2410))
|
||||
{
|
||||
memcpy (tmp_buf, digest_buf, 16);
|
||||
|
||||
// the encoder is a bit too intelligent, it expects the input data in the wrong BOM
|
||||
|
||||
digest_buf[0] = byte_swap_32 (digest_buf[0]);
|
||||
digest_buf[1] = byte_swap_32 (digest_buf[1]);
|
||||
digest_buf[2] = byte_swap_32 (digest_buf[2]);
|
||||
digest_buf[3] = byte_swap_32 (digest_buf[3]);
|
||||
|
||||
out_buf[ 0] = int_to_itoa64 ((digest_buf[0] >> 0) & 0x3f);
|
||||
out_buf[ 1] = int_to_itoa64 ((digest_buf[0] >> 6) & 0x3f);
|
||||
out_buf[ 2] = int_to_itoa64 ((digest_buf[0] >> 12) & 0x3f);
|
||||
out_buf[ 3] = int_to_itoa64 ((digest_buf[0] >> 18) & 0x3f);
|
||||
|
||||
out_buf[ 4] = int_to_itoa64 ((digest_buf[1] >> 0) & 0x3f);
|
||||
out_buf[ 5] = int_to_itoa64 ((digest_buf[1] >> 6) & 0x3f);
|
||||
out_buf[ 6] = int_to_itoa64 ((digest_buf[1] >> 12) & 0x3f);
|
||||
out_buf[ 7] = int_to_itoa64 ((digest_buf[1] >> 18) & 0x3f);
|
||||
|
||||
out_buf[ 8] = int_to_itoa64 ((digest_buf[2] >> 0) & 0x3f);
|
||||
out_buf[ 9] = int_to_itoa64 ((digest_buf[2] >> 6) & 0x3f);
|
||||
out_buf[10] = int_to_itoa64 ((digest_buf[2] >> 12) & 0x3f);
|
||||
out_buf[11] = int_to_itoa64 ((digest_buf[2] >> 18) & 0x3f);
|
||||
|
||||
out_buf[12] = int_to_itoa64 ((digest_buf[3] >> 0) & 0x3f);
|
||||
out_buf[13] = int_to_itoa64 ((digest_buf[3] >> 6) & 0x3f);
|
||||
out_buf[14] = int_to_itoa64 ((digest_buf[3] >> 12) & 0x3f);
|
||||
out_buf[15] = int_to_itoa64 ((digest_buf[3] >> 18) & 0x3f);
|
||||
|
||||
out_buf[16] = 0;
|
||||
}
|
||||
else if (hash_mode == 4400)
|
||||
{
|
||||
snprintf (out_buf, out_size, "%08x%08x%08x%08x",
|
||||
@ -12614,26 +12509,6 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
|
||||
hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN;
|
||||
break;
|
||||
|
||||
case 2410: 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;
|
||||
hashconfig->kern_type = KERN_TYPE_MD5ASA;
|
||||
hashconfig->dgst_size = DGST_SIZE_4_4;
|
||||
hashconfig->parse_func = md5asa_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;
|
||||
hashconfig->dgst_pos0 = 0;
|
||||
hashconfig->dgst_pos1 = 3;
|
||||
hashconfig->dgst_pos2 = 2;
|
||||
hashconfig->dgst_pos3 = 1;
|
||||
hashconfig->st_hash = ST_HASH_02410;
|
||||
hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN;
|
||||
break;
|
||||
|
||||
case 2600: hashconfig->hash_type = HASH_TYPE_MD5;
|
||||
hashconfig->salt_type = SALT_TYPE_VIRTUAL;
|
||||
hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
|
||||
|
@ -9,16 +9,17 @@
|
||||
#include "bitops.h"
|
||||
#include "convert.h"
|
||||
#include "shared.h"
|
||||
#include "inc_hash_constants.h"
|
||||
|
||||
static const u32 ATTACK_EXEC = ATTACK_EXEC_INSIDE_KERNEL;
|
||||
static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 3;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 1;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_4;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_OS;
|
||||
static const char *HASH_NAME = "Cisco-PIX MD5";
|
||||
static const u32 HASH_TYPE = HASH_TYPE_MD5;
|
||||
static const u32 HASH_TYPE = HASH_TYPE_GENERIC;
|
||||
static const u64 KERN_TYPE = 2400;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
|
||||
| OPTI_TYPE_PRECOMPUTE_INIT
|
||||
@ -85,9 +86,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
| itoa64_to_int (hash_pos[14]) << 12
|
||||
| itoa64_to_int (hash_pos[15]) << 18;
|
||||
|
||||
decoder_apply_options (hashconfig, digest);
|
||||
if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE)
|
||||
{
|
||||
digest[0] -= MD5M_A;
|
||||
digest[1] -= MD5M_B;
|
||||
digest[2] -= MD5M_C;
|
||||
digest[3] -= MD5M_D;
|
||||
}
|
||||
|
||||
decoder_apply_optimizer (hashconfig, digest);
|
||||
digest[4] = digest[0]; // store for encoder
|
||||
digest[5] = digest[1];
|
||||
digest[6] = digest[2];
|
||||
digest[7] = digest[3];
|
||||
|
||||
digest[0] &= 0x00ffffff;
|
||||
digest[1] &= 0x00ffffff;
|
||||
@ -106,14 +116,18 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
u32 tmp[4];
|
||||
|
||||
tmp[0] = digest[0];
|
||||
tmp[1] = digest[1];
|
||||
tmp[2] = digest[2];
|
||||
tmp[3] = digest[3];
|
||||
tmp[0] = digest[4];
|
||||
tmp[1] = digest[5];
|
||||
tmp[2] = digest[6];
|
||||
tmp[3] = digest[7];
|
||||
|
||||
encoder_apply_optimizer (hashconfig, tmp);
|
||||
|
||||
encoder_apply_options (hashconfig, tmp);
|
||||
if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE)
|
||||
{
|
||||
tmp[0] += MD5M_A;
|
||||
tmp[1] += MD5M_B;
|
||||
tmp[2] += MD5M_C;
|
||||
tmp[3] += MD5M_D;
|
||||
}
|
||||
|
||||
u8 *out_buf = (u8 *) line_buf;
|
||||
|
||||
|
241
src/modules/module_02410.c
Normal file
241
src/modules/module_02410.c
Normal file
@ -0,0 +1,241 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "types.h"
|
||||
#include "modules.h"
|
||||
#include "bitops.h"
|
||||
#include "convert.h"
|
||||
#include "shared.h"
|
||||
#include "inc_hash_constants.h"
|
||||
|
||||
static const u32 ATTACK_EXEC = ATTACK_EXEC_INSIDE_KERNEL;
|
||||
static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 3;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 1;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_OS;
|
||||
static const char *HASH_NAME = "Cisco-ASA MD5";
|
||||
static const u32 HASH_TYPE = HASH_TYPE_GENERIC;
|
||||
static const u64 KERN_TYPE = 2410;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
|
||||
| OPTI_TYPE_PRECOMPUTE_INIT
|
||||
| OPTI_TYPE_PRECOMPUTE_MERKLE
|
||||
| OPTI_TYPE_EARLY_SKIP
|
||||
| OPTI_TYPE_NOT_ITERATED;
|
||||
static const u64 OPTS_TYPE = OPTS_TYPE_STATE_BUFFER_LE
|
||||
| OPTS_TYPE_PT_GENERATE_LE;
|
||||
static const u32 SALT_TYPE = SALT_TYPE_GENERIC;
|
||||
static const char *ST_PASS = "hashcat";
|
||||
static const char *ST_HASH = "YjDBNr.A0AN7DA8s:4684";
|
||||
|
||||
u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ATTACK_EXEC; }
|
||||
u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS0; }
|
||||
u32 module_dgst_pos1 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS1; }
|
||||
u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS2; }
|
||||
u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS3; }
|
||||
u32 module_dgst_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_SIZE; }
|
||||
u32 module_hash_category (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_CATEGORY; }
|
||||
const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_NAME; }
|
||||
u32 module_hash_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_TYPE; }
|
||||
u64 module_kern_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return KERN_TYPE; }
|
||||
u32 module_opti_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTI_TYPE; }
|
||||
u64 module_opts_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return OPTS_TYPE; }
|
||||
u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return SALT_TYPE; }
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len)
|
||||
{
|
||||
u32 *digest = (u32 *) digest_buf;
|
||||
|
||||
token_t token;
|
||||
|
||||
token.token_cnt = 2;
|
||||
|
||||
token.sep[0] = ':';
|
||||
token.len_min[0] = 16;
|
||||
token.len_max[0] = 16;
|
||||
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
| TOKEN_ATTR_VERIFY_BASE64B;
|
||||
|
||||
token.len_min[1] = 1;
|
||||
token.len_max[1] = 4;
|
||||
token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH;
|
||||
|
||||
const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token);
|
||||
|
||||
if (rc_tokenizer != PARSER_OK) return (rc_tokenizer);
|
||||
|
||||
const u8 *hash_pos = token.buf[0];
|
||||
|
||||
digest[0] = itoa64_to_int (hash_pos[ 0]) << 0
|
||||
| itoa64_to_int (hash_pos[ 1]) << 6
|
||||
| itoa64_to_int (hash_pos[ 2]) << 12
|
||||
| itoa64_to_int (hash_pos[ 3]) << 18;
|
||||
digest[1] = itoa64_to_int (hash_pos[ 4]) << 0
|
||||
| itoa64_to_int (hash_pos[ 5]) << 6
|
||||
| itoa64_to_int (hash_pos[ 6]) << 12
|
||||
| itoa64_to_int (hash_pos[ 7]) << 18;
|
||||
digest[2] = itoa64_to_int (hash_pos[ 8]) << 0
|
||||
| itoa64_to_int (hash_pos[ 9]) << 6
|
||||
| itoa64_to_int (hash_pos[10]) << 12
|
||||
| itoa64_to_int (hash_pos[11]) << 18;
|
||||
digest[3] = itoa64_to_int (hash_pos[12]) << 0
|
||||
| itoa64_to_int (hash_pos[13]) << 6
|
||||
| itoa64_to_int (hash_pos[14]) << 12
|
||||
| itoa64_to_int (hash_pos[15]) << 18;
|
||||
|
||||
if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE)
|
||||
{
|
||||
digest[0] -= MD5M_A;
|
||||
digest[1] -= MD5M_B;
|
||||
digest[2] -= MD5M_C;
|
||||
digest[3] -= MD5M_D;
|
||||
}
|
||||
|
||||
digest[4] = digest[0]; // store for encoder
|
||||
digest[5] = digest[1];
|
||||
digest[6] = digest[2];
|
||||
digest[7] = digest[3];
|
||||
|
||||
digest[0] &= 0x00ffffff;
|
||||
digest[1] &= 0x00ffffff;
|
||||
digest[2] &= 0x00ffffff;
|
||||
digest[3] &= 0x00ffffff;
|
||||
|
||||
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 module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size)
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
// we can not change anything in the original buffer, otherwise destroying sorting
|
||||
// therefore create some local buffer
|
||||
|
||||
u32 tmp[4];
|
||||
|
||||
tmp[0] = digest[4];
|
||||
tmp[1] = digest[5];
|
||||
tmp[2] = digest[6];
|
||||
tmp[3] = digest[7];
|
||||
|
||||
if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE)
|
||||
{
|
||||
tmp[0] += MD5M_A;
|
||||
tmp[1] += MD5M_B;
|
||||
tmp[2] += MD5M_C;
|
||||
tmp[3] += MD5M_D;
|
||||
}
|
||||
|
||||
u8 *out_buf = (u8 *) line_buf;
|
||||
|
||||
out_buf[ 0] = int_to_itoa64 ((tmp[0] >> 0) & 0x3f);
|
||||
out_buf[ 1] = int_to_itoa64 ((tmp[0] >> 6) & 0x3f);
|
||||
out_buf[ 2] = int_to_itoa64 ((tmp[0] >> 12) & 0x3f);
|
||||
out_buf[ 3] = int_to_itoa64 ((tmp[0] >> 18) & 0x3f);
|
||||
out_buf[ 4] = int_to_itoa64 ((tmp[1] >> 0) & 0x3f);
|
||||
out_buf[ 5] = int_to_itoa64 ((tmp[1] >> 6) & 0x3f);
|
||||
out_buf[ 6] = int_to_itoa64 ((tmp[1] >> 12) & 0x3f);
|
||||
out_buf[ 7] = int_to_itoa64 ((tmp[1] >> 18) & 0x3f);
|
||||
out_buf[ 8] = int_to_itoa64 ((tmp[2] >> 0) & 0x3f);
|
||||
out_buf[ 9] = int_to_itoa64 ((tmp[2] >> 6) & 0x3f);
|
||||
out_buf[10] = int_to_itoa64 ((tmp[2] >> 12) & 0x3f);
|
||||
out_buf[11] = int_to_itoa64 ((tmp[2] >> 18) & 0x3f);
|
||||
out_buf[12] = int_to_itoa64 ((tmp[3] >> 0) & 0x3f);
|
||||
out_buf[13] = int_to_itoa64 ((tmp[3] >> 6) & 0x3f);
|
||||
out_buf[14] = int_to_itoa64 ((tmp[3] >> 12) & 0x3f);
|
||||
out_buf[15] = int_to_itoa64 ((tmp[3] >> 18) & 0x3f);
|
||||
|
||||
int out_len = 16;
|
||||
|
||||
out_buf[out_len] = hashconfig->separator;
|
||||
|
||||
out_len += 1;
|
||||
|
||||
memcpy (out_buf + out_len, salt->salt_buf, salt->salt_len);
|
||||
|
||||
out_len += salt->salt_len;
|
||||
|
||||
return out_len;
|
||||
}
|
||||
|
||||
void module_init (module_ctx_t *module_ctx)
|
||||
{
|
||||
module_ctx->module_context_size = MODULE_CONTEXT_SIZE_CURRENT;
|
||||
module_ctx->module_interface_version = MODULE_INTERFACE_VERSION_CURRENT;
|
||||
|
||||
module_ctx->module_attack_exec = module_attack_exec;
|
||||
module_ctx->module_benchmark_esalt = MODULE_DEFAULT;
|
||||
module_ctx->module_benchmark_hook_salt = MODULE_DEFAULT;
|
||||
module_ctx->module_benchmark_mask = MODULE_DEFAULT;
|
||||
module_ctx->module_benchmark_salt = MODULE_DEFAULT;
|
||||
module_ctx->module_build_plain_postprocess = MODULE_DEFAULT;
|
||||
module_ctx->module_deep_comp_kernel = MODULE_DEFAULT;
|
||||
module_ctx->module_dgst_pos0 = module_dgst_pos0;
|
||||
module_ctx->module_dgst_pos1 = module_dgst_pos1;
|
||||
module_ctx->module_dgst_pos2 = module_dgst_pos2;
|
||||
module_ctx->module_dgst_pos3 = module_dgst_pos3;
|
||||
module_ctx->module_dgst_size = module_dgst_size;
|
||||
module_ctx->module_dictstat_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_esalt_size = MODULE_DEFAULT;
|
||||
module_ctx->module_extra_buffer_size = MODULE_DEFAULT;
|
||||
module_ctx->module_extra_tmp_size = MODULE_DEFAULT;
|
||||
module_ctx->module_forced_outfile_format = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_binary_count = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_binary_parse = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_binary_save = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_decode_outfile = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_decode_zero_hash = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_decode = module_hash_decode;
|
||||
module_ctx->module_hash_encode_status = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_encode = module_hash_encode;
|
||||
module_ctx->module_hash_init_selftest = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_mode = MODULE_DEFAULT;
|
||||
module_ctx->module_hash_category = module_hash_category;
|
||||
module_ctx->module_hash_name = module_hash_name;
|
||||
module_ctx->module_hash_type = module_hash_type;
|
||||
module_ctx->module_hlfmt_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_hook12 = MODULE_DEFAULT;
|
||||
module_ctx->module_hook23 = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_salt_size = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_loops_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_loops_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_threads_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_threads_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kern_type = module_kern_type;
|
||||
module_ctx->module_kern_type_dynamic = MODULE_DEFAULT;
|
||||
module_ctx->module_opti_type = module_opti_type;
|
||||
module_ctx->module_opts_type = module_opts_type;
|
||||
module_ctx->module_outfile_check_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_outfile_check_nocomp = MODULE_DEFAULT;
|
||||
module_ctx->module_potfile_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_potfile_keep_all_hashes = MODULE_DEFAULT;
|
||||
module_ctx->module_pwdump_column = MODULE_DEFAULT;
|
||||
module_ctx->module_pw_max = MODULE_DEFAULT;
|
||||
module_ctx->module_pw_min = MODULE_DEFAULT;
|
||||
module_ctx->module_salt_max = MODULE_DEFAULT;
|
||||
module_ctx->module_salt_min = MODULE_DEFAULT;
|
||||
module_ctx->module_salt_type = module_salt_type;
|
||||
module_ctx->module_separator = MODULE_DEFAULT;
|
||||
module_ctx->module_st_hash = module_st_hash;
|
||||
module_ctx->module_st_pass = module_st_pass;
|
||||
module_ctx->module_tmp_size = MODULE_DEFAULT;
|
||||
module_ctx->module_unstable_warning = MODULE_DEFAULT;
|
||||
module_ctx->module_warmup_disable = MODULE_DEFAULT;
|
||||
}
|
Loading…
Reference in New Issue
Block a user