1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 15:18:16 +00:00

Merge pull request #2038 from s3inlc/pkzip-fix-4

Fix uncompressed hash attack when being longer than MAX_LOCAL
This commit is contained in:
Jens Steube 2019-05-20 19:15:34 +02:00 committed by GitHub
commit a2dee17fc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 222 additions and 30 deletions

View File

@ -409,15 +409,47 @@ KERNEL_FQ void m17210_sxx (KERN_ATTR_RULES_ESALT (pkzip_t))
// global memory from here
for (u32 i = MAX_LOCAL * 4; i < data_length; i++)
for (u32 j = MAX_LOCAL, i = MAX_LOCAL * 4; i < data_length; j++, i += 4)
{
next = esalt_bufs[digests_offset].hash.data[j];
if (data_length >= (i + 1))
{
update_key3 (key2, key3);
plain = esalt_bufs[digests_offset].hash.data[i] ^ key3;
plain = unpack_v8a_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 2))
{
update_key3 (key2, key3);
plain = unpack_v8b_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 3))
{
update_key3 (key2, key3);
plain = unpack_v8c_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 4))
{
update_key3 (key2, key3);
plain = unpack_v8d_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
}
const u32 r0 = ~crc;
const u32 r1 = 0;
const u32 r2 = 0;
@ -604,15 +636,47 @@ KERNEL_FQ void m17210_mxx (KERN_ATTR_RULES_ESALT (pkzip_t))
// global memory from here
for (u32 i = MAX_LOCAL * 4; i < data_length; i++)
for (u32 j = MAX_LOCAL, i = MAX_LOCAL * 4; i < data_length; j++, i += 4)
{
next = esalt_bufs[digests_offset].hash.data[j];
if (data_length >= (i + 1))
{
update_key3 (key2, key3);
plain = esalt_bufs[digests_offset].hash.data[i] ^ key3;
plain = unpack_v8a_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 2))
{
update_key3 (key2, key3);
plain = unpack_v8b_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 3))
{
update_key3 (key2, key3);
plain = unpack_v8c_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 4))
{
update_key3 (key2, key3);
plain = unpack_v8d_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
}
const u32 r0 = ~crc;
const u32 r1 = 0;
const u32 r2 = 0;

View File

@ -409,15 +409,47 @@ KERNEL_FQ void m17210_sxx (KERN_ATTR_ESALT (pkzip_t))
// global memory from here
for (u32 i = MAX_LOCAL * 4; i < data_length; i++)
for (u32 j = MAX_LOCAL, i = MAX_LOCAL * 4; i < data_length; j++, i += 4)
{
next = esalt_bufs[digests_offset].hash.data[j];
if (data_length >= (i + 1))
{
update_key3 (key2, key3);
plain = esalt_bufs[digests_offset].hash.data[i] ^ key3;
plain = unpack_v8a_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 2))
{
update_key3 (key2, key3);
plain = unpack_v8b_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 3))
{
update_key3 (key2, key3);
plain = unpack_v8c_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 4))
{
update_key3 (key2, key3);
plain = unpack_v8d_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
}
const u32 r0 = ~crc;
const u32 r1 = 0;
const u32 r2 = 0;
@ -606,15 +638,47 @@ KERNEL_FQ void m17210_mxx (KERN_ATTR_ESALT (pkzip_t))
// global memory from here
for (u32 i = MAX_LOCAL * 4; i < data_length; i++)
for (u32 j = MAX_LOCAL, i = MAX_LOCAL * 4; i < data_length; j++, i += 4)
{
next = esalt_bufs[digests_offset].hash.data[j];
if (data_length >= (i + 1))
{
update_key3 (key2, key3);
plain = esalt_bufs[digests_offset].hash.data[i] ^ key3;
plain = unpack_v8a_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 2))
{
update_key3 (key2, key3);
plain = unpack_v8b_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 3))
{
update_key3 (key2, key3);
plain = unpack_v8c_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 4))
{
update_key3 (key2, key3);
plain = unpack_v8d_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
}
const u32 r0 = ~crc;
const u32 r1 = 0;
const u32 r2 = 0;

View File

@ -421,15 +421,47 @@ KERNEL_FQ void m17210_sxx (KERN_ATTR_VECTOR_ESALT (pkzip_t))
// global memory from here
for (u32 i = MAX_LOCAL * 4; i < data_length; i++)
for (u32 j = MAX_LOCAL, i = MAX_LOCAL * 4; i < data_length; j++, i += 4)
{
next = esalt_bufs[digests_offset].hash.data[j];
if (data_length >= (i + 1))
{
update_key3 (key2, key3);
plain = esalt_bufs[digests_offset].hash.data[i] ^ key3;
plain = unpack_v8a_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 2))
{
update_key3 (key2, key3);
plain = unpack_v8b_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 3))
{
update_key3 (key2, key3);
plain = unpack_v8c_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 4))
{
update_key3 (key2, key3);
plain = unpack_v8d_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
}
const u32 r0 = ~crc;
const u32 r1 = 0;
const u32 r2 = 0;
@ -630,15 +662,47 @@ KERNEL_FQ void m17210_mxx (KERN_ATTR_VECTOR_ESALT (pkzip_t))
// global memory from here
for (u32 i = MAX_LOCAL * 4; i < data_length; i++)
for (u32 j = MAX_LOCAL, i = MAX_LOCAL * 4; i < data_length; j++, i += 4)
{
next = esalt_bufs[digests_offset].hash.data[j];
if (data_length >= (i + 1))
{
update_key3 (key2, key3);
plain = esalt_bufs[digests_offset].hash.data[i] ^ key3;
plain = unpack_v8a_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 2))
{
update_key3 (key2, key3);
plain = unpack_v8b_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 3))
{
update_key3 (key2, key3);
plain = unpack_v8c_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
if (data_length >= (i + 4))
{
update_key3 (key2, key3);
plain = unpack_v8d_from_v32_S (next) ^ key3;
update_key012 (key0, key1, key2, plain, l_crc32tab);
crc = CRC32 (crc, plain, l_crc32tab);
}
}
const u32 r0 = ~crc;
const u32 r1 = 0;
const u32 r2 = 0;