1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-25 01:18:15 +00:00

Do not hexify worldlist when --hex-charset is used

This commit is contained in:
Dávid Bolvanský 2022-09-06 01:25:23 +02:00
parent 1d9147ce1c
commit 454b0ad294
4 changed files with 9 additions and 7 deletions

View File

@ -456,7 +456,7 @@ This configuration item is a bitmask field and is very similar to the module_opt
* OPTS_TYPE_PT_ALWAYS_ASCII: This option prevents hashcat to automatically convert a password into the $HEX[...] encoding type. This automatic conversion is typically performed if the password itself contains the same character as the hash line separator character.
* OPTS_TYPE_PT_ALWAYS_HEXIFY: This option forces all the cracked passwords to be written always in hex. In this case neither "$HEX[", nor "]", is added.
* OPTS_TYPE_PT_LM: Special handling for LM passwords: all lower, 7 max, ...
* OPTS_TYPE_PT_HEX: Assume that all input data like wordlist and masks are always given in hex
* OPTS_TYPE_PT_HEX: Assume that wordlist is given in hex.
* OPTS_TYPE_ST_UTF16LE: Same as OPTS_TYPE_PT_UTF16LE but applied on the salt buffer.
* OPTS_TYPE_ST_UTF16BE: Same as OPTS_TYPE_PT_UTF16BE but applied on the salt buffer.
* OPTS_TYPE_ST_UPPER: Same as OPTS_TYPE_PT_UPPER but applied on the salt buffer.
@ -468,6 +468,7 @@ This configuration item is a bitmask field and is very similar to the module_opt
* OPTS_TYPE_ST_ADDBITS15: Same as OPTS_TYPE_PT_ADDBITS15 but applied on the salt buffer.
* OPTS_TYPE_ST_HEX: Same as OPTS_TYPE_PT_HEX but applied on the salt buffer.
* OPTS_TYPE_ST_BASE64: Same as OPTS_TYPE_ST_HEX but using base64 encoding.
* OPTS_TYPE_MT_HEX: Assume that mask is always given in hex.
* OPTS_TYPE_HASH_COPY: This copies the original input hash line as it is into a buffer so that it can be used later. This is required if the original input hash line ships with the same data which is not copied into salt_t or esalt buffer because it is overhead data which is not used in any way. The hash line is copied to the buffer hash_info->orighash and can be used from the encoder function by simply returning hash_info->orighash. Please do not abuse this functionality, for two reasons: First, by being able to reconstruct the original hash line from only the hashcat data we verify that the correct amount of data has been stored in the hashcat memory structures (IOW, it is a good verification process). Second, the host memory requirement for saving this data increases drastically.
* OPTS_TYPE_HASH_SPLIT: This needs to be used if the hash actually contains multiple hashes in the same hash line. A good example is the LM hash which is typically stored as a 128 bit hash, but actually is built on two 64 bit hashes.
* OPTS_TYPE_LOOP_PREPARE: TBD

View File

@ -420,7 +420,7 @@ typedef enum opts_type
OPTS_TYPE_PT_ALWAYS_ASCII = (1ULL << 12),
OPTS_TYPE_PT_ALWAYS_HEXIFY = (1ULL << 13),
OPTS_TYPE_PT_LM = (1ULL << 14), // special handling: all lower, 7 max, ...
OPTS_TYPE_PT_HEX = (1ULL << 15), // input wordlist (and masks!) are always in hex
OPTS_TYPE_PT_HEX = (1ULL << 15), // input wordlist is always in hex
OPTS_TYPE_ST_UTF16LE = (1ULL << 16),
OPTS_TYPE_ST_UTF16BE = (1ULL << 17),
OPTS_TYPE_ST_UPPER = (1ULL << 18),
@ -432,6 +432,7 @@ typedef enum opts_type
OPTS_TYPE_ST_ADDBITS15 = (1ULL << 24),
OPTS_TYPE_ST_HEX = (1ULL << 25),
OPTS_TYPE_ST_BASE64 = (1ULL << 26),
OPTS_TYPE_MT_HEX = (1ULL << 27), // mask is always in hex
OPTS_TYPE_HASH_COPY = (1ULL << 28),
OPTS_TYPE_HASH_SPLIT = (1ULL << 29),
OPTS_TYPE_LOOP_PREPARE = (1ULL << 30), // a kernel which is called each time before _loop kernel started.

View File

@ -294,7 +294,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
if (user_options->hex_charset)
{
hashconfig->opts_type |= OPTS_TYPE_PT_HEX;
hashconfig->opts_type |= OPTS_TYPE_MT_HEX;
}
if (user_options->hex_wordlist)

View File

@ -324,7 +324,7 @@ static int mp_expand (hashcat_ctx_t *hashcat_ctx, const char *in_buf, size_t in_
}
else
{
if (hashconfig->opts_type & OPTS_TYPE_PT_HEX)
if (hashconfig->opts_type & OPTS_TYPE_MT_HEX)
{
in_pos++;
@ -437,7 +437,7 @@ static int mp_gen_css (hashcat_ctx_t *hashcat_ctx, char *mask_buf, size_t mask_l
}
else
{
if (hashconfig->opts_type & OPTS_TYPE_PT_HEX)
if (hashconfig->opts_type & OPTS_TYPE_MT_HEX)
{
mask_pos++;
@ -519,7 +519,7 @@ static int mp_get_truncated_mask (hashcat_ctx_t *hashcat_ctx, const char *mask_b
}
else
{
if (hashconfig->opts_type & OPTS_TYPE_PT_HEX)
if (hashconfig->opts_type & OPTS_TYPE_MT_HEX)
{
mask_pos++;
@ -1168,7 +1168,7 @@ u32 mp_get_length (const char *mask, const u32 opts_type)
ignore_next = true;
}
if (opts_type & OPTS_TYPE_PT_HEX)
if (opts_type & OPTS_TYPE_MT_HEX)
{
ignore_next = true;
}