Add support for Open Document Format 1.2

Contains a kernel for the latest ODF 1.2 encryption implemented in
LibreOffice. The algorithm uses a SHA-256 checksum, a PBKDF2-HMAC-SHA1
key derivation with 100000 iterations and key stretching and AES-CBC
encryption.

Valid hashes can be extracted with the libreoffice2john.py script,
available from the John the Ripper Jumbo repository at
https://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/run/libreoffice2john.py

You have to remove the filename suffix at the end of the hash before
passing it to hashcat. Also see 'hashcat -m18400 --example-hashes'.

You can leave the filename prefix if you use the --username option to
process those hashes.

 - Add hash-mode 18400 (Open Document Format (ODF) 1.2 (SHA-256, AES))
 - Tests: add hash-mode 18400 (Open Document Format (ODF) 1.2 (SHA-256, AES))
This commit is contained in:
R. Yushaev
2018-12-06 18:00:09 +01:00
parent 0db69138a7
commit 6a5b0c821e
10 changed files with 874 additions and 4 deletions
+22
View File
@@ -423,6 +423,25 @@ typedef struct oldoffice34
} oldoffice34_t;
typedef struct odf12_tmp
{
u32 ipad[5];
u32 opad[5];
u32 dgst[10];
u32 out[10];
} odf12_tmp_t;
typedef struct odf12
{
u32 iterations;
u32 iv[4];
u32 checksum[8];
u32 encrypted_data[256];
} odf12_t;
typedef struct pstoken
{
u32 salt_buf[128];
@@ -1149,6 +1168,7 @@ typedef enum hash_type
HASH_TYPE_WPA_PMKID_PMK = 69,
HASH_TYPE_ANSIBLE_VAULT = 70,
HASH_TYPE_KRB5ASREP = 71,
HASH_TYPE_ODF12 = 72,
} hash_type_t;
@@ -1376,6 +1396,7 @@ typedef enum kern_type
KERN_TYPE_TOTP_HMACSHA1 = 18100,
KERN_TYPE_KRB5ASREP = 18200,
KERN_TYPE_APFS = 18300,
KERN_TYPE_ODF12 = 18400,
KERN_TYPE_PLAINTEXT = 99999,
} kern_type_t;
@@ -1419,6 +1440,7 @@ typedef enum rounds_count
ROUNDS_OFFICE2007 = 50000,
ROUNDS_OFFICE2010 = 100000,
ROUNDS_OFFICE2013 = 100000,
ROUNDS_LIBREOFFICE = 100000,
ROUNDS_DJANGOPBKDF2 = 20000,
ROUNDS_SAPH_SHA1 = 1024,
ROUNDS_PDF14 = (50 + 20),