mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2607] MS Money format strips 8th bit #1701
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1701
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @magnumripper on GitHub (Jul 3, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2607
Originally assigned to: @magnumripper on GitHub.
From https://github.com/magnumripper/JohnTheRipper/pull/2603#discussion_r125364916 :
So what it does is use an "ANSI" code page, convert to upper and then strip 8th bit. We need to do so too, and I think that means we should set FMT_UTF8 but not FMT_8_BIT and also emit a warning if target encoding is UTF-8. I'll verify that and take care of this within the next days.
@magnumripper commented on GitHub (Jul 5, 2017):
@kholia it occured to me we need just a little more data to be sure we do this right. It's most likely either of these ways:
I'm assuming no. 1 but it could be no. 2 or something else. We need a test vector with some password that doesn't exist in CP1252, eg. "Я". Could you create that please? First, try creating such hash using your existing machine still using CP437/CP1252 and pasting the "Я" in the password dialog. Then reconfigure that OS to russian so it ends up using (I guess) CP866/CP1251 and re-create a hash again with same password verifying it's the same (if not, hand me both).
You don't need to find out what ASCII password/letter the hash(es) end up as after the 8th bit strip, I'll do that.
@kholia commented on GitHub (Jul 5, 2017):
@magnumripper The plan sounds excellent! I don't know if regular Windows XP with English language can be simply configured to use Russian as the language. I will give it a try though.
@kholia commented on GitHub (Jul 5, 2017):
@magnumripper Here are the results,
JtR cracking session,
The last two files use "Я" as the password (copy-pasted from notepad).
Update: The password transformation seems to be dependent on the code page.
@kholia commented on GitHub (Jul 5, 2017):
I think I made a mistake in creating the third file above!
Here are two new hashes from files created with password "Я" with Russian as the language in Windows XP.
They both yield "?" as the password which matches the
Weird-R-russian-character-with-CP437.mnyresult above.Update: I might still be doing something wrong. This stuff is very puzzling to me :-)
@kholia commented on GitHub (Jul 5, 2017):
This does not compute, chr(0xdc & 0x7f) is '\' and not '|'. However, chr(0xfc & 0x7f) is '|', where 0xfc is the hex code for 'ü' (small case).
Update:
So your choice of
ANSI codepage -> strip 8th bit -> UCS-2seems to be the right one.@magnumripper commented on GitHub (Jul 5, 2017):
Cool! I'll do some math again.
Oh, right. So that might mean only ASCII "a-z" are actually capitalized.
I wonder what happens if you use something like (normal CP1252) "€" as password. That's 0x80 so it would be 0x00 after stripping 8th bit. Or anything else from 0x81..0x9f - they will end up as control characters. On the other hand it doesn't matter much - get_key will report whatever original character we used and not a stripped one.
I have a version with the "ANSI codepage -> strip 8th bit -> UCS-2" ready to commit but I forgot it on a computer somewhere. Will push it later. Note to self: I still have to (probably) change it to only upper-case a-z.
@magnumripper commented on GitHub (Jul 10, 2017):
Hopefully all is set now.
@magnumripper commented on GitHub (Jul 10, 2017):
We'd need some further tests to be really sure. Current code assumes
ANSI codepage -> upper-case ASCII -> strip 8th bit -> UCS-2. However, it could also beANSI codepage -> strip 8th bit -> upper-case ASCII -> UCS-2and the difference is that some 8-bit character could become an ASCII lower-case letter after stripping, which would then have to be upper-cased.@magnumripper commented on GitHub (Jul 10, 2017):
OTOH, some cases of that is already in the test vectors, and does work. I'm just not sure that's universally the case.
@kholia commented on GitHub (Jul 10, 2017):
@magnumripper I can create more samples, if it helps. Just let me know the appropriate passwords to try.