[GH-ISSUE #2812] JtR too restrictive when verifying encoded UTF-16 files #1802

Closed
opened 2026-10-15 04:24:47 +07:00 by bsakaguchi · 10 comments
Owner

Originally created by @ghost on GitHub (Oct 11, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2812

Since 0ce265dcff, JtR is refusing to load a 8bit wordlist. Well, at least all tools I used detected the wordlist as: ascii/unknown, unknown-8bit or iso8859-1.

To see the issue in action (tested on well), just

./jtrts.pl -noprelims -type MSSql
Originally created by @ghost on GitHub (Oct 11, 2017). Original GitHub issue: https://github.com/openwall/john/issues/2812 Since 0ce265dcffff41864143e3bc48de539b4c62649f, JtR is refusing to load a 8bit wordlist. Well, at least all tools I used detected the wordlist as: ascii/unknown, unknown-8bit or iso8859-1. To see the issue in action (tested on *well*), just ``` ./jtrts.pl -noprelims -type MSSql ```
bsakaguchi 2026-10-15 04:24:47 +07:00
  • closed this issue
  • added the
    invalid
    label
Author
Owner

@magnumripper commented on GitHub (Oct 11, 2017):

Not sure how @jfoug ended up with the crazy idea to hash a UTF-16 BOM and even depend on it, but this is a TS issue and not a JtR one (unless you show me a real-world case where this is a problem *).

I dropped the stupid lines from the dictionaries but now we end up with some formats "failing" due to only cracking 1499 out of 1500. This is just stupid, I don't have time to fix it right now. But again, it's a TS issue.

*) If you do find such case, we could drop the check when using --encoding=raw or any codepage that might actually use these byte sequences for valid 8-bit data (in case such a codepage exist), but that's about as far as I'm willing to go and it wouldn't solve the TS problem anyway.

<!-- gh-comment-id:335957846 --> @magnumripper commented on GitHub (Oct 11, 2017): Not sure how @jfoug ended up with the crazy idea to hash a UTF-16 BOM and even depend on it, but this is a TS issue and not a JtR one (unless you show me a real-world case where this is a problem *). I dropped the stupid lines from the dictionaries but now we end up with some formats "failing" due to only cracking 1499 out of 1500. This is just stupid, I don't have time to fix it right now. But again, it's a TS issue. *) If you do find such case, we could drop the check when using `--encoding=raw` or any codepage that might actually use these byte sequences for valid 8-bit data (in case such a codepage exist), but that's about as far as I'm willing to go and it wouldn't solve the TS problem anyway.
Author
Owner

@magnumripper commented on GitHub (Oct 12, 2017):

OK, after some research I changed my mind. I will probably need to revert to only do this check when input encoding is UTF-8. Perhaps still checking the very first line for other codepages though.

BTW the rationale for checking for BOM's on all lines is that user may have concatenated several files, where one or some of them were UTF-16 by mistake. I've seen it happen, I've heard it happen.

<!-- gh-comment-id:335983173 --> @magnumripper commented on GitHub (Oct 12, 2017): OK, after some research I changed my mind. I will probably need to revert to only do this check when input encoding is UTF-8. Perhaps still checking the very first line for other codepages though. BTW the rationale for checking for BOM's on *all* lines is that user may have concatenated several files, where one or some of them were UTF-16 by mistake. I've seen it happen, I've heard it happen.
Author
Owner

@bill-e-ghote commented on GitHub (Oct 12, 2017):

Thanks for reverting this. 'twas puking on crackstation.txt, even.

<!-- gh-comment-id:335996875 --> @bill-e-ghote commented on GitHub (Oct 12, 2017): Thanks for reverting this. 'twas puking on crackstation.txt, even.
Author
Owner

@magnumripper commented on GitHub (Oct 12, 2017):

@bill-e-ghote well, it should... I had a look now - crackstation.txt contains UTF-16 garbage which is precisely what we wanted to detect because all such data is 100% unusable for any format and any crack mode.

That wordlist is by far the very lowest quality I've ever seen. The size of it is a good hint.

Nonetheless, I now relaxed things even further - we now just warn instead of bailing out. That's only for UTF-16 in wordlists though - we still refuse to read any input file containing a UTF-16 BOM.

