mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-13 19:28:56 +00:00
Add -m 14000 module
This commit is contained in:
parent
47f78199f8
commit
1e31b3b271
@ -950,7 +950,6 @@ typedef enum hash_type
|
||||
HASH_TYPE_RAR3HP = 50,
|
||||
HASH_TYPE_KRB5TGS = 51,
|
||||
HASH_TYPE_STDOUT = 52,
|
||||
HASH_TYPE_DES = 53,
|
||||
HASH_TYPE_PLAINTEXT = 54,
|
||||
HASH_TYPE_LUKS = 55,
|
||||
HASH_TYPE_ITUNES_BACKUP_9 = 56,
|
||||
@ -1126,10 +1125,8 @@ typedef enum kern_type
|
||||
KERN_TYPE_ZIP2 = 13600,
|
||||
KERN_TYPE_WIN8PHONE = 13800,
|
||||
KERN_TYPE_OPENCART = 13900,
|
||||
KERN_TYPE_DES = 14000,
|
||||
KERN_TYPE_3DES = 14100,
|
||||
KERN_TYPE_SHA1CX = 14400,
|
||||
|
||||
KERN_TYPE_ITUNES_BACKUP_9 = 14700,
|
||||
KERN_TYPE_ITUNES_BACKUP_10 = 14800,
|
||||
KERN_TYPE_SKIP32 = 14900,
|
||||
@ -1252,7 +1249,6 @@ typedef enum rounds_count
|
||||
int bcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
|
||||
int cisco4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
|
||||
int dcc2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
|
||||
int des_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
|
||||
int episerver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
|
||||
int postgresql_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
|
||||
int netscreen_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
|
||||
|
@ -53,7 +53,6 @@
|
||||
" 11760 | HMAC-Streebog-256 (key = $salt), big-endian | Raw Hash, Authenticated",
|
||||
" 11850 | HMAC-Streebog-512 (key = $pass), big-endian | Raw Hash, Authenticated",
|
||||
" 11860 | HMAC-Streebog-512 (key = $salt), big-endian | Raw Hash, Authenticated",
|
||||
" 14000 | DES (PT = $salt, key = $pass) | Raw Cipher, Known-Plaintext attack",
|
||||
" 14100 | 3DES (PT = $salt, key = $pass) | Raw Cipher, Known-Plaintext attack",
|
||||
" 14900 | Skip32 (PT = $salt, key = $pass) | Raw Cipher, Known-Plaintext attack",
|
||||
" 15400 | ChaCha20 | Raw Cipher, Known-Plaintext attack",
|
||||
@ -474,7 +473,6 @@ static const char *ST_HASH_13772 = "0f5da0b17c60edcd392058752ec29c389b140b54cd1f
|
||||
static const char *ST_HASH_13773 = "18d2e8314961850f8fc26d2bc6f896db9c4eee301b5fa7295615166552b2422042c6cf6212187ec9c0234908e7934009c23ceed0c4858a7a4deecbc59b50a303afdc7d583cde1b0c06f0bf56162ef1d6d8df8f194aadcbe395780b3d1d7127faf39910eb10f4805abdd1c3ef7a66972603124a475e2b9224699e60a9e12f4096597f20c5fb0528f590d7bd317e41dc6a2128cf5e58a99803a28c213feb8286350b1d7ab56d43bb52e511f3c860e5002472a4454a549509c8ce0c34f17ece23d5b61aa7c63389c8ca44ed10c2caae03e7ed30b3ef98565926d7e4f3a2a9abf03b278083bed7aaadd78d5bffb7cd45ffae92990c06d9e9f375a77a94226035d1f90e177c46a04dab416dfb7ed7c4ed9ee7e84580bed65c5fee9f4b1545b9a7cf6af533870d393eced609aebe308ec1eee3729da09eb7df7a8d1282b15c4a1b8266a456c06b4ea20c209c549d5d6b58a861f8e15cca3b6cef114accbf470ec76d717f6d7d416d7a32f064ab560c1167f9ef4e93310fbd927b088bffbb0cf5d5c2e271c9cad4c604e489e9983a990b23e1a2f973682fdfe38df385474f73ecdc9bce701d01d627192d3051240f4b96bbdcf2346b275e05aa75add4acb97b286cc00e830fee95d0f86a8b1e315ccb6f3f8642180392b3baac01ed2c97c200489b5e5ca4dcb0a6417e622b6196482a10e640b2b6b08e3f62acac3d45dfc6b88c666205";
|
||||
static const char *ST_HASH_13800 = "060a4a94cb2263bcefe74705bd0efe7643d09c2bc25fc69f6a32c1b8d5a5d0d9:4647316184156410832507278642444030512402463246148636510356103432440257733102761444262383653100802140838605535187005586063548643765207865344068042278454875021452355870320020868064506248840047414683714173748364871633802572014845467035357710118327480707136422";
|
||||
static const char *ST_HASH_13900 = "058c1c3773340c8563421e2b17e60eb7c916787e:827500576";
|
||||
static const char *ST_HASH_14000 = "53b325182924b356:1412781058343178";
|
||||
static const char *ST_HASH_14100 = "4c29eea59d8db1e7:7428288455525516";
|
||||
static const char *ST_HASH_14400 = "fcdc7ec700b887e8eaebf94c2ec52aebb5521223:63038426024388230227";
|
||||
static const char *ST_HASH_14700 = "$itunes_backup$*9*ebd7f9b33293b2511f0a4139d5b213feff51476968863cef60ec38d720497b6ff39a0bb63fa9f84e*10000*2202015774208421818002001652122401871832**";
|
||||
@ -657,7 +655,6 @@ static const char *HT_13500 = "PeopleSoft PS_TOKEN";
|
||||
static const char *HT_13600 = "WinZip";
|
||||
static const char *HT_13800 = "Windows Phone 8+ PIN/password";
|
||||
static const char *HT_13900 = "OpenCart";
|
||||
static const char *HT_14000 = "DES (PT = $salt, key = $pass)";
|
||||
static const char *HT_14100 = "3DES (PT = $salt, key = $pass)";
|
||||
static const char *HT_14400 = "sha1(CX)";
|
||||
static const char *HT_14600 = "LUKS";
|
||||
@ -8601,62 +8598,6 @@ int racf_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
int des_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] = 16;
|
||||
token.len_max[0] = 16;
|
||||
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
| TOKEN_ATTR_VERIFY_HEX;
|
||||
|
||||
token.len_min[1] = 16;
|
||||
token.len_max[1] = 16;
|
||||
token.attr[1] = 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);
|
||||
|
||||
// salt
|
||||
|
||||
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);
|
||||
|
||||
u32 tt;
|
||||
|
||||
salt->salt_buf_pc[0] = byte_swap_32 (salt->salt_buf[0]);
|
||||
salt->salt_buf_pc[1] = byte_swap_32 (salt->salt_buf[1]);
|
||||
|
||||
IP (salt->salt_buf_pc[0], salt->salt_buf_pc[1], tt);
|
||||
|
||||
// hash
|
||||
|
||||
const u8 *hash_pos = token.buf[0];
|
||||
|
||||
digest[0] = hex_to_u32 (hash_pos + 0);
|
||||
digest[1] = hex_to_u32 (hash_pos + 8);
|
||||
|
||||
IP (digest[0], digest[1], tt);
|
||||
|
||||
digest[2] = 0;
|
||||
digest[3] = 0;
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
int lotus5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig)
|
||||
{
|
||||
u32 *digest = (u32 *) hash_buf->digest;
|
||||
@ -17626,11 +17567,6 @@ u32 kernel_loops_mxx (hashcat_ctx_t *hashcat_ctx)
|
||||
kernel_loops_fixed = 1024;
|
||||
}
|
||||
|
||||
if (hashconfig->hash_mode == 14000 && user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
kernel_loops_fixed = 1024;
|
||||
}
|
||||
|
||||
if (hashconfig->hash_mode == 14100 && user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
kernel_loops_fixed = 1024;
|
||||
@ -17772,8 +17708,6 @@ void hashconfig_benchmark_defaults (hashcat_ctx_t *hashcat_ctx, salt_t *salt, vo
|
||||
break;
|
||||
case 12600: salt->salt_len = 64;
|
||||
break;
|
||||
case 14000: salt->salt_len = 8;
|
||||
break;
|
||||
case 14100: salt->salt_len = 8;
|
||||
break;
|
||||
case 14600: salt->salt_len = LUKS_SALTSIZE;
|
||||
@ -20493,10 +20427,6 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const int out_size,
|
||||
digest_buf[7],
|
||||
buf);
|
||||
}
|
||||
else if (hash_mode == 14000)
|
||||
{
|
||||
snprintf (out_buf, out_size, "%08x%08x:%s", digest_buf[0], digest_buf[1], (char *) salt.salt_buf);
|
||||
}
|
||||
else if (hash_mode == 14100)
|
||||
{
|
||||
snprintf (out_buf, out_size, "%08x%08x:%s", digest_buf[0], digest_buf[1], (char *) salt.salt_buf);
|
||||
@ -25644,26 +25574,6 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
|
||||
hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN;
|
||||
break;
|
||||
|
||||
case 14000: hashconfig->hash_type = HASH_TYPE_DES;
|
||||
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
|
||||
hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
|
||||
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE
|
||||
| OPTS_TYPE_PT_BITSLICE
|
||||
| OPTS_TYPE_ST_GENERATE_LE
|
||||
| OPTS_TYPE_ST_HEX;
|
||||
hashconfig->kern_type = KERN_TYPE_DES;
|
||||
hashconfig->dgst_size = DGST_SIZE_4_4; // originally DGST_SIZE_4_2
|
||||
hashconfig->parse_func = des_parse_hash;
|
||||
hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE
|
||||
| OPTI_TYPE_PRECOMPUTE_PERMUT;
|
||||
hashconfig->dgst_pos0 = 0;
|
||||
hashconfig->dgst_pos1 = 1;
|
||||
hashconfig->dgst_pos2 = 2;
|
||||
hashconfig->dgst_pos3 = 3;
|
||||
hashconfig->st_hash = ST_HASH_14000;
|
||||
hashconfig->st_pass = ST_PASS_HASHCAT_ONE;
|
||||
break;
|
||||
|
||||
case 14100: hashconfig->hash_type = HASH_TYPE_DES;
|
||||
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
|
||||
hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
|
||||
@ -26604,7 +26514,6 @@ u32 default_pw_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED co
|
||||
case 9710: pw_min = 5; break; // RC4-40 fixed
|
||||
case 9810: pw_min = 5; break; // RC4-40 fixed
|
||||
case 10410: pw_min = 5; break; // RC4-40 fixed
|
||||
case 14000: pw_min = 8; break; // DES fixed
|
||||
case 14100: pw_min = 24; break; // 3DES fixed
|
||||
case 14900: pw_min = 10; break; // Skip32 fixed
|
||||
case 15400: pw_min = 32; break; // ChaCha20 fixed
|
||||
@ -26762,7 +26671,6 @@ u32 default_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED co
|
||||
case 13771: pw_max = 64; break; // VC limits itself to 64
|
||||
case 13772: pw_max = 64; break; // VC limits itself to 64
|
||||
case 13773: pw_max = 64; break; // VC limits itself to 64
|
||||
case 14000: pw_max = 8; break; // Underlaying DES fixed
|
||||
case 14100: pw_max = 24; break; // Underlaying 3DES fixed
|
||||
case 14611: pw_max = PW_MAX; break;
|
||||
case 14612: pw_max = PW_MAX; break;
|
||||
@ -26850,8 +26758,6 @@ const char *default_benchmark_mask (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
break;
|
||||
case 12500: mask = "?b?b?b?b?b";
|
||||
break;
|
||||
case 14000: mask = "?b?b?b?b?b?b?bx";
|
||||
break;
|
||||
case 14100: mask = "?b?b?b?b?b?b?bxxxxxxxxxxxxxxxxx";
|
||||
break;
|
||||
case 14900: mask = "?b?b?b?b?bxxxxx";
|
||||
@ -27633,7 +27539,6 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|| (hashconfig->hash_mode == 9300)
|
||||
|| (hashconfig->hash_mode == 9800)
|
||||
|| (hashconfig->hash_mode == 12500)
|
||||
|| (hashconfig->hash_mode == 14000)
|
||||
|| (hashconfig->hash_mode == 14100)
|
||||
|| (hashconfig->hash_mode == 15700))
|
||||
{
|
||||
|
277
src/modules/module_14000.c
Normal file
277
src/modules/module_14000.c
Normal file
@ -0,0 +1,277 @@
|
||||
/**
|
||||
* 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"
|
||||
|
||||
static const u32 ATTACK_EXEC = ATTACK_EXEC_INSIDE_KERNEL;
|
||||
static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_4; // originally DGST_SIZE_4_2
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_RAW_CIPHER_KPA;
|
||||
static const char *HASH_NAME = "DES (PT = $salt, key = $pass)";
|
||||
static const u32 HASH_TYPE = HASH_TYPE_DES;
|
||||
static const u64 KERN_TYPE = 14000;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
|
||||
| OPTI_TYPE_PRECOMPUTE_PERMUT;
|
||||
static const u64 OPTS_TYPE = OPTS_TYPE_STATE_BUFFER_LE
|
||||
| OPTS_TYPE_PT_GENERATE_LE
|
||||
| OPTS_TYPE_PT_BITSLICE
|
||||
| OPTS_TYPE_ST_GENERATE_LE
|
||||
| OPTS_TYPE_ST_HEX;
|
||||
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
|
||||
static const char *ST_PASS = "hashcat1";
|
||||
static const char *ST_HASH = "53b325182924b356:1412781058343178";
|
||||
|
||||
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; }
|
||||
|
||||
u32 module_kernel_loops_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
u32 kernel_loops_max = KERNEL_LOOPS_MAX;
|
||||
|
||||
if (user_options->slow_candidates == false)
|
||||
{
|
||||
if (user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
kernel_loops_max = 1024;
|
||||
}
|
||||
}
|
||||
|
||||
return kernel_loops_max;
|
||||
}
|
||||
|
||||
u32 module_kernel_loops_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
u32 kernel_loops_min = KERNEL_LOOPS_MIN;
|
||||
|
||||
if (user_options->slow_candidates == false)
|
||||
{
|
||||
if (user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
kernel_loops_min = 1024;
|
||||
}
|
||||
}
|
||||
|
||||
return kernel_loops_min;
|
||||
}
|
||||
|
||||
u32 module_salt_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const u32 salt_min = 8; // Underlaying DES min
|
||||
|
||||
return salt_min;
|
||||
}
|
||||
|
||||
u32 module_salt_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const u32 salt_max = 8; // Underlaying DES max
|
||||
|
||||
return salt_max;
|
||||
}
|
||||
|
||||
u32 module_pw_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const u32 pw_min = 8; // Underlaying DES min
|
||||
|
||||
return pw_min;
|
||||
}
|
||||
|
||||
u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const u32 pw_max = 8; // Underlaying DES max
|
||||
|
||||
return pw_max;
|
||||
}
|
||||
|
||||
bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
#if defined (__APPLE__)
|
||||
return true;
|
||||
#endif // __APPLE__
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
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 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] = hashconfig->separator;
|
||||
token.len_min[0] = 16;
|
||||
token.len_max[0] = 16;
|
||||
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
| TOKEN_ATTR_VERIFY_HEX;
|
||||
|
||||
token.len_min[1] = 16;
|
||||
token.len_max[1] = 16;
|
||||
token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
| TOKEN_ATTR_VERIFY_HEX;
|
||||
|
||||
const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token);
|
||||
|
||||
if (rc_tokenizer != PARSER_OK) return (rc_tokenizer);
|
||||
|
||||
// salt
|
||||
|
||||
const u8 *salt_pos = token.buf[1];
|
||||
const int salt_len = token.len[1];
|
||||
|
||||
salt->salt_buf[0] = hex_to_u32 (salt_pos + 0);
|
||||
salt->salt_buf[1] = hex_to_u32 (salt_pos + 8);
|
||||
salt->salt_buf[2] = 0;
|
||||
salt->salt_buf[3] = 0;
|
||||
|
||||
salt->salt_buf_pc[0] = salt->salt_buf[0];
|
||||
salt->salt_buf_pc[1] = salt->salt_buf[1];
|
||||
|
||||
decoder_apply_optimizer (hashconfig, salt->salt_buf_pc);
|
||||
|
||||
// hash
|
||||
|
||||
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] = 0;
|
||||
digest[3] = 0;
|
||||
|
||||
decoder_apply_optimizer (hashconfig, digest);
|
||||
|
||||
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 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[0];
|
||||
tmp[1] = digest[1];
|
||||
tmp[2] = 0;
|
||||
tmp[3] = 0;
|
||||
|
||||
encoder_apply_optimizer (hashconfig, tmp);
|
||||
|
||||
encoder_apply_options (hashconfig, tmp);
|
||||
|
||||
u8 *out_buf = (u8 *) line_buf;
|
||||
|
||||
int out_len = 0;
|
||||
|
||||
u32_to_hex (tmp[0], out_buf + out_len); out_len += 8;
|
||||
u32_to_hex (tmp[1], out_buf + out_len); out_len += 8;
|
||||
|
||||
out_buf[out_len] = hashconfig->separator;
|
||||
|
||||
out_len++;
|
||||
|
||||
u32_to_hex (salt->salt_buf[0], out_buf + out_len); out_len += 8;
|
||||
u32_to_hex (salt->salt_buf[1], out_buf + out_len); out_len += 8;
|
||||
|
||||
return out_len;
|
||||
}
|
||||
|
||||
const char *module_benchmark_mask (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const char *mask = "?b?b?b?b?b?b?bx";
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
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_benchmark_mask;
|
||||
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_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_binary_verify = 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_kernel_loops_max;
|
||||
module_ctx->module_kernel_loops_min = module_kernel_loops_min;
|
||||
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_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_pw_max;
|
||||
module_ctx->module_pw_min = module_pw_min;
|
||||
module_ctx->module_salt_max = module_salt_max;
|
||||
module_ctx->module_salt_min = module_salt_min;
|
||||
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_unstable_warning;
|
||||
module_ctx->module_warmup_disable = MODULE_DEFAULT;
|
||||
}
|
@ -1505,7 +1505,7 @@ bool parse_and_store_generic_salt (u8 *out_buf, int *out_len, const u8 *in_buf,
|
||||
tmp_buf[tmp2_len++] = 0x01;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_ST_GENERATE_LE)
|
||||
if (hashconfig->opts_type & OPTS_TYPE_ST_GENERATE_BE)
|
||||
{
|
||||
u32 max = tmp2_len / 4;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user