[GH-ISSUE #1569] pkzip format: Default to not use file magics. #1026

Closed
opened 2026-10-14 03:32:15 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @magnumripper on GitHub (Jul 21, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1569

We had a tricky problem on the ML and with a good portion of luck I could spot the problem: http://www.openwall.com/lists/john-users/2015/07/21/6

User had a file named john-1.8.0-jumbo-1.gz - but it wasn't gzipped at all, the extension lied. User zipped it with a password and ran zip2john on it to produce a test hash. zip2john decided to use the file magic for gz so user ended up with false negative (shrug)!

Since the Huffman checks are so excellent now, I think we should simply disable all use of file magics, at least by default.

Originally created by @magnumripper on GitHub (Jul 21, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1569 We had a tricky problem on the ML and with a good portion of luck I could spot the problem: http://www.openwall.com/lists/john-users/2015/07/21/6 User had a file named john-1.8.0-jumbo-1.gz - but it wasn't gzipped at all, the extension lied. User zipped it with a password and ran zip2john on it to produce a test hash. zip2john decided to use the file magic for gz so user ended up with false negative (shrug)! Since the Huffman checks are so excellent now, I think we should simply disable all use of file magics, at least by default.
bsakaguchi 2026-10-14 03:32:15 +07:00
Author
Owner

@magnumripper commented on GitHub (Jul 21, 2015):

I see a mere 1% speed drop (even though file is 30 MB)

<!-- gh-comment-id:123504295 --> @magnumripper commented on GitHub (Jul 21, 2015): I see a mere 1% speed drop (even though file is 30 MB)
Author
Owner

@jfoug commented on GitHub (Jul 21, 2015):

Sounds like all the tricky code for the 'magic' crap ended up being not that beneficial, with the latest other enhancements we had. Good thing. Sorry for the obscure bug.

<!-- gh-comment-id:123511400 --> @jfoug commented on GitHub (Jul 21, 2015): Sounds like all the tricky code for the 'magic' crap ended up being not that beneficial, with the latest other enhancements we had. Good thing. Sorry for the obscure bug.
Author
Owner

@magnumripper commented on GitHub (Jul 22, 2015):

I wouldn't want to drop the code though, it IS faster (especially for huge files) and sometimes you know you can use it.

<!-- gh-comment-id:123514877 --> @magnumripper commented on GitHub (Jul 22, 2015): I wouldn't want to drop the code though, it IS faster (especially for huge files) and sometimes you _know_ you can use it.
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#1026
No description provided.