mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2138] Byte Order Mark for UTF8 dictionary files fouls up first word #1428
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#1428
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 @crioux on GitHub (May 18, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2138
We aren't stripping off the byte order mark on utf-8 dictionary files, resulting in the first word of a wordlist attack not working right.
Here's a patch that fixes that from my jtrdll fork.
@magnumripper commented on GitHub (May 18, 2016):
Good point. I really hate UTF-8 BOMs, they are the worst idea ever. If a user concatenates several such files into one larger, there will be BOMs scattered all over so it wont suffice to just check the first line. But then it will harm performance even more 😢
@jfoug commented on GitHub (May 24, 2016):
The BOM logic should only check the first line (default), and then have a flag to check each line.
Yes, I know you hate BOM's, but for real files, they ARE the best thing there is, especially when you get to unicode/UTF8 (or other binaries) encoding, and BE vs LE systems. It is the user the concats these files that is the problem. WOrst thing would be to concat files generated by BE and LE into 1 file. In that case, we really would need to read the BOM's, and handle the endianity ourselves within each section of the input file. Yup, ugly, but it is the user doing this (or whatever fool simply cat'd the files in the first place).
@crioux commented on GitHub (May 24, 2016):
Yea, the only thing i'm handling with this right now is utf-8, with which there is no BE or LE issues, only one BOM. I don't think our wordlist code could deal with utf-16 or 32 anyway at this point, BOM or not.
And yea, concatenating the wrong way without respecting the BOM is bad form, but to a certain extent, not worrying about that is reasonable, as that would be an 'invalid' file format anyway. JtR should be able to handle the 'valid' utf-8 files for certain, which is what this patch is about.