<!-- gh-comment-id:336195810 --> @magnumripper commented on GitHub (Oct 12, 2017): @bill-e-ghote well, it should... I had a look now - crackstation.txt contains UTF-16 garbage which is precisely what we wanted to detect because all such data is 100% unusable for any format and any crack mode. That wordlist is by far the very lowest quality I've ever seen. The size of it is a good hint. Nonetheless, I now relaxed things even further - we now just warn instead of bailing out. That's only for UTF-16 in wordlists though - we still refuse to read any input file containing a UTF-16 BOM.
Author
Owner

@androidacy-user commented on GitHub (May 31, 2020):

Why the decision to completely not support utf-16? I have a zip file in utf-16 format that's encrypted, on Linux

Sorry to bump a super old issue but googling took me here

<!-- gh-comment-id:636407746 --> @androidacy-user commented on GitHub (May 31, 2020): Why the decision to completely not support utf-16? I have a zip file in utf-16 format that's encrypted, on Linux Sorry to bump a super old issue but googling took me here
Author
Owner

@solardiz commented on GitHub (May 31, 2020):

On Sat, May 30, 2020 at 06:36:28PM -0700, Alexia wrote:

I have a zip file I'm utf-16 format that's encrypted

What do you mean by this, and what makes you think that's what you have?

<!-- gh-comment-id:636450273 --> @solardiz commented on GitHub (May 31, 2020): On Sat, May 30, 2020 at 06:36:28PM -0700, Alexia wrote: > I have a zip file I'm utf-16 format that's encrypted What do you mean by this, and what makes you think that's what you have?
Author
Owner

@androidacy-user commented on GitHub (May 31, 2020):

On Sat, May 30, 2020 at 06:36:28PM -0700, Alexia wrote: I have a zip file I'm utf-16 format that's encrypted
What do you mean by this, and what makes you think that's what you have?

Jtr bails out saying something about having a utf-16 BOM

<!-- gh-comment-id:636468947 --> @androidacy-user commented on GitHub (May 31, 2020): > On Sat, May 30, 2020 at 06:36:28PM -0700, Alexia wrote: I have a zip file I'm utf-16 format that's encrypted > What do you mean by this, and what makes you think that's what you have? Jtr bails out saying something about having a utf-16 BOM
Author
Owner

@solardiz commented on GitHub (May 31, 2020):

On Sun, May 31, 2020 at 06:05:37AM -0700, Alexia wrote:

Jtr bails out saying something about having a utf-16 BOM

This almost always means that you're invoking it incorrectly, not that you need UTF-16 support.

<!-- gh-comment-id:636511916 --> @solardiz commented on GitHub (May 31, 2020): On Sun, May 31, 2020 at 06:05:37AM -0700, Alexia wrote: > Jtr bails out saying something about having a utf-16 BOM This almost always means that you're invoking it incorrectly, _not_ that you need UTF-16 support.
Author
Owner

@ghost commented on GitHub (May 31, 2020):

This almost always means that you're invoking it incorrectly, not that you need UTF-16 support.

@linuxandria, please post the command line you are using.

We need to be sure you are running the zip2john filename.zip and NOT john ZIPFILE

<!-- gh-comment-id:636512325 --> @ghost commented on GitHub (May 31, 2020): > This almost always means that you're invoking it incorrectly, _not_ that you need UTF-16 support. @linuxandria, please post the command line you are using. We need to be sure you are running the `zip2john filename.zip` and NOT _john ZIPFILE_
Author
Owner

@androidacy-user commented on GitHub (May 31, 2020):

This almost always means that you're invoking it incorrectly, not that you need UTF-16 support.

@linuxandria, please post the command line you are using.

We need to be sure you are running the zip2john filename.zip and NOT john ZIPFILE

Oof lol I was doing that
Had to cd into source/run to even do that bc make install didn't do its thing but that's a different issue

<!-- gh-comment-id:636544217 --> @androidacy-user commented on GitHub (May 31, 2020): > > This almost always means that you're invoking it incorrectly, _not_ that you need UTF-16 support. > > @linuxandria, please post the command line you are using. > > We need to be sure you are running the `zip2john filename.zip` and NOT _john ZIPFILE_ Oof lol I was doing that Had to cd into source/run to even do that bc make install didn't do its thing but that's a different issue
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#1802
No description provided.