From 78d2706038a9d390a9b90210955d781fd913d5fd Mon Sep 17 00:00:00 2001 From: jsteube Date: Mon, 28 Jan 2019 14:05:58 +0100 Subject: [PATCH] Add -m 8900 module and module_extra_tmp_size() --- include/interface_migrate.h | 3 - include/modules.h | 1 + include/types.h | 6 + src/hashes.c | 24 +- src/interface.c | 1 + src/interface_migrate.c | 325 +------------------------- src/modules/module_00000.c | 1 + src/modules/module_00010.c | 1 + src/modules/module_00011.c | 1 + src/modules/module_00012.c | 1 + src/modules/module_00020.c | 1 + src/modules/module_00021.c | 1 + src/modules/module_00100.c | 1 + src/modules/module_00101.c | 1 + src/modules/module_00110.c | 1 + src/modules/module_00200.c | 1 + src/modules/module_00300.c | 1 + src/modules/module_00400.c | 1 + src/modules/module_00500.c | 1 + src/modules/module_00501.c | 1 + src/modules/module_00600.c | 1 + src/modules/module_00900.c | 1 + src/modules/module_01000.c | 1 + src/modules/module_01300.c | 1 + src/modules/module_01400.c | 1 + src/modules/module_01500.c | 1 + src/modules/module_01600.c | 1 + src/modules/module_01700.c | 1 + src/modules/module_01800.c | 1 + src/modules/module_02400.c | 1 + src/modules/module_02500.c | 1 + src/modules/module_02501.c | 1 + src/modules/module_03000.c | 1 + src/modules/module_03200.c | 1 + src/modules/module_05100.c | 1 + src/modules/module_05500.c | 1 + src/modules/module_05600.c | 1 + src/modules/module_06211.c | 1 + src/modules/module_06212.c | 1 + src/modules/module_06213.c | 1 + src/modules/module_06221.c | 1 + src/modules/module_06222.c | 1 + src/modules/module_06223.c | 1 + src/modules/module_06231.c | 1 + src/modules/module_06232.c | 1 + src/modules/module_06233.c | 1 + src/modules/module_06241.c | 1 + src/modules/module_06242.c | 1 + src/modules/module_06243.c | 1 + src/modules/module_06300.c | 1 + src/modules/module_07100.c | 1 + src/modules/module_07500.c | 1 + src/modules/module_08900.c | 448 ++++++++++++++++++++++++++++++++++++ src/modules/module_10800.c | 1 + src/modules/module_11500.c | 1 + src/modules/module_11600.c | 1 + src/modules/module_12000.c | 1 + src/modules/module_12500.c | 1 + src/modules/module_13000.c | 1 + src/modules/module_13100.c | 1 + src/modules/module_14000.c | 1 + src/modules/module_14100.c | 1 + src/modules/module_15300.c | 1 + src/modules/module_15900.c | 1 + src/modules/module_16800.c | 1 + src/modules/module_16801.c | 1 + src/modules/module_17300.c | 1 + src/modules/module_17400.c | 1 + src/modules/module_17500.c | 1 + src/modules/module_17600.c | 1 + src/modules/module_17700.c | 1 + src/modules/module_17800.c | 1 + src/modules/module_17900.c | 1 + src/modules/module_18000.c | 1 + src/modules/module_18100.c | 1 + src/modules/module_18200.c | 1 + src/modules/module_18300.c | 1 + src/modules/module_18400.c | 1 + src/modules/module_18500.c | 1 + src/modules/module_18600.c | 1 + src/modules/module_99999.c | 1 + src/opencl.c | 57 +++-- 82 files changed, 584 insertions(+), 355 deletions(-) create mode 100644 src/modules/module_08900.c diff --git a/include/interface_migrate.h b/include/interface_migrate.h index 5a3f9b4dd..e452e81e3 100644 --- a/include/interface_migrate.h +++ b/include/interface_migrate.h @@ -628,7 +628,6 @@ typedef enum hash_type HASH_TYPE_LOTUS5 = 26, HASH_TYPE_LOTUS6 = 27, HASH_TYPE_ANDROIDFDE = 28, - HASH_TYPE_SCRYPT = 29, HASH_TYPE_LOTUS8 = 30, HASH_TYPE_OFFICE2007 = 31, HASH_TYPE_OFFICE2010 = 32, @@ -745,7 +744,6 @@ typedef enum kern_type KERN_TYPE_LOTUS5 = 8600, KERN_TYPE_LOTUS6 = 8700, KERN_TYPE_ANDROIDFDE = 8800, - KERN_TYPE_SCRYPT = 8900, KERN_TYPE_PSAFE2 = 9000, KERN_TYPE_LOTUS8 = 9100, KERN_TYPE_OFFICE2007 = 9400, @@ -948,7 +946,6 @@ int mediawiki_b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_bu int peoplesoft_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); int skype_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); int androidfde_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); -int scrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); int cisco8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); int cisco9_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); int office2007_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); diff --git a/include/modules.h b/include/modules.h index bdd325592..1ec16a8b5 100644 --- a/include/modules.h +++ b/include/modules.h @@ -64,6 +64,7 @@ int module_hash_encode_status (MAYBE_UNUSED const hashconfig_t *ha 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); u64 module_extra_buffer_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, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param); +u64 module_extra_tmp_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, MAYBE_UNUSED const hashes_t *hashes); char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param); u32 module_deep_comp_kernel (MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const u32 salt_pos, MAYBE_UNUSED const u32 digest_pos); int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash); diff --git a/include/types.h b/include/types.h index be6574174..41ed3477c 100644 --- a/include/types.h +++ b/include/types.h @@ -934,6 +934,7 @@ struct hashconfig u64 esalt_size; u64 hook_salt_size; u64 tmp_size; + u64 extra_tmp_size; u64 hook_size; // password length limit @@ -1177,12 +1178,16 @@ typedef struct hc_device_param u64 size_markov_css; u64 size_digests; u64 size_salts; + u64 size_esalts; u64 size_shown; u64 size_results; u64 size_plains; u64 size_st_digests; u64 size_st_salts; u64 size_st_esalts; + u64 size_tm; + + u64 extra_buffer_size; #ifdef WITH_BRAIN u64 size_brain_link_in; @@ -2327,6 +2332,7 @@ typedef struct module_ctx int (*module_hash_encode) (const hashconfig_t *, const void *, const salt_t *, const void *, const void *, const hashinfo_t *, char *, int); u64 (*module_extra_buffer_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *, const hashes_t *, const hc_device_param_t *); + u64 (*module_extra_tmp_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *, const hashes_t *); char *(*module_jit_build_options) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *, const hashes_t *, const hc_device_param_t *); u32 (*module_deep_comp_kernel) (const hashes_t *, const u32, const u32); int (*module_hash_init_selftest) (const hashconfig_t *, hash_t *); diff --git a/src/hashes.c b/src/hashes.c index 1248caf9a..e3832f632 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -1493,9 +1493,11 @@ int hashes_init_stage3 (hashcat_ctx_t *hashcat_ctx) int hashes_init_stage4 (hashcat_ctx_t *hashcat_ctx) { - hashconfig_t *hashconfig = hashcat_ctx->hashconfig; - hashes_t *hashes = hashcat_ctx->hashes; - user_options_t *user_options = hashcat_ctx->user_options; + hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + hashes_t *hashes = hashcat_ctx->hashes; + module_ctx_t *module_ctx = hashcat_ctx->module_ctx; + user_options_t *user_options = hashcat_ctx->user_options; + user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; if (hashes->salts_cnt == 1) hashconfig->opti_type |= OPTI_TYPE_SINGLE_SALT; @@ -1536,6 +1538,22 @@ int hashes_init_stage4 (hashcat_ctx_t *hashcat_ctx) } } + // time to update extra_tmp_size which is tmp_size value based on hash configuration + + if (module_ctx->module_extra_tmp_size != MODULE_DEFAULT) + { + const u64 extra_tmp_size = module_ctx->module_extra_tmp_size (hashconfig, user_options, user_options_extra, hashes); + + if (extra_tmp_size == (u64) -1) + { + event_log_error (hashcat_ctx, "Mixed hash settings are not supported."); + + return -1; + } + + hashconfig->extra_tmp_size = extra_tmp_size; + } + // at this point we no longer need hash_t* structure hash_t *hashes_buf = hashes->hashes_buf; diff --git a/src/interface.c b/src/interface.c index 8304c6d96..3eb6d167a 100644 --- a/src/interface.c +++ b/src/interface.c @@ -344,6 +344,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) CHECK_DEFINED (module_ctx->module_hash_encode_status); CHECK_DEFINED (module_ctx->module_hash_encode); CHECK_DEFINED (module_ctx->module_extra_buffer_size); + CHECK_DEFINED (module_ctx->module_extra_tmp_size); CHECK_DEFINED (module_ctx->module_jit_build_options); CHECK_DEFINED (module_ctx->module_deep_comp_kernel); CHECK_DEFINED (module_ctx->module_hash_init_selftest); diff --git a/src/interface_migrate.c b/src/interface_migrate.c index 6531e7abe..f56eefa69 100644 --- a/src/interface_migrate.c +++ b/src/interface_migrate.c @@ -45,7 +45,6 @@ " 11860 | HMAC-Streebog-512 (key = $salt), big-endian | Raw Hash, Authenticated", " 14900 | Skip32 (PT = $salt, key = $pass) | Raw Cipher, Known-Plaintext attack", " 15400 | ChaCha20 | Raw Cipher, Known-Plaintext attack", - " 8900 | scrypt | Generic KDF", " 11900 | PBKDF2-HMAC-MD5 | Generic KDF", " 10900 | PBKDF2-HMAC-SHA256 | Generic KDF", " 12100 | PBKDF2-HMAC-SHA512 | Generic KDF", @@ -210,7 +209,6 @@ static const char *ST_PASS_BIN_10410 = "\x6a\x8a\xed\xcc\xb7"; /** * Missing self-test hashes: * - * ST_HASH_08900 the self-test can't work because the scrypt settings is part of the code at compile-time * ST_HASH_1374x missing example hash * ST_HASH_1376x missing example hash * ST_HASH_14600 multi-hash-mode algorithm, unlikely to match self-test hash settings @@ -314,7 +312,6 @@ static const char *ST_HASH_08500 = "$racf$*8481*6095E8FCA59F8E3E"; static const char *ST_HASH_08600 = "3dd2e1e5ac03e230243d58b8c5ada076"; static const char *ST_HASH_08700 = "(GDJ0nDZI8l8RJzlRbemg)"; static const char *ST_HASH_08800 = "$fde$16$ca56e82e7b5a9c2fc1e3b5a7d671c2f9$16$7c124af19ac913be0fc137b75a34b20d$eac806ae7277c8d48243d52a8644fa57a817317bd3457f94dca727964cbc27c88296954f289597a9de3314a4e9d9f28dce70cf9ce3e1c3c0c6fc041687a0ad3cb333d4449bc9da8fcc7d5f85948a7ac3bc6d34f505e9d0d91da4396e35840bde3465ad11c5086c89ee6db68d65e47a2e5413f272caa01e02224e5ff3dc3bed3953a702e85e964e562e62f5c97a2df6c47547bfb5aeeb329ff8f9c9666724d399043fe970c8b282b45e93d008333f3b4edd5eb147bd023ed18ac1f9f75a6cd33444b507694c64e1e98a964b48c0a77276e9930250d01801813c235169a7b1952891c63ce0d462abc688bd96c0337174695a957858b4c9fd277d04abe8a0c2c5def4b352ba29410f8dbec91bcb2ca2b8faf26d44f02340b3373bc94e7487ce014e6adfbf7edfdd2057225f8aeb324c9d1be877c6ae4211ae387e07bf2a056984d2ed2815149b3e9cf9fbfae852f7dd5906c2b86e7910c0d7755ef5bcc39f0e135bf546c839693dc4af3e50b8382c7c8c754d4ee218fa85d70ee0a5707a9f827209a7ddb6c2fb9431a61c9775112cc88aa2a34f97c2f53dfce082aa0758917269a5fc30049ceab67d3efd721fee021ffca979f839b4f052e27f5c382c0dd5c02fd39fbc9b26e04bf9e051d1923eff9a7cde3244902bb8538b1b9f11631def5aad7c21d2113bcdc989b771ff6bf220f94354034dd417510117b55a669e969fc3bc6c5dcd4741b8313bf7d999dc94d4949f27eec0cd06f906c17a80d09f583a5dd601854832673b78d125a2c5ad0352932be7b93c611fee8c6049670442d8c532674f3d21d45d3d009211d2a9e6568252ac4682982172cb43e7c6b05e85851787ad90e25b77cce3f7968d455f92653a1d3790bc50e5f6e1f743ac47275ffa8e81bbe832a8d7d78d5d5a7c73f95703aebb355849ae566492093bd9cb51070f39c69bb4e22b99cc0e60e96d048385bb69f1c44a3b79547fbc19a873a632f43f05fa2d8a6f9155e59d153e2851b739c42444018b8c4e09a93be43570834667d0b5a5d2a53b1572dab3e750b3f9e641e303559bace06612fbd451a5e822201442828e79168c567a85d8c024cd8ce32bf650105b1af98cc5428675f4f4bbede37a0ef98d1533a8a6dcb27d87a2b799f18706f4677edaa0411becac4c591ede83993aedba660d1dd67f6c4a5c141ad3e6e0c77730cb0ecbf4f4bd8ef6067e05ca3bc563d9e1554a893fea0050bdd1733c883f533f87eac39cceee0ccf817fc1f19bcfdd13e9f241b89bfb149b509e9a0747658438536b6705514cc6d6bb3c64c903e4710435d8bebc35297d1ebbdff8074b203f37d1910d8b4637e4d3dab997f4aa378a7a67c79e698a11e83d0d7e759d0e7969c4f5408168b282fe28d3279ec1d4cc6f85a0f8e5d01f21c7508a69773c44167ff8d467d0801f9ec54f9ee2496d4e7e470214abc1ca11355bb18cd23273aac6b05b47f9e301b42b137a2455758c24e2716dcd2e55bbeb780f592e664e7392bf6eccb80959f24c8800816c84f2575e82e1f3559c33a5be7a3a0c843c2989f486b113d5eeada007caf6b5a0f6d71e2f5c09a4def57c7057168051868317a9ec790d570d76a0d21a45ad951c475db5a66101475871147c5a5907ec4e6b14128ed6695bb73c1c97952e96826eeb6003aa13462093e4afc209627241f03b0247e110fbab983640423b7cdf112e01579fed68c80ac7df7449d9d2114b9ae5539c03c2037be45c5f74e7357b25c6a24b7bd503864437147e50d7ac4ccc4bbd0cabecdc6bac60a362285fe450e2c2d0a446578c8880dc957e6e8061e691b83eb8062d1aad476e0c7b25e4d5454f1288686eb525f37fe649637b235b7828366b0219a9c63d6ddbb696dc3585a2ebfbd5f5e4c170d6784ab9993e15142535e194d2bee3dc9477ef8b8e1b07605e0c04f49edf6d42be3a9dabbc592dde78ce8b7dd9684bfcf4ca2f5a44b1872abe18fb6fa67a79390f273a9d12f9269389629456d71b9e7ed3447462269a849ce83e1893f253c832537f850b1acce5b11d2ba6b7c2f99e8e7c8085f390c21f69e1ce4bbf85b4e1ad86c0d6706432766978076f4cada9ca6f28d395d9cc5e74b2a6b46eb9d1de79eeecff7dc97ec2a8d8870e3894e1e4e26ccb98dd2f88c0229bbd3152fa149f0cc132561f"; -//static const char *ST_HASH_08900 = "SCRYPT:1024:1:1:Mzg3MjYzNzYwMzE0NDE=:uM7P3Kg2X9En9KZPv3378YablKcuUoQ1mwunXdg3o1M="; static const char *ST_HASH_09000 = "0a3f352686e5eb5be173e668a4fff5cd5df420927e1da2d5d4052340160637e3e6a5a92841a188ed240e13b919f3d91694bd4c0acba79271e9c08a83ea5ad387cbb74d5884066a1cb5a8caa80d847079168f84823847c631dbe3a834f1bc496acfebac3bff1608bf1c857717f8f428e07b5e2cb12aaeddfa83d7dcb6d840234d08b84f8ca6c6e562af73eea13148f7902bcaf0220d3e36eeeff1d37283dc421483a2791182614ebb"; static const char *ST_HASH_09100 = "(HC34tD3KtDp4oCZWmCJ4qC30mC30mC3KmC30mCcA5ovrMLH9M)"; static const char *ST_HASH_09200 = "$8$84486783037343$pYNyVrtyMalQrZLxRi7ZLQS1Fl.jkYCgASUi5P8JNb2"; @@ -474,7 +471,6 @@ static const char *HT_08500 = "RACF"; static const char *HT_08600 = "Lotus Notes/Domino 5"; static const char *HT_08700 = "Lotus Notes/Domino 6"; static const char *HT_08800 = "Android FDE <= 4.3"; -static const char *HT_08900 = "scrypt"; static const char *HT_09000 = "Password Safe v2"; static const char *HT_09100 = "Lotus Notes/Domino 8"; static const char *HT_09200 = "Cisco-IOS $8$ (PBKDF2-SHA256)"; @@ -635,7 +631,6 @@ static const char *SIGNATURE_POSTGRESQL_AUTH = "$postgres$"; static const char *SIGNATURE_PSAFE3 = "PWS3"; static const char *SIGNATURE_RACF = "$racf$"; static const char *SIGNATURE_SAPH_SHA1 = "{x-issha, "; -static const char *SIGNATURE_SCRYPT = "SCRYPT"; static const char *SIGNATURE_SHA1AIX = "{ssha1}"; static const char *SIGNATURE_SHA1B64 = "{SHA}"; static const char *SIGNATURE_SHA256AIX = "{ssha256}"; @@ -7116,94 +7111,6 @@ int androidfde_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int scrypt_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 = 6; - - token.signatures_cnt = 1; - token.signatures_buf[0] = SIGNATURE_SCRYPT; - - token.len_min[0] = 6; - token.len_max[0] = 6; - token.sep[0] = ':'; - token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_SIGNATURE; - - token.len_min[1] = 1; - token.len_max[1] = 6; - token.sep[1] = ':'; - token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; - - token.len_min[2] = 1; - token.len_max[2] = 6; - token.sep[2] = ':'; - token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; - - token.len_min[3] = 1; - token.len_max[3] = 6; - token.sep[3] = ':'; - token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH; - - token.len_min[4] = 0; - token.len_max[4] = 45; - token.sep[4] = ':'; - token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_BASE64A; - - token.len_min[5] = 44; - token.len_max[5] = 44; - token.sep[5] = ':'; - token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH - | TOKEN_ATTR_VERIFY_BASE64A; - - const int rc_tokenizer = input_tokenizer (input_buf, input_len, &token); - - if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - - // scrypt settings - - const u8 *N_pos = token.buf[1]; - const u8 *r_pos = token.buf[2]; - const u8 *p_pos = token.buf[3]; - - salt->scrypt_N = hc_strtoul ((const char *) N_pos, NULL, 10); - salt->scrypt_r = hc_strtoul ((const char *) r_pos, NULL, 10); - salt->scrypt_p = hc_strtoul ((const char *) p_pos, NULL, 10); - - // salt - - const u8 *salt_pos = token.buf[4]; - const int salt_len = token.len[4]; - - u8 tmp_buf[33] = { 0 }; - - const int tmp_len = base64_decode (base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); - - memcpy (salt->salt_buf, tmp_buf, tmp_len); - - salt->salt_len = tmp_len; - salt->salt_iter = 1; - - // digest - base64 decode - - const u8 *hash_pos = token.buf[5]; - const int hash_len = token.len[5]; - - memset (tmp_buf, 0, sizeof (tmp_buf)); - - base64_decode (base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); - - memcpy (digest, tmp_buf, 32); - - return (PARSER_OK); -} - int cisco8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -13942,8 +13849,6 @@ int filevault2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE u32 kernel_threads_mxx (hashcat_ctx_t *hashcat_ctx) { - - if (hashconfig->hash_mode == 8900) kernel_threads = 16; // SCRYPT if (hashconfig->hash_mode == 9000) kernel_threads = 8; // Blowfish if (hashconfig->hash_mode == 9300) kernel_threads = 8; // SCRYPT if (hashconfig->hash_mode == 9700) kernel_threads = 64; // RC4 @@ -13969,11 +13874,6 @@ u32 kernel_loops_mxx (hashcat_ctx_t *hashcat_ctx) { - if (hashconfig->hash_mode == 8900) - { - kernel_loops_fixed = 1; - } - if (hashconfig->hash_mode == 9300) { kernel_loops_fixed = 1; @@ -14003,7 +13903,7 @@ u32 kernel_accel_mxx (hashcat_ctx_t *hashcat_ctx) #define SCRYPT_MAX_ACCEL 16 - if ((hashconfig->hash_mode == 8900) || (hashconfig->hash_mode == 9300) || (hashconfig->hash_mode == 15700)) + if ((hashconfig->hash_mode == 9300) || (hashconfig->hash_mode == 15700)) { // 16 is actually a bit low, we may need to change this depending on user response @@ -14011,15 +13911,6 @@ u32 kernel_accel_mxx (hashcat_ctx_t *hashcat_ctx) } - // let the module decide if it allows user-defined values over module defined valaues - - // commandline parameters overwrite tuningdb entries - - if (user_options->kernel_accel_chgd == true) - { - device_param->kernel_accel_min = user_options->kernel_accel; - device_param->kernel_accel_max = user_options->kernel_accel; - } } @@ -14047,11 +13938,6 @@ void hashconfig_benchmark_defaults (hashcat_ctx_t *hashcat_ctx, salt_t *salt, vo break; case 8800: salt->salt_len = 16; break; - case 8900: salt->salt_len = 16; - salt->scrypt_N = 1024; - salt->scrypt_r = 1; - salt->scrypt_p = 1; - break; case 9100: salt->salt_len = 16; break; case 9300: salt->salt_len = 14; @@ -14198,8 +14084,6 @@ void hashconfig_benchmark_defaults (hashcat_ctx_t *hashcat_ctx, salt_t *salt, vo break; case 8800: salt->salt_iter = ROUNDS_ANDROIDFDE; break; - case 8900: salt->salt_iter = 1; - break; case 9000: salt->salt_iter = ROUNDS_PSAFE2; break; case 9100: salt->salt_iter = ROUNDS_LOTUS8; @@ -15212,38 +15096,6 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const int out_size, byte_swap_32 (digest_buf[3]), tmp); } - else if (hash_mode == 8900) - { - u32 N = salt.scrypt_N; - u32 r = salt.scrypt_r; - u32 p = salt.scrypt_p; - - char base64_salt[32] = { 0 }; - - base64_encode (int_to_base64, (const u8 *) salt.salt_buf, salt.salt_len, (u8 *) base64_salt); - - memset (tmp_buf, 0, 46); - - 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]); - digest_buf[4] = byte_swap_32 (digest_buf[4]); - digest_buf[5] = byte_swap_32 (digest_buf[5]); - digest_buf[6] = byte_swap_32 (digest_buf[6]); - digest_buf[7] = byte_swap_32 (digest_buf[7]); - digest_buf[8] = 0; // needed for base64_encode () - - base64_encode (int_to_base64, (const u8 *) digest_buf, 32, (u8 *) tmp_buf); - - snprintf (out_buf, out_size, "%s:%u:%u:%u:%s:%s", - SIGNATURE_SCRYPT, - N, - r, - p, - base64_salt, - tmp_buf); - } else if (hash_mode == 9000) { snprintf (out_buf, out_size, "%s", hashfile); @@ -18928,22 +18780,6 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; break; - case 8900: hashconfig->hash_type = HASH_TYPE_SCRYPT; - hashconfig->salt_type = SALT_TYPE_EMBEDDED; - hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL; - hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE; - hashconfig->kern_type = KERN_TYPE_SCRYPT; - hashconfig->dgst_size = DGST_SIZE_4_8; - hashconfig->parse_func = scrypt_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE; - hashconfig->dgst_pos0 = 0; - hashconfig->dgst_pos1 = 1; - hashconfig->dgst_pos2 = 2; - hashconfig->dgst_pos3 = 3; - hashconfig->st_hash = NULL; - hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; - break; - case 9000: hashconfig->hash_type = HASH_TYPE_SHA1; hashconfig->salt_type = SALT_TYPE_EMBEDDED; hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL; @@ -20881,7 +20717,6 @@ u32 default_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED co case 8600: pw_max = 16; break; // Lotus Notes/Domino 5 limits itself to 16 case 8700: pw_max = 64; break; // https://www.ibm.com/support/knowledgecenter/en/SSKTWP_8.5.3/com.ibm.notes85.client.doc/fram_limits_of_notes_r.html case 8800: pw_max = PW_MAX; break; - case 8900: pw_max = PW_MAX; break; case 9100: pw_max = 64; break; // https://www.ibm.com/support/knowledgecenter/en/SSKTWP_8.5.3/com.ibm.notes85.client.doc/fram_limits_of_notes_r.html case 9200: pw_max = PW_MAX; break; case 9300: pw_max = PW_MAX; break; @@ -21118,7 +20953,7 @@ u64 module_size_extra_buffer (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE u64 size_scrypt = 4; - if ((hashconfig->hash_mode == 8900) || (hashconfig->hash_mode == 9300) || (hashconfig->hash_mode == 15700)) + if ((hashconfig->hash_mode == 9300) || (hashconfig->hash_mode == 15700)) { // we need to check that all hashes have the same scrypt settings @@ -21271,170 +21106,21 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY */ - if (hashconfig->hash_mode == 8900) - { - opencl_ctx->force_jit_compilation = 8900; - } + else if (hashconfig->hash_mode == 9300) { - opencl_ctx->force_jit_compilation = 8900; + opencl_ctx->force_jit_compilation = 9300; } else if (hashconfig->hash_mode == 15700) { opencl_ctx->force_jit_compilation = 15700; } - // scryptV stuff - - u64 scrypt_tmp_size = 0; - u64 scrypt_tmto_final = 0; - - u64 size_scrypt = 4; - - if ((hashconfig->hash_mode == 8900) || (hashconfig->hash_mode == 9300) || (hashconfig->hash_mode == 15700)) - { - // we need to check that all hashes have the same scrypt settings - - const u32 scrypt_N = hashes->salts_buf[0].scrypt_N; - const u32 scrypt_r = hashes->salts_buf[0].scrypt_r; - const u32 scrypt_p = hashes->salts_buf[0].scrypt_p; - - for (u32 i = 1; i < hashes->salts_cnt; i++) - { - if ((hashes->salts_buf[i].scrypt_N != scrypt_N) - || (hashes->salts_buf[i].scrypt_r != scrypt_r) - || (hashes->salts_buf[i].scrypt_p != scrypt_p)) - { - event_log_error (hashcat_ctx, "Mixed scrypt settings are not supported."); - - return -1; - } - } - - scrypt_tmp_size = (128 * scrypt_r * scrypt_p); - - hashconfig->tmp_size = scrypt_tmp_size; - - u32 tmto_start = 1; - u32 tmto_stop = 6; - - if (user_options->scrypt_tmto) - { - tmto_start = user_options->scrypt_tmto; - tmto_stop = user_options->scrypt_tmto; - } - - const u32 scrypt_threads = hashconfig->forced_kernel_threads; - - const u64 kernel_power_max = SCRYPT_MAX_ACCEL * device_processors * scrypt_threads; - - // size_pws - - const u64 size_pws = kernel_power_max * sizeof (pw_t); - - const u64 size_pws_amp = size_pws; - - // size_pws_comp - - const u64 size_pws_comp = kernel_power_max * (sizeof (u32) * 64); - - // size_pws_idx - - const u64 size_pws_idx = (kernel_power_max + 1) * sizeof (pw_idx_t); - - // size_tmps - - const u64 size_tmps = kernel_power_max * hashconfig->tmp_size; - - // size_hooks - - const u64 size_hooks = kernel_power_max * hashconfig->hook_size; - - const u64 scrypt_extra_space - = bitmap_ctx->bitmap_size - + bitmap_ctx->bitmap_size - + bitmap_ctx->bitmap_size - + bitmap_ctx->bitmap_size - + bitmap_ctx->bitmap_size - + bitmap_ctx->bitmap_size - + bitmap_ctx->bitmap_size - + bitmap_ctx->bitmap_size - + size_bfs - + size_combs - + size_digests - + size_esalts - + size_hooks - + size_markov_css - + size_plains - + size_pws - + size_pws_amp - + size_pws_comp - + size_pws_idx - + size_results - + size_root_css - + size_rules - + size_rules_c - + size_salts - + size_shown - + size_tm - + size_tmps - + size_st_digests - + size_st_salts - + size_st_esalts; - - bool not_enough_memory = true; - - u32 tmto; - - for (tmto = tmto_start; tmto <= tmto_stop; tmto++) - { - size_scrypt = (128 * scrypt_r) * scrypt_N; - - size_scrypt /= 1u << tmto; - - size_scrypt *= kernel_power_max; - - if ((size_scrypt / 4) > device_param->device_maxmem_alloc) - { - if (user_options->quiet == false) event_log_warning (hashcat_ctx, "Increasing single-block device memory allocatable for --scrypt-tmto %u.", tmto); - - continue; - } - - if ((size_scrypt + scrypt_extra_space) > device_param->device_available_mem) - { - if (user_options->quiet == false) event_log_warning (hashcat_ctx, "Increasing total device memory allocatable for --scrypt-tmto %u.", tmto); - - continue; - } - - for (u32 salts_pos = 0; salts_pos < hashes->salts_cnt; salts_pos++) - { - scrypt_tmto_final = tmto; - } - - not_enough_memory = false; - - break; - } - - if (not_enough_memory == true) - { - event_log_error (hashcat_ctx, "Cannot allocate enough device memory. Perhaps retry with -n 1."); - - return -1; - } - - #if defined (DEBUG) - if (user_options->quiet == false) event_log_warning (hashcat_ctx, "SCRYPT tmto optimizer value set to: %lu, mem: %lu", scrypt_tmto_final, size_scrypt); - if (user_options->quiet == false) event_log_warning (hashcat_ctx, NULL); - #endif - } size_t size_scrypt4 = size_scrypt / 4; - else if ((opencl_ctx->force_jit_compilation == 8900) || (opencl_ctx->force_jit_compilation == 15700)) + else if ((opencl_ctx->force_jit_compilation == 9300) || (opencl_ctx->force_jit_compilation == 15700)) { hc_asprintf (&build_opts_update,"%s -DSCRYPT_N=%u -DSCRYPT_R=%u -DSCRYPT_P=%u -DSCRYPT_TMTO=%u -DSCRYPT_TMP_ELEM=%" PRIu64, build_opts, hashes->salts_buf[0].scrypt_N, hashes->salts_buf[0].scrypt_r, hashes->salts_buf[0].scrypt_p, 1u << scrypt_tmto_final, (u64) scrypt_tmp_size / 16); } @@ -21452,7 +21138,6 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE */ if ( - || (hashconfig->hash_mode == 8900) || (hashconfig->hash_mode == 9300) || (hashconfig->hash_mode == 9800) || (hashconfig->hash_mode == 15700)) diff --git a/src/modules/module_00000.c b/src/modules/module_00000.c index c8f231092..92d3be916 100644 --- a/src/modules/module_00000.c +++ b/src/modules/module_00000.c @@ -133,6 +133,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00010.c b/src/modules/module_00010.c index 5f791d094..f03646cdc 100644 --- a/src/modules/module_00010.c +++ b/src/modules/module_00010.c @@ -161,6 +161,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00011.c b/src/modules/module_00011.c index b319c50f7..afbd74cd0 100644 --- a/src/modules/module_00011.c +++ b/src/modules/module_00011.c @@ -161,6 +161,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00012.c b/src/modules/module_00012.c index 679b509c5..08332baf5 100644 --- a/src/modules/module_00012.c +++ b/src/modules/module_00012.c @@ -152,6 +152,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00020.c b/src/modules/module_00020.c index 753831877..2abaa60dc 100644 --- a/src/modules/module_00020.c +++ b/src/modules/module_00020.c @@ -160,6 +160,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00021.c b/src/modules/module_00021.c index 62440af30..0a5d2e4af 100644 --- a/src/modules/module_00021.c +++ b/src/modules/module_00021.c @@ -151,6 +151,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00100.c b/src/modules/module_00100.c index 31ae36224..769be2952 100644 --- a/src/modules/module_00100.c +++ b/src/modules/module_00100.c @@ -135,6 +135,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00101.c b/src/modules/module_00101.c index 2a7ae4609..5bd68d768 100644 --- a/src/modules/module_00101.c +++ b/src/modules/module_00101.c @@ -141,6 +141,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00110.c b/src/modules/module_00110.c index 16776bea5..e0a86545d 100644 --- a/src/modules/module_00110.c +++ b/src/modules/module_00110.c @@ -163,6 +163,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00200.c b/src/modules/module_00200.c index 19d22e83b..6d329a4b3 100644 --- a/src/modules/module_00200.c +++ b/src/modules/module_00200.c @@ -121,6 +121,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00300.c b/src/modules/module_00300.c index cc940a044..6f7279c3a 100644 --- a/src/modules/module_00300.c +++ b/src/modules/module_00300.c @@ -134,6 +134,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00400.c b/src/modules/module_00400.c index abda70492..6d7ad2afb 100644 --- a/src/modules/module_00400.c +++ b/src/modules/module_00400.c @@ -242,6 +242,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00500.c b/src/modules/module_00500.c index 48785a836..d1f5d221b 100644 --- a/src/modules/module_00500.c +++ b/src/modules/module_00500.c @@ -259,6 +259,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00501.c b/src/modules/module_00501.c index 05b653e26..ed66b2527 100644 --- a/src/modules/module_00501.c +++ b/src/modules/module_00501.c @@ -300,6 +300,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_00600.c b/src/modules/module_00600.c index ce86f7b62..90b11eff3 100644 --- a/src/modules/module_00600.c +++ b/src/modules/module_00600.c @@ -168,6 +168,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_00900.c b/src/modules/module_00900.c index 928b4c6cd..b023a6e48 100644 --- a/src/modules/module_00900.c +++ b/src/modules/module_00900.c @@ -133,6 +133,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_01000.c b/src/modules/module_01000.c index 60299f487..6bd2cade3 100644 --- a/src/modules/module_01000.c +++ b/src/modules/module_01000.c @@ -136,6 +136,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_01300.c b/src/modules/module_01300.c index ca4909fb3..8f321fbee 100644 --- a/src/modules/module_01300.c +++ b/src/modules/module_01300.c @@ -141,6 +141,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_01400.c b/src/modules/module_01400.c index c60a1a6c1..c597221b1 100644 --- a/src/modules/module_01400.c +++ b/src/modules/module_01400.c @@ -144,6 +144,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_01500.c b/src/modules/module_01500.c index 245b3da3d..1d9c6d8ed 100644 --- a/src/modules/module_01500.c +++ b/src/modules/module_01500.c @@ -220,6 +220,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_01600.c b/src/modules/module_01600.c index 4aa3e1f08..e4ef2646c 100644 --- a/src/modules/module_01600.c +++ b/src/modules/module_01600.c @@ -259,6 +259,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_01700.c b/src/modules/module_01700.c index fa63fd750..7d8742148 100644 --- a/src/modules/module_01700.c +++ b/src/modules/module_01700.c @@ -145,6 +145,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_01800.c b/src/modules/module_01800.c index 59325532f..992c81007 100644 --- a/src/modules/module_01800.c +++ b/src/modules/module_01800.c @@ -524,6 +524,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_02400.c b/src/modules/module_02400.c index 9bba924c4..3b04c8e07 100644 --- a/src/modules/module_02400.c +++ b/src/modules/module_02400.c @@ -159,6 +159,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_02500.c b/src/modules/module_02500.c index 5568a3095..7f7962033 100644 --- a/src/modules/module_02500.c +++ b/src/modules/module_02500.c @@ -802,6 +802,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_count; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_02501.c b/src/modules/module_02501.c index 9d3bfe246..6a07ca0ba 100644 --- a/src/modules/module_02501.c +++ b/src/modules/module_02501.c @@ -802,6 +802,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_count; module_ctx->module_hash_binary_parse = module_hash_binary_parse; diff --git a/src/modules/module_03000.c b/src/modules/module_03000.c index 8021e17ca..9e61603ff 100644 --- a/src/modules/module_03000.c +++ b/src/modules/module_03000.c @@ -198,6 +198,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = module_dictstat_disable; 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; diff --git a/src/modules/module_03200.c b/src/modules/module_03200.c index 7d994a780..48a039531 100644 --- a/src/modules/module_03200.c +++ b/src/modules/module_03200.c @@ -230,6 +230,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_05100.c b/src/modules/module_05100.c index 430e29b10..591fe0666 100644 --- a/src/modules/module_05100.c +++ b/src/modules/module_05100.c @@ -117,6 +117,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_05500.c b/src/modules/module_05500.c index 4e0a5ca12..11f6327a5 100644 --- a/src/modules/module_05500.c +++ b/src/modules/module_05500.c @@ -409,6 +409,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_05600.c b/src/modules/module_05600.c index 49eb98ecd..e60b0be61 100644 --- a/src/modules/module_05600.c +++ b/src/modules/module_05600.c @@ -318,6 +318,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_06211.c b/src/modules/module_06211.c index 749a48367..3224a9040 100644 --- a/src/modules/module_06211.c +++ b/src/modules/module_06211.c @@ -253,6 +253,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06212.c b/src/modules/module_06212.c index bb610229d..53e2eacb4 100644 --- a/src/modules/module_06212.c +++ b/src/modules/module_06212.c @@ -253,6 +253,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06213.c b/src/modules/module_06213.c index 89ff8a76e..effded071 100644 --- a/src/modules/module_06213.c +++ b/src/modules/module_06213.c @@ -253,6 +253,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06221.c b/src/modules/module_06221.c index 588d8ee80..9ac16d034 100644 --- a/src/modules/module_06221.c +++ b/src/modules/module_06221.c @@ -254,6 +254,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06222.c b/src/modules/module_06222.c index 21a52dee0..f3ed5e48a 100644 --- a/src/modules/module_06222.c +++ b/src/modules/module_06222.c @@ -254,6 +254,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06223.c b/src/modules/module_06223.c index 0e4e3d646..bcdd09b9d 100644 --- a/src/modules/module_06223.c +++ b/src/modules/module_06223.c @@ -254,6 +254,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06231.c b/src/modules/module_06231.c index 9982404da..9fa4e9796 100644 --- a/src/modules/module_06231.c +++ b/src/modules/module_06231.c @@ -253,6 +253,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06232.c b/src/modules/module_06232.c index cabfccf2d..8a9b77919 100644 --- a/src/modules/module_06232.c +++ b/src/modules/module_06232.c @@ -253,6 +253,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06233.c b/src/modules/module_06233.c index 13b12b514..c2cbc60bf 100644 --- a/src/modules/module_06233.c +++ b/src/modules/module_06233.c @@ -253,6 +253,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06241.c b/src/modules/module_06241.c index 1902d81d7..ac63a77f2 100644 --- a/src/modules/module_06241.c +++ b/src/modules/module_06241.c @@ -253,6 +253,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06242.c b/src/modules/module_06242.c index 5ea1a80f3..b5fb0b52b 100644 --- a/src/modules/module_06242.c +++ b/src/modules/module_06242.c @@ -253,6 +253,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06243.c b/src/modules/module_06243.c index 91d64c1fe..85d9ba768 100644 --- a/src/modules/module_06243.c +++ b/src/modules/module_06243.c @@ -253,6 +253,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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_hash_binary_parse; diff --git a/src/modules/module_06300.c b/src/modules/module_06300.c index ee6d05753..a94ef617d 100644 --- a/src/modules/module_06300.c +++ b/src/modules/module_06300.c @@ -250,6 +250,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_07100.c b/src/modules/module_07100.c index 8fbcc9747..4d82debd7 100644 --- a/src/modules/module_07100.c +++ b/src/modules/module_07100.c @@ -230,6 +230,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_07500.c b/src/modules/module_07500.c index 5876c6221..a555ce7da 100644 --- a/src/modules/module_07500.c +++ b/src/modules/module_07500.c @@ -248,6 +248,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_08900.c b/src/modules/module_08900.c new file mode 100644 index 000000000..be60dc555 --- /dev/null +++ b/src/modules/module_08900.c @@ -0,0 +1,448 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include +#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_OUTSIDE_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_8; +static const u32 HASH_CATEGORY = HASH_CATEGORY_GENERIC_KDF; +static const char *HASH_NAME = "scrypt"; +static const u32 HASH_TYPE = HASH_TYPE_GENERIC; +static const u64 KERN_TYPE = 8900; +static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE; +static const u64 OPTS_TYPE = OPTS_TYPE_STATE_BUFFER_LE + | OPTS_TYPE_PT_GENERATE_LE; +static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED; +static const char *ST_PASS = NULL; // the self-test can't work because the scrypt settings is part of the code at compile-time +static const char *ST_HASH = "SCRYPT:1024:1:1:Mzg3MjYzNzYwMzE0NDE=:uM7P3Kg2X9En9KZPv3378YablKcuUoQ1mwunXdg3o1M="; + +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; } + +// limit scrypt accel otherwise we hurt ourself when calculating the scrypt tmto +// 16 is actually a bit low, we may need to change this depending on user response + +static const char *SIGNATURE_SCRYPT = "SCRYPT"; +static const u32 SCRYPT_MAX_ACCEL = 16; +static const u32 SCRYPT_MAX_THREADS = 16; + +u32 module_kernel_accel_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 kernel_accel_min = 1; + + return kernel_accel_min; +} + +u32 module_kernel_accel_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 kernel_accel_max = (user_options->kernel_accel_chgd == true) ? user_options->kernel_accel : SCRYPT_MAX_ACCEL; + + return kernel_accel_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) +{ + const u32 kernel_loops_min = 1; + + return kernel_loops_min; +} + +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) +{ + const u32 kernel_loops_max = 1; + + return kernel_loops_max; +} + +u32 module_kernel_threads_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 kernel_threads_min = 1; + + return kernel_threads_min; +} + +u32 module_kernel_threads_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) +{ + // limit scrypt accel otherwise we hurt ourself when calculating the scrypt tmto + // 16 is actually a bit low, we may need to change this depending on user response + + const u32 kernel_threads_max = (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : SCRYPT_MAX_THREADS; + + return kernel_threads_max; +} + +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) +{ + // this overrides the reductions of PW_MAX in case optimized kernel is selected + // IOW, even in optimized kernel mode it support length 256 + + const u32 pw_max = PW_MAX; + + return pw_max; +} + +u64 module_extra_buffer_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, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param) +{ + // we need to set the self-test hash settings to pass the self-test + // the decoder for the self-test is called after this function + + const u32 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : 1024; + const u32 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : 1; + + const u64 kernel_power_max = device_param->device_processors * hashconfig->kernel_threads_max * hashconfig->kernel_accel_max; + + u32 tmto_start = 1; + u32 tmto_stop = 6; + + if (user_options->scrypt_tmto) + { + tmto_start = user_options->scrypt_tmto; + tmto_stop = user_options->scrypt_tmto; + } + + // size_pws + + const u64 size_pws = kernel_power_max * sizeof (pw_t); + + const u64 size_pws_amp = size_pws; + + // size_pws_comp + + const u64 size_pws_comp = kernel_power_max * (sizeof (u32) * 64); + + // size_pws_idx + + const u64 size_pws_idx = (kernel_power_max + 1) * sizeof (pw_idx_t); + + // size_tmps + + const u64 size_tmps = kernel_power_max * hashconfig->tmp_size; + + // size_hooks + + const u64 size_hooks = kernel_power_max * hashconfig->hook_size; + + const u64 scrypt_extra_space + = device_param->size_bfs + + device_param->size_combs + + device_param->size_digests + + device_param->size_esalts + + device_param->size_markov_css + + device_param->size_plains + + device_param->size_results + + device_param->size_root_css + + device_param->size_rules + + device_param->size_rules_c + + device_param->size_salts + + device_param->size_shown + + device_param->size_tm + + device_param->size_st_digests + + device_param->size_st_salts + + device_param->size_st_esalts + + size_pws + + size_pws_amp + + size_pws_comp + + size_pws_idx + + size_tmps + + size_hooks; + + bool not_enough_memory = true; + + u64 size_scrypt = 0; + + u32 tmto; + + for (tmto = tmto_start; tmto <= tmto_stop; tmto++) + { + size_scrypt = (128 * scrypt_r) * scrypt_N; + + size_scrypt /= 1u << tmto; + + size_scrypt *= kernel_power_max; + + if ((size_scrypt / 4) > device_param->device_maxmem_alloc) continue; + + if ((size_scrypt + scrypt_extra_space) > device_param->device_available_mem) continue; + + not_enough_memory = false; + + break; + } + + if (not_enough_memory == true) return -1; + + return size_scrypt; +} + +u64 module_tmp_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) +{ + const u64 tmp_size = 0; // we'll add some later + + return tmp_size; +} + +u64 module_extra_tmp_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, MAYBE_UNUSED const hashes_t *hashes) +{ + // we need to set the self-test hash settings to pass the self-test + // the decoder for the self-test is called after this function + + const u32 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : 1024; + const u32 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : 1; + const u32 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : 1; + + // we need to check that all hashes have the same scrypt settings + + for (u32 i = 1; i < hashes->salts_cnt; i++) + { + if ((hashes->salts_buf[i].scrypt_N != scrypt_N) + || (hashes->salts_buf[i].scrypt_r != scrypt_r) + || (hashes->salts_buf[i].scrypt_p != scrypt_p)) + { + return -1; + } + } + + const u64 tmp_size = (128 * scrypt_r * scrypt_p); + + return tmp_size; +} + +char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param) +{ + const u32 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : 1024; + const u32 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : 1; + const u32 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : 1; + + const u64 extra_buffer_size = device_param->extra_buffer_size; + + const u64 kernel_power_max = device_param->device_processors * hashconfig->kernel_threads_max * hashconfig->kernel_accel_max; + + const u64 size_scrypt = (128 * scrypt_r) * scrypt_N; + + const u64 scrypt_tmto_final = (kernel_power_max * size_scrypt) / extra_buffer_size; + + const u64 tmp_size = (128 * scrypt_r) * scrypt_p; + + char *jit_build_options = NULL; + + hc_asprintf (&jit_build_options, "-DSCRYPT_N=%u -DSCRYPT_R=%u -DSCRYPT_P=%u -DSCRYPT_TMTO=%" PRIu64 " -DSCRYPT_TMP_ELEM=%" PRIu64, + hashes->salts_buf[0].scrypt_N, + hashes->salts_buf[0].scrypt_r, + hashes->salts_buf[0].scrypt_p, + scrypt_tmto_final, + tmp_size / 16); + + return jit_build_options; +} + +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 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 = 6; + + token.signatures_cnt = 1; + token.signatures_buf[0] = SIGNATURE_SCRYPT; + + token.len_min[0] = 6; + token.len_max[0] = 6; + token.sep[0] = ':'; + token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_SIGNATURE; + + token.len_min[1] = 1; + token.len_max[1] = 6; + token.sep[1] = ':'; + token.attr[1] = TOKEN_ATTR_VERIFY_LENGTH; + + token.len_min[2] = 1; + token.len_max[2] = 6; + token.sep[2] = ':'; + token.attr[2] = TOKEN_ATTR_VERIFY_LENGTH; + + token.len_min[3] = 1; + token.len_max[3] = 6; + token.sep[3] = ':'; + token.attr[3] = TOKEN_ATTR_VERIFY_LENGTH; + + token.len_min[4] = 0; + token.len_max[4] = 45; + token.sep[4] = ':'; + token.attr[4] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_BASE64A; + + token.len_min[5] = 44; + token.len_max[5] = 44; + token.sep[5] = ':'; + token.attr[5] = TOKEN_ATTR_VERIFY_LENGTH + | TOKEN_ATTR_VERIFY_BASE64A; + + const int rc_tokenizer = input_tokenizer ((const u8 *) line_buf, line_len, &token); + + if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); + + // scrypt settings + + const u8 *N_pos = token.buf[1]; + const u8 *r_pos = token.buf[2]; + const u8 *p_pos = token.buf[3]; + + salt->scrypt_N = hc_strtoul ((const char *) N_pos, NULL, 10); + salt->scrypt_r = hc_strtoul ((const char *) r_pos, NULL, 10); + salt->scrypt_p = hc_strtoul ((const char *) p_pos, NULL, 10); + + // salt + + const u8 *salt_pos = token.buf[4]; + const int salt_len = token.len[4]; + + u8 tmp_buf[33] = { 0 }; + + const int tmp_len = base64_decode (base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + + memcpy (salt->salt_buf, tmp_buf, tmp_len); + + salt->salt_len = tmp_len; + salt->salt_iter = 1; + + // digest - base64 decode + + const u8 *hash_pos = token.buf[5]; + const int hash_len = token.len[5]; + + memset (tmp_buf, 0, sizeof (tmp_buf)); + + base64_decode (base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + + memcpy (digest, tmp_buf, 32); + + 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; + + char base64_salt[32] = { 0 }; + + base64_encode (int_to_base64, (const u8 *) salt->salt_buf, salt->salt_len, (u8 *) base64_salt); + + char base64_digest[64] = { 0 }; + + base64_encode (int_to_base64, (const u8 *) digest_buf, 32, (u8 *) base64_digest); + + const int line_len = snprintf (line_buf, line_size, "%s:%u:%u:%u:%s:%s", + SIGNATURE_SCRYPT, + salt->scrypt_N, + salt->scrypt_r, + salt->scrypt_p, + base64_salt, + base64_digest); + + return line_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_extra_buffer_size; + module_ctx->module_extra_tmp_size = module_extra_tmp_size; + 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_jit_build_options; + module_ctx->module_kernel_accel_max = module_kernel_accel_max; + module_ctx->module_kernel_accel_min = module_kernel_accel_min; + 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_kernel_threads_max; + module_ctx->module_kernel_threads_min = module_kernel_threads_min; + 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_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_tmp_size; + module_ctx->module_unstable_warning = module_unstable_warning; + module_ctx->module_warmup_disable = MODULE_DEFAULT; +} diff --git a/src/modules/module_10800.c b/src/modules/module_10800.c index 9e8b495af..95220cdd2 100644 --- a/src/modules/module_10800.c +++ b/src/modules/module_10800.c @@ -143,6 +143,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_11500.c b/src/modules/module_11500.c index 5efc0206a..af7a9b221 100644 --- a/src/modules/module_11500.c +++ b/src/modules/module_11500.c @@ -119,6 +119,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_11600.c b/src/modules/module_11600.c index 14546f0eb..7a4bee690 100644 --- a/src/modules/module_11600.c +++ b/src/modules/module_11600.c @@ -653,6 +653,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_12000.c b/src/modules/module_12000.c index 22b007f13..fa5687864 100644 --- a/src/modules/module_12000.c +++ b/src/modules/module_12000.c @@ -207,6 +207,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_12500.c b/src/modules/module_12500.c index 4e5eccff3..0f3347f6c 100644 --- a/src/modules/module_12500.c +++ b/src/modules/module_12500.c @@ -210,6 +210,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_13000.c b/src/modules/module_13000.c index 6d6e2f8e7..5a69fcaae 100644 --- a/src/modules/module_13000.c +++ b/src/modules/module_13000.c @@ -245,6 +245,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_13100.c b/src/modules/module_13100.c index 1e72ef189..186bdb240 100644 --- a/src/modules/module_13100.c +++ b/src/modules/module_13100.c @@ -257,6 +257,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_14000.c b/src/modules/module_14000.c index d51ebddb9..46bd46148 100644 --- a/src/modules/module_14000.c +++ b/src/modules/module_14000.c @@ -231,6 +231,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_14100.c b/src/modules/module_14100.c index 31cc7cd0c..be6e4fb59 100644 --- a/src/modules/module_14100.c +++ b/src/modules/module_14100.c @@ -230,6 +230,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_15300.c b/src/modules/module_15300.c index 6e9cdb960..70b7b863f 100644 --- a/src/modules/module_15300.c +++ b/src/modules/module_15300.c @@ -397,6 +397,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_15900.c b/src/modules/module_15900.c index 19adc9904..22ede5451 100644 --- a/src/modules/module_15900.c +++ b/src/modules/module_15900.c @@ -393,6 +393,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_16800.c b/src/modules/module_16800.c index f6fb23c0f..df240a0b2 100644 --- a/src/modules/module_16800.c +++ b/src/modules/module_16800.c @@ -287,6 +287,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_16801.c b/src/modules/module_16801.c index e7570d4f5..1a015ea62 100644 --- a/src/modules/module_16801.c +++ b/src/modules/module_16801.c @@ -343,6 +343,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_17300.c b/src/modules/module_17300.c index 83b79e6f5..aa8b8385c 100644 --- a/src/modules/module_17300.c +++ b/src/modules/module_17300.c @@ -127,6 +127,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_17400.c b/src/modules/module_17400.c index 0bcc4e95a..959f075ed 100644 --- a/src/modules/module_17400.c +++ b/src/modules/module_17400.c @@ -118,6 +118,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_17500.c b/src/modules/module_17500.c index 187d21caa..87b25e08e 100644 --- a/src/modules/module_17500.c +++ b/src/modules/module_17500.c @@ -124,6 +124,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_17600.c b/src/modules/module_17600.c index 117c2dcf5..9ed92700a 100644 --- a/src/modules/module_17600.c +++ b/src/modules/module_17600.c @@ -130,6 +130,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_17700.c b/src/modules/module_17700.c index 634834cf3..e317aed68 100644 --- a/src/modules/module_17700.c +++ b/src/modules/module_17700.c @@ -127,6 +127,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_17800.c b/src/modules/module_17800.c index 743f8dda4..def061324 100644 --- a/src/modules/module_17800.c +++ b/src/modules/module_17800.c @@ -118,6 +118,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_17900.c b/src/modules/module_17900.c index 31faf3abb..96ee5826a 100644 --- a/src/modules/module_17900.c +++ b/src/modules/module_17900.c @@ -124,6 +124,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_18000.c b/src/modules/module_18000.c index c14e3eac8..7282aa738 100644 --- a/src/modules/module_18000.c +++ b/src/modules/module_18000.c @@ -130,6 +130,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_18100.c b/src/modules/module_18100.c index cd8fca9d7..4925fb13b 100644 --- a/src/modules/module_18100.c +++ b/src/modules/module_18100.c @@ -145,6 +145,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_18200.c b/src/modules/module_18200.c index 3e9d0e710..64cd1cb3e 100644 --- a/src/modules/module_18200.c +++ b/src/modules/module_18200.c @@ -219,6 +219,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_18300.c b/src/modules/module_18300.c index 38afb7e2f..5d5aa12a2 100644 --- a/src/modules/module_18300.c +++ b/src/modules/module_18300.c @@ -253,6 +253,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_18400.c b/src/modules/module_18400.c index fc8773f62..b33cb26f0 100644 --- a/src/modules/module_18400.c +++ b/src/modules/module_18400.c @@ -300,6 +300,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_18500.c b/src/modules/module_18500.c index d7821b7ea..f959f72b2 100644 --- a/src/modules/module_18500.c +++ b/src/modules/module_18500.c @@ -135,6 +135,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/modules/module_18600.c b/src/modules/module_18600.c index fd1e403b4..1787478ee 100644 --- a/src/modules/module_18600.c +++ b/src/modules/module_18600.c @@ -308,6 +308,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_dictstat_disable = MODULE_DEFAULT; module_ctx->module_esalt_size = module_esalt_size; 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; diff --git a/src/modules/module_99999.c b/src/modules/module_99999.c index d089a2817..e35912479 100644 --- a/src/modules/module_99999.c +++ b/src/modules/module_99999.c @@ -140,6 +140,7 @@ void module_init (module_ctx_t *module_ctx) 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; diff --git a/src/opencl.c b/src/opencl.c index 327a1a40e..0c97c2275 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -4567,6 +4567,9 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) } } + device_param->kernel_loops_min_sav = device_param->kernel_loops_min; + device_param->kernel_loops_max_sav = device_param->kernel_loops_max; + /** * device properties */ @@ -4697,6 +4700,9 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) u64 size_rules = (u64) straight_ctx->kernel_rules_cnt * sizeof (kernel_rule_t); u64 size_rules_c = (u64) KERNEL_RULES * sizeof (kernel_rule_t); + device_param->size_rules = size_rules; + device_param->size_rules_c = size_rules_c; + u64 size_plains = (u64) hashes->digests_cnt * sizeof (plain_t); u64 size_salts = (u64) hashes->salts_cnt * sizeof (salt_t); u64 size_esalts = (u64) hashes->digests_cnt * (u64) hashconfig->esalt_size; @@ -4707,11 +4713,16 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) device_param->size_digests = size_digests; device_param->size_shown = size_shown; device_param->size_salts = size_salts; + device_param->size_esalts = size_esalts; u64 size_combs = KERNEL_COMBS * sizeof (pw_t); u64 size_bfs = KERNEL_BFS * sizeof (bf_t); u64 size_tm = 32 * sizeof (bs_word_t); + device_param->size_bfs = size_bfs; + device_param->size_combs = size_combs; + device_param->size_tm = size_tm; + u64 size_st_digests = 1 * hashconfig->dgst_size; u64 size_st_salts = 1 * sizeof (salt_t); u64 size_st_esalts = 1 * hashconfig->esalt_size; @@ -4724,29 +4735,20 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) if (module_ctx->module_extra_buffer_size != MODULE_DEFAULT) { - size_extra_buffer = module_ctx->module_extra_buffer_size (hashconfig, user_options, user_options_extra, hashes, device_param); + const u64 extra_buffer_size = module_ctx->module_extra_buffer_size (hashconfig, user_options, user_options_extra, hashes, device_param); + + if (extra_buffer_size == (u64) -1) + { + event_log_error (hashcat_ctx, "Invalid extra buffer size."); + + return -1; + } + + device_param->extra_buffer_size = extra_buffer_size; + + size_extra_buffer = extra_buffer_size; } - /** - * some algorithms need a fixed kernel-loops count -- not longer needed with new concept - - const u32 forced_kernel_loops = hashconfig->forced_kernel_loops; - - if (forced_kernel_loops != 0) - { - device_param->kernel_loops_min = forced_kernel_loops; - device_param->kernel_loops_max = forced_kernel_loops; - } - */ - - device_param->kernel_loops_min_sav = device_param->kernel_loops_min; - device_param->kernel_loops_max_sav = device_param->kernel_loops_max; - - device_param->size_bfs = size_bfs; - device_param->size_combs = size_combs; - device_param->size_rules = size_rules; - device_param->size_rules_c = size_rules_c; - /** * default building options */ @@ -5401,10 +5403,10 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_WRITE, size_shown, NULL, &device_param->d_digests_shown); if (CL_rc == -1) return -1; CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_ONLY, size_salts, NULL, &device_param->d_salt_bufs); if (CL_rc == -1) return -1; CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_WRITE, size_results, NULL, &device_param->d_result); if (CL_rc == -1) return -1; - CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_WRITE, size_extra_buffer, NULL, &device_param->d_extra0_buf); if (CL_rc == -1) return -1; - CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_WRITE, size_extra_buffer, NULL, &device_param->d_extra1_buf); if (CL_rc == -1) return -1; - CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_WRITE, size_extra_buffer, NULL, &device_param->d_extra2_buf); if (CL_rc == -1) return -1; - CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_WRITE, size_extra_buffer, NULL, &device_param->d_extra3_buf); if (CL_rc == -1) return -1; + CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_WRITE, size_extra_buffer / 4, NULL, &device_param->d_extra0_buf); if (CL_rc == -1) return -1; + CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_WRITE, size_extra_buffer / 4, NULL, &device_param->d_extra1_buf); if (CL_rc == -1) return -1; + CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_WRITE, size_extra_buffer / 4, NULL, &device_param->d_extra2_buf); if (CL_rc == -1) return -1; + CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_WRITE, size_extra_buffer / 4, NULL, &device_param->d_extra3_buf); if (CL_rc == -1) return -1; CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_ONLY, size_st_digests, NULL, &device_param->d_st_digests_buf); if (CL_rc == -1) return -1; CL_rc = hc_clCreateBuffer (hashcat_ctx, device_param->context, CL_MEM_READ_ONLY, size_st_salts, NULL, &device_param->d_st_salts_buf); if (CL_rc == -1) return -1; @@ -6478,7 +6480,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) // size_tmps - size_tmps = (u64) kernel_power_max * hashconfig->tmp_size; + size_tmps = (u64) kernel_power_max * (hashconfig->tmp_size + hashconfig->extra_tmp_size); // size_hooks @@ -6539,9 +6541,6 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) + size_rules_c + size_salts + size_extra_buffer - + size_extra_buffer - + size_extra_buffer - + size_extra_buffer + size_shown + size_tm + size_tmps