diff --git a/run/office2john.py b/run/office2john.py index 9928d6183..f8ae43069 100755 --- a/run/office2john.py +++ b/run/office2john.py @@ -2518,13 +2518,13 @@ def find_rc4_passinfo_doc(filename, stream): headerLength -= 4 unpack("cracked, 1); } else { key[0] = sha1[0]; - if (cs->type == 3) { + if (cs->type == 3) { /* Truncate to 40 bits */ key[1] = sha1[1] & 0xff; key[2] = 0; key[3] = 0; + } else if (cs->type == 5) { /* Truncate to 56 bits */ + key[1] = sha1[1] & 0xffffff; + key[2] = 0; + key[3] = 0; } else { key[1] = sha1[1]; key[2] = SWAP32(sha1[2]); diff --git a/src/oldoffice_common_plug.c b/src/oldoffice_common_plug.c index c66e6639d..79e03ebe1 100644 --- a/src/oldoffice_common_plug.c +++ b/src/oldoffice_common_plug.c @@ -75,7 +75,7 @@ int oldoffice_valid(char *ciphertext, struct fmt_main *self) if (!(ptr = strtokm(ctcopy, "*"))) /* type */ goto error; type = atoi(ptr); - if (type < 0 || type > 4) + if (type < 0 || type > 5) goto error; if (!(ptr = strtokm(NULL, "*"))) /* salt */ goto error; diff --git a/src/oldoffice_fmt_plug.c b/src/oldoffice_fmt_plug.c index 6011ca06e..dfb22da8e 100644 --- a/src/oldoffice_fmt_plug.c +++ b/src/oldoffice_fmt_plug.c @@ -130,6 +130,10 @@ static int crypt_all(int *pcount, struct db_salt *salt) if (oo_cur_salt->type < 4) { memcpy(mitm_key[index], key_hash, 5); memset(&mitm_key[index][5], 0, 11); // Truncate to 40 bits + } else + if (oo_cur_salt->type == 5) { + memcpy(mitm_key[index], key_hash, 7); + memset(&mitm_key[index][7], 0, 9); // Truncate to 56 bits } else memcpy(mitm_key[index], key_hash, 16); diff --git a/src/opencl_oldoffice_fmt_plug.c b/src/opencl_oldoffice_fmt_plug.c index 9cab09c68..fd38bb9ee 100644 --- a/src/opencl_oldoffice_fmt_plug.c +++ b/src/opencl_oldoffice_fmt_plug.c @@ -363,7 +363,7 @@ static int valid(char *ciphertext, struct fmt_main *self) if (!(ptr = strtokm(ctcopy, "*"))) /* type */ goto error; type = atoi(ptr); - if (type < 0 || type > 4) + if (type < 0 || type > 5) goto error; if (!(ptr = strtokm(NULL, "*"))) /* salt */ goto error;