1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 16:18:09 +00:00

Merge pull request #2035 from s3inlc/pkzip-fix-2

Added parser message for pkzip hashes which have unsupported compression type for kernel
This commit is contained in:
Jens Steube 2019-05-20 11:50:22 +02:00 committed by GitHub
commit 034987fa51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 4 deletions

View File

@ -512,6 +512,7 @@ typedef enum parser_rc
PARSER_TOKEN_ENCODING = -34,
PARSER_TOKEN_LENGTH = -35,
PARSER_INSUFFICIENT_ENTROPY = -36,
PARSER_PKZIP_CT_UNMATCHED = -37,
PARSER_UNKNOWN_ERROR = -255
} parser_rc_t;

View File

@ -248,7 +248,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
p = strtok(NULL, "*");
if (p == NULL) return PARSER_HASH_LENGTH;
pkzip->hash.compression_type = atoi(p);
if (pkzip->hash.compression_type != 8) return PARSER_HASH_VALUE;
if (pkzip->hash.compression_type != 8) return PARSER_PKZIP_CT_UNMATCHED;
p = strtok(NULL, "*");
if (p == NULL) return PARSER_HASH_LENGTH;

View File

@ -248,7 +248,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
p = strtok(NULL, "*");
if (p == NULL) return PARSER_HASH_LENGTH;
pkzip->hash.compression_type = atoi(p);
if (pkzip->hash.compression_type != 0) return PARSER_HASH_VALUE;
if (pkzip->hash.compression_type != 0) return PARSER_PKZIP_CT_UNMATCHED;
p = strtok(NULL, "*");
if (p == NULL) return PARSER_HASH_LENGTH;

View File

@ -250,7 +250,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
p = strtok(NULL, "*");
if (p == NULL) return PARSER_HASH_LENGTH;
pkzip->hashes[i].compression_type = atoi(p);
if (pkzip->hashes[i].compression_type != 8) return PARSER_HASH_VALUE;
if (pkzip->hashes[i].compression_type != 8) return PARSER_PKZIP_CT_UNMATCHED;
p = strtok(NULL, "*");
if (p == NULL) return PARSER_HASH_LENGTH;

View File

@ -251,7 +251,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
p = strtok(NULL, "*");
if (p == NULL) return PARSER_HASH_LENGTH;
pkzip->hashes[i].compression_type = atoi(p);
if (pkzip->hashes[i].compression_type != 8) return PARSER_HASH_VALUE;
if (pkzip->hashes[i].compression_type != 8) return PARSER_PKZIP_CT_UNMATCHED;
p = strtok(NULL, "*");
if (p == NULL) return PARSER_HASH_LENGTH;

View File

@ -49,6 +49,7 @@ static const char *PA_033 = "Invalid hccapx message pair";
static const char *PA_034 = "Token encoding exception";
static const char *PA_035 = "Token length exception";
static const char *PA_036 = "Insufficient entropy exception";
static const char *PA_037 = "Hash contains unsupported compression type for current mode";
static const char *PA_255 = "Unknown error";
static const char *OPTI_STR_OPTIMIZED_KERNEL = "Optimized-Kernel";
@ -973,6 +974,7 @@ const char *strparser (const u32 parser_status)
case PARSER_TOKEN_ENCODING: return PA_034;
case PARSER_TOKEN_LENGTH: return PA_035;
case PARSER_INSUFFICIENT_ENTROPY: return PA_036;
case PARSER_PKZIP_CT_UNMATCHED: return PA_037;
}
return PA_255;