[GH-ISSUE #736] Implement Office ("oldoffice" format) meet-in-the-middle #376

Closed
opened 2026-10-14 03:03:40 +07:00 by bsakaguchi · 9 comments
Owner

Originally created by @magnumripper on GitHub (Sep 9, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/736

Originally assigned to: @magnumripper on GitHub.

This just in:
http://hashcat.net/forum/thread-3665.html

Originally created by @magnumripper on GitHub (Sep 9, 2014). Original GitHub issue: https://github.com/openwall/john/issues/736 Originally assigned to: @magnumripper on GitHub. This just in: http://hashcat.net/forum/thread-3665.html
bsakaguchi 2026-10-14 03:03:40 +07:00
Author
Owner

@magnumripper commented on GitHub (Sep 9, 2014):

Done. We don't have a tool for finding the middle value yet, but we can use hashes including it, as found by oclHashcat (use a * as separator).

Actually the bottom line of all this is that this format is really FMT_NOT_EXACT and we'll find some matching password in 2^39 tries on average. That's about 75 hours (4 cores) even without using meet-in-the-middle or GPU. So I won't bother writing a "mitm finder" - it's sort of out of scope for JtR anyway.

<!-- gh-comment-id:55018010 --> @magnumripper commented on GitHub (Sep 9, 2014): Done. We don't have a tool for finding the middle value yet, but we can use hashes including it, as found by oclHashcat (use a `*` as separator). Actually the bottom line of all this is that this format is really FMT_NOT_EXACT and we'll find _some_ matching password in 2^39 tries on average. That's about 75 hours (4 cores) even without using meet-in-the-middle or GPU. So I won't bother writing a "mitm finder" - it's sort of out of scope for JtR anyway.
Author
Owner

@jfoug commented on GitHub (Sep 9, 2014):

It would not be that hard to do in JtR, but I am not 100% sure how much time it would save. Simply 2 formats (like LM and NT). First finds the internal key needed (the 40 bits), 2nd finds the key that generates those 40 bits.

<!-- gh-comment-id:55044212 --> @jfoug commented on GitHub (Sep 9, 2014): It would not be that hard to do in JtR, but I am not 100% sure how much time it would save. Simply 2 formats (like LM and NT). First finds the internal key needed (the 40 bits), 2nd finds the key that generates those 40 bits.
Author
Owner

@magnumripper commented on GitHub (Sep 9, 2014):

Like I just posted on Hashcat forums, I see no point in this meet-in-the-middle unless you're running FMT_NOT_EXACT and want to see several working candidates for a given document (ie. trying to spot the real password). For just finding any candidate, it's not faster (it can even be slower).

As soon as you start looking for candidate #2, it's a win. But that also means you could run normally until you find the first candidate - and then you do know the mitm hash for subsequent ones and can run in 2x speed for alternative ones.

<!-- gh-comment-id:55044594 --> @magnumripper commented on GitHub (Sep 9, 2014): Like I just posted on Hashcat forums, I see no point in this meet-in-the-middle unless you're running FMT_NOT_EXACT and want to see several working candidates for a given document (ie. trying to spot the real password). For just finding any candidate, it's not faster (it can even be slower). As soon as you start looking for candidate #2, it's a win. But that also means you could run normally until you find the first candidate - and then you **do** know the mitm hash for subsequent ones and can run in 2x speed for alternative ones.
Author
Owner

@magnumripper commented on GitHub (Sep 9, 2014):

As soon as you start looking for candidate #2, it's a win. But that also means you could run normally until you find the first candidate - and then you do know the mitm hash for subsequent ones and can run in 2x speed for alternative ones.

This might mean we could use another option. This format should (IMHO) not be FMT_NOT_EXACT unless you tell it to. So we could add a core option for flipping that flag, or we could write an alternative oldoffice format that is (always) FMT_NOT_EXACT but otherwise identical.

<!-- gh-comment-id:55045071 --> @magnumripper commented on GitHub (Sep 9, 2014): > As soon as you start looking for candidate #2, it's a win. But that also means you could run normally until you find the first candidate - and then you do know the mitm hash for subsequent ones and can run in 2x speed for alternative ones. This might mean we could use another option. This format should (IMHO) not be FMT_NOT_EXACT unless you tell it to. So we could add a core option for flipping that flag, or we could write an alternative oldoffice format that is (always) FMT_NOT_EXACT but otherwise identical.
Author
Owner

@magnumripper commented on GitHub (Sep 21, 2014):

I will try this out.

<!-- gh-comment-id:56285028 --> @magnumripper commented on GitHub (Sep 21, 2014): I will try this out.
Author
Owner

@magnumripper commented on GitHub (Sep 21, 2014):

This --keep-guessing option can also be used for testing or debugging any format, instead of deleting or trimming john.pot all the time before re-testing things.

<!-- gh-comment-id:56285234 --> @magnumripper commented on GitHub (Sep 21, 2014): This --keep-guessing option can also be used for testing or debugging any format, instead of deleting or trimming john.pot all the time before re-testing things.
Author
Owner

@magnumripper commented on GitHub (Sep 21, 2014):

1ccdb9e9 adds the --keep-guessing option.
9b45e825 adds basic logic for keeping the meet-in-the-middle value when --keep-guessing is in use.

To do:

  • Add a source() function that fills in the MITM value, so we get it in the .pot file.
  • If possible, pull the MITM value in from the .pot file at a resume. That might be too intrusive to core code though.
<!-- gh-comment-id:56314769 --> @magnumripper commented on GitHub (Sep 21, 2014): 1ccdb9e9 adds the --keep-guessing option. 9b45e825 adds basic logic for keeping the meet-in-the-middle value when --keep-guessing is in use. To do: - [x] Add a source() function that fills in the MITM value, so we get it in the .pot file. - [ ] If possible, pull the MITM value in from the .pot file at a resume. That might be too intrusive to core code though.
Author
Owner

@magnumripper commented on GitHub (Sep 23, 2014):

67ffc29 adds a source() that fills in the intermediate key for future use. It's disabled for now, we need a core change (#752) for dynamic salt [compare] size. Otherwise --show will not recognize the hash.

<!-- gh-comment-id:56462949 --> @magnumripper commented on GitHub (Sep 23, 2014): 67ffc29 adds a source() that fills in the intermediate key for future use. It's disabled for now, we need a core change (#752) for dynamic salt [compare] size. Otherwise --show will not recognize the hash.
Author
Owner

@magnumripper commented on GitHub (Sep 23, 2014):

Note to self: I need to revert set_salt() to just copy the pointer because we actually have to change core's salt buffer when we find a meet-in-the-middle value. Otherwise it will be lost when running with more than one salt loaded.

<!-- gh-comment-id:56464589 --> @magnumripper commented on GitHub (Sep 23, 2014): Note to self: I need to revert set_salt() to just copy the pointer because we actually have to change core's salt buffer when we find a meet-in-the-middle value. Otherwise it will be lost when running with more than one salt loaded.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#376
No description provided.