mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #275] zip2john produces infiles that can only be cracked with a same-endian build of John. #36
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#36
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 (Apr 18, 2013).
Original GitHub issue: https://github.com/openwall/john/issues/275
Some of the hex fields (integers) are in machine's endianness.
We need to test all xx2john programs for this issue, there are likely more of them.
@magnumripper commented on GitHub (Feb 16, 2014):
Note to self: How on earth is it that the format passes self-test on BE while the test vectors are in LE?!
Is my initial observation correct at all?
@kholia commented on GitHub (Nov 18, 2014):
@jfoug any ideas about this ticket?
@jfoug commented on GitHub (Nov 18, 2014):
The output should be in LE format. Ther is a function to get an LE uint32 and get and LE uint16, and the hash is expected to be in that format. If the zip2john is outputting the numbers in BE on a BE system, then there should be no jtr build that would crack it.
@jfoug commented on GitHub (Nov 18, 2014):
zip2john also uses fget32LE(fp); and fget16LE(fp); so I think it 'should' be right. I will do some hash making today, and check. It should get same hash on BE as on LE.
@magnumripper did you have a .zip file that was showing thus BE issue, or do all of them show this?
@magnumripper commented on GitHub (Nov 18, 2014):
I can't remember but I believe I did some BE tests with input files created on LE and nothing was cracked. Do we have zip in TS?
Hmm but how is this not a problem with the internal test vectors?
@jfoug commented on GitHub (Nov 18, 2014):
we have no zip in TS.
I have build zip 3.0 with encryption on my sparc. I created a pass.zip on the sparc side (compressing unix.o). I then created a pass-d.zip using command line pkzip25 (version 2.5 pkzip). Here are the dumps from a LE machine.
here is the zip2john dumps with zip2john from the BE side
@jfoug commented on GitHub (Nov 18, 2014):
I see no problem here? PEBCAK
@magnumripper commented on GitHub (Nov 18, 2014):
Well I do see a difference so if it's PEBCAK, you have a problem 😆
@magnumripper commented on GitHub (Nov 18, 2014):
Are you saying you did not diff them and could not see any difference?
First file has
*8*b*5041*in LE,*8*8*5041*in BE.Second file has
*8*d*5041*in LE,*8*a*5041*in BE.@magnumripper commented on GitHub (Nov 18, 2014):
Original thread on ML: http://www.openwall.com/lists/john-dev/2013/04/13/5
@jfoug commented on GitHub (Nov 18, 2014):
I was not looking at 1 byte items. How the hell would they be wrong?? Let me look at the code, find out what the byte is, and why it is broken on a BE build.
I was looking for endianity issue. a 1 byte (or partial byte), should not be.
@jfoug commented on GitHub (Nov 18, 2014):
This is the field:
DL Length of the DA data.Note, that the file names are different, so expect this length to be different (the embedded file name IS the DA data). If you look at the command line I used to build them, you will see the difference. My CWD was different between the 2 systems.
So that byte IS appropriate to be different. So again, this is back to what I asked before, PEBCAK ?
@magnumripper commented on GitHub (Nov 19, 2014):
Why are we storing length of terminated fields? Anyway I very much doubt it was a PEBCAK. I bet the bug was "unknowingly" fixed in
528e6bcor something.@magnumripper commented on GitHub (Nov 19, 2014):
BTW you should probably test a "winzip" file too. I'm not sure this was the pkzip format, it was more likely the zip aka winzip format. If winzip files are good now too, we can close this.
@frank-dittrich commented on GitHub (Nov 19, 2014):
On 11/19/2014 01:00 AM, magnum wrote:
I agree. Storing the same information twice isn't a good idea.
We have the same problem with LUKS, where the iteration count is stored
twice.
Do you silently drop hashes as invalid if the two places that should
contain the same information disagree?
Do you warn the user on stderr? Or just crash as LUKS does (assert ...)?
This only makes fuzzing (and thus trying to find bugs triggered by
"arbitrary" input) harder.
(BTW: LUKS has many other problems, see
https://github.com/magnumripper/JohnTheRipper/issues/557
(But LUKS can still be fixed before we finally release current
bleeding-jumbo code, because it isn't included in any released version,
so we wouldn't need to support the current hash representation and a
fixed one in the long run.)
@jfoug commented on GitHub (Nov 19, 2014):
Sorry, but I am not changing the zip signature (again).
Here is the run from a winzip file (128 and 256 bit aes)
Identical results on both sides. I made sure to run in same dir this time.