diff --git a/docs/readme.txt b/docs/readme.txt index 7f90047f7..8de951cd3 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -110,6 +110,9 @@ NVIDIA GPUs require "NVIDIA Driver" (418.56 or later) - PBKDF2-HMAC-SHA1 - PBKDF2-HMAC-SHA256 - PBKDF2-HMAC-SHA512 +- Python passlib pbkdf2-sha1 +- Python passlib pbkdf2-sha256 +- Python passlib pbkdf2-sha512 - Skype - WPA-EAPOL-PBKDF2 - WPA-EAPOL-PMK @@ -270,9 +273,6 @@ NVIDIA GPUs require "NVIDIA Driver" (418.56 or later) - Ethereum Pre-Sale Wallet, PBKDF2-HMAC-SHA256 - Ansible Vault - Plaintext -- Python passlib pbkdf2-sha1 -- Python passlib pbkdf2-sha256 -- Python passlib pbkdf2-sha512 ## ## Attack-Modes diff --git a/include/convert.h b/include/convert.h index 5a7c4fad3..7a11466ca 100644 --- a/include/convert.h +++ b/include/convert.h @@ -35,22 +35,22 @@ void u8_to_hex (const u8 v, u8 hex[2]); void u32_to_hex (const u32 v, u8 hex[8]); void u64_to_hex (const u64 v, u8 hex[16]); -u8 int_to_base32 (const u8 c); -u8 base32_to_int (const u8 c); -u8 int_to_base64 (const u8 c); -u8 base64_to_int (const u8 c); -u8 int_to_alternate_base64 (const u8 c); -u8 alternate_base64_to_int (const u8 c); -u8 int_to_base64url (const u8 c); -u8 base64url_to_int (const u8 c); -u8 int_to_itoa32 (const u8 c); -u8 itoa32_to_int (const u8 c); -u8 int_to_itoa64 (const u8 c); -u8 itoa64_to_int (const u8 c); -u8 int_to_bf64 (const u8 c); -u8 bf64_to_int (const u8 c); -u8 int_to_lotus64 (const u8 c); -u8 lotus64_to_int (const u8 c); +u8 int_to_base32 (const u8 c); +u8 base32_to_int (const u8 c); +u8 int_to_base64 (const u8 c); +u8 base64_to_int (const u8 c); +u8 int_to_ab64 (const u8 c); +u8 ab64_to_int (const u8 c); +u8 int_to_base64url (const u8 c); +u8 base64url_to_int (const u8 c); +u8 int_to_itoa32 (const u8 c); +u8 itoa32_to_int (const u8 c); +u8 int_to_itoa64 (const u8 c); +u8 itoa64_to_int (const u8 c); +u8 int_to_bf64 (const u8 c); +u8 bf64_to_int (const u8 c); +u8 int_to_lotus64 (const u8 c); +u8 lotus64_to_int (const u8 c); size_t base32_decode (u8 (*f) (const u8), const u8 *in_buf, const size_t in_len, u8 *out_buf); size_t base32_encode (u8 (*f) (const u8), const u8 *in_buf, const size_t in_len, u8 *out_buf); diff --git a/src/convert.c b/src/convert.c index 264ad8a90..ce5b3b645 100644 --- a/src/convert.c +++ b/src/convert.c @@ -556,7 +556,7 @@ u8 base64_to_int (const u8 c) } // alternate base64 using ./ instead of +/, used in python passlib hashes -u8 int_to_alternate_base64 (const u8 c) +u8 int_to_ab64 (const u8 c) { const u8 tbl[0x40] = { @@ -569,7 +569,7 @@ u8 int_to_alternate_base64 (const u8 c) return tbl[c]; } -u8 alternate_base64_to_int (const u8 c) +u8 ab64_to_int (const u8 c) { const u8 tbl[0x100] = { diff --git a/src/modules/module_20200.c b/src/modules/module_20200.c index be3e4672b..ece0a5949 100644 --- a/src/modules/module_20200.c +++ b/src/modules/module_20200.c @@ -16,7 +16,7 @@ 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_8_16; -static const u32 HASH_CATEGORY = HASH_CATEGORY_FORUM_SOFTWARE; +static const u32 HASH_CATEGORY = HASH_CATEGORY_GENERIC_KDF; static const char *HASH_NAME = "Python passlib pbkdf2-sha512"; static const u64 KERN_TYPE = 7100; static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE @@ -153,7 +153,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[256] = { 0 }; - const size_t salt_len_decoded = base64_decode (alternate_base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + const size_t salt_len_decoded = base64_decode (ab64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); u8 *salt_buf_ptr = (u8 *) pbkdf2_sha512->salt_buf; memcpy (salt_buf_ptr, tmp_buf, salt_len_decoded); @@ -166,7 +166,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[4]; const int hash_len = token.len[4]; - base64_decode (alternate_base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (ab64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, HASH_LEN_RAW); digest[0] = byte_swap_64 (digest[0]); @@ -203,8 +203,8 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char salt_enc[257] = { 0 }; char hash_enc[128] = { 0 }; - const size_t salt_len_enc = base64_encode (int_to_alternate_base64, (const u8 *) pbkdf2_sha512->salt_buf, salt->salt_len, (u8 *) salt_enc); - const size_t hash_len_enc = base64_encode (int_to_alternate_base64, (const u8 *) tmp, HASH_LEN_RAW, (u8 *) hash_enc); + const size_t salt_len_enc = base64_encode (int_to_ab64, (const u8 *) pbkdf2_sha512->salt_buf, salt->salt_len, (u8 *) salt_enc); + const size_t hash_len_enc = base64_encode (int_to_ab64, (const u8 *) tmp, HASH_LEN_RAW, (u8 *) hash_enc); // remove padding = for (size_t i = 0; i < salt_len_enc; i++) diff --git a/src/modules/module_20300.c b/src/modules/module_20300.c index c19d1aa1f..fb5a519a6 100644 --- a/src/modules/module_20300.c +++ b/src/modules/module_20300.c @@ -16,7 +16,7 @@ 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_32; -static const u32 HASH_CATEGORY = HASH_CATEGORY_FORUM_SOFTWARE; +static const u32 HASH_CATEGORY = HASH_CATEGORY_GENERIC_KDF; static const char *HASH_NAME = "Python passlib pbkdf2-sha256"; static const u64 KERN_TYPE = 10900; static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE @@ -152,7 +152,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[256] = { 0 }; - const size_t salt_len_decoded = base64_decode (alternate_base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + const size_t salt_len_decoded = base64_decode (ab64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); u8 *salt_buf_ptr = (u8 *) pbkdf2_sha256->salt_buf; memcpy (salt_buf_ptr, tmp_buf, salt_len_decoded); @@ -165,7 +165,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[4]; const int hash_len = token.len[4]; - base64_decode (alternate_base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (ab64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, HASH_LEN_RAW); digest[0] = byte_swap_32 (digest[0]); @@ -202,8 +202,8 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char salt_enc[257] = { 0 }; char hash_enc[128] = { 0 }; - const size_t salt_len_enc = base64_encode (int_to_alternate_base64, (const u8 *) pbkdf2_sha256->salt_buf, salt->salt_len, (u8 *) salt_enc); - const size_t hash_len_enc = base64_encode (int_to_alternate_base64, (const u8 *) tmp, HASH_LEN_RAW, (u8 *) hash_enc); + const size_t salt_len_enc = base64_encode (int_to_ab64, (const u8 *) pbkdf2_sha256->salt_buf, salt->salt_len, (u8 *) salt_enc); + const size_t hash_len_enc = base64_encode (int_to_ab64, (const u8 *) tmp, HASH_LEN_RAW, (u8 *) hash_enc); // remove padding = for (size_t i = 0; i < salt_len_enc; i++) diff --git a/src/modules/module_20400.c b/src/modules/module_20400.c index 2bb91c24c..6c5433fb2 100644 --- a/src/modules/module_20400.c +++ b/src/modules/module_20400.c @@ -16,7 +16,7 @@ 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_32; -static const u32 HASH_CATEGORY = HASH_CATEGORY_FORUM_SOFTWARE; +static const u32 HASH_CATEGORY = HASH_CATEGORY_GENERIC_KDF; static const char *HASH_NAME = "Python passlib pbkdf2-sha1"; static const u64 KERN_TYPE = 12000; static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE @@ -152,7 +152,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[256] = { 0 }; - const size_t salt_len_decoded = base64_decode (alternate_base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + const size_t salt_len_decoded = base64_decode (ab64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); u8 *salt_buf_ptr = (u8 *) pbkdf2_sha1->salt_buf; memcpy (salt_buf_ptr, tmp_buf, salt_len_decoded); @@ -164,7 +164,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[4]; const int hash_len = token.len[4]; - base64_decode (alternate_base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (ab64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, HASH_LEN_RAW); digest[0] = byte_swap_32 (digest[0]); @@ -195,8 +195,8 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char salt_enc[257] = { 0 }; char hash_enc[128] = { 0 }; - const size_t salt_len_enc = base64_encode (int_to_alternate_base64, (const u8 *) pbkdf2_sha1->salt_buf, salt->salt_len, (u8 *) salt_enc); - const size_t hash_len_enc = base64_encode (int_to_alternate_base64, (const u8 *) tmp, HASH_LEN_RAW, (u8 *) hash_enc); + const size_t salt_len_enc = base64_encode (int_to_ab64, (const u8 *) pbkdf2_sha1->salt_buf, salt->salt_len, (u8 *) salt_enc); + const size_t hash_len_enc = base64_encode (int_to_ab64, (const u8 *) tmp, HASH_LEN_RAW, (u8 *) hash_enc); // substitute + with . and remove padding = for (size_t i = 0; i < salt_len_enc; i++)