[GH-ISSUE #2782] pdf2john hash issue #1786

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

Originally created by @cardassian-tailor on GitHub (Sep 25, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2782

Originally assigned to: @kholia on GitHub.

Hoping to chat with magnum about this.

I was working with a pdf, opening in notepad ++ shows it was pdf version 1.4. 10500.
I was able to extract the hash but i continued to get length exception errors in hashcat. The hash I received was not the proper length according to the example hashes listed on hashcat wiki.

I tried all pdf types for the -m in hashcat (10400 - 10700).

The password was recoverable however with a commercial password recovery tool.

I was using the newest version of pdf2john.pl program.

Originally created by @cardassian-tailor on GitHub (Sep 25, 2017). Original GitHub issue: https://github.com/openwall/john/issues/2782 Originally assigned to: @kholia on GitHub. Hoping to chat with magnum about this. I was working with a pdf, opening in notepad ++ shows it was pdf version 1.4. 10500. I was able to extract the hash but i continued to get length exception errors in hashcat. The hash I received was not the proper length according to the example hashes listed on hashcat wiki. I tried all pdf types for the -m in hashcat (10400 - 10700). The password was recoverable however with a commercial password recovery tool. I was using the newest version of pdf2john.pl program.
bsakaguchi 2026-10-15 04:24:28 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@cardassian-tailor commented on GitHub (Sep 25, 2017):

Extracted hash,

$pdf$1*2*40*-4*1*36*65623237393831382d636439372d343130332d613835372d343164303037316639386134*32*c7230519f7db63ab1676fa30686428f0f997932bf831f1c1dcfa48cfb3b7fe99*32*161cd2f7c95283ca9db930b36aad3571ee6f5fb5632f30dc790e19c5069c86b8

<!-- gh-comment-id:331750265 --> @cardassian-tailor commented on GitHub (Sep 25, 2017): Extracted hash, `$pdf$1*2*40*-4*1*36*65623237393831382d636439372d343130332d613835372d343164303037316639386134*32*c7230519f7db63ab1676fa30686428f0f997932bf831f1c1dcfa48cfb3b7fe99*32*161cd2f7c95283ca9db930b36aad3571ee6f5fb5632f30dc790e19c5069c86b8`
Author
Owner

@kholia commented on GitHub (Sep 25, 2017):

Debugging this issue will require access to the original (or equivalent) PDF file. Please send a copy of the file to me and @magnumripper.

<!-- gh-comment-id:331770633 --> @kholia commented on GitHub (Sep 25, 2017): Debugging this issue will require access to the original (or equivalent) PDF file. Please send a copy of the file to me and @magnumripper.
Author
Owner

@magnumripper commented on GitHub (Sep 25, 2017):

Hoping to chat with magnum about this.

@kholia is a better choice, he wrote it!

<!-- gh-comment-id:331799035 --> @magnumripper commented on GitHub (Sep 25, 2017): > Hoping to chat with magnum about this. @kholia is a better choice, he wrote it!
Author
Owner

@kholia commented on GitHub (Sep 25, 2017):

I didn't write it. I can't read and write Perl. I just added some "printf" calls at the right locations in ExifTool program :-)

It seems that we need to add some error handling instead of generating broken output hashes. It seems that Perl keep running even if errors occur in the execution of the program.

<!-- gh-comment-id:331799954 --> @kholia commented on GitHub (Sep 25, 2017): I didn't write it. I can't read and write Perl. I just added some "printf" calls at the right locations in ExifTool program :-) It seems that we need to add some error handling instead of generating broken output hashes. It seems that Perl keep running even if errors occur in the execution of the program.
Author
Owner

@kholia commented on GitHub (Sep 25, 2017):

@oscalation Which commercial password recovery tool was able to parse this PDF file? I am curious.

<!-- gh-comment-id:331800846 --> @kholia commented on GitHub (Sep 25, 2017): @oscalation Which commercial password recovery tool was able to parse this PDF file? I am curious.
Author
Owner

@cardassian-tailor commented on GitHub (Sep 25, 2017):

I can provide pdf - where and to whom shall I send it?

Elcomsoft PDF breaker and EDPR, both cracked it.

<!-- gh-comment-id:331894581 --> @cardassian-tailor commented on GitHub (Sep 25, 2017): I can provide pdf - where and to whom shall I send it? Elcomsoft PDF breaker and EDPR, both cracked it.
Author
Owner

@kholia commented on GitHub (Sep 25, 2017):

@oscalation Great! You may send the PDF along with the correct password (if possible) to dhiru.kholia [at] gmail.com. Thank you.

<!-- gh-comment-id:331895621 --> @kholia commented on GitHub (Sep 25, 2017): @oscalation Great! You may send the PDF along with the correct password (if possible) to `dhiru.kholia [at] gmail.com`. Thank you.
Author
Owner

@kholia commented on GitHub (Sep 26, 2017):

@oscalation Did you email the PDF file to me? I haven't received the file yet.

<!-- gh-comment-id:332160092 --> @kholia commented on GitHub (Sep 26, 2017): @oscalation Did you email the PDF file to me? I haven't received the file yet.
Author
Owner

@cardassian-tailor commented on GitHub (Sep 26, 2017):

Email with pdf file sent to @kholia.

<!-- gh-comment-id:332332348 --> @cardassian-tailor commented on GitHub (Sep 26, 2017): Email with pdf file sent to @kholia.
Author
Owner

@kholia commented on GitHub (Sep 27, 2017):

Thanks @oscalation. I was able to reproduce and solve the problem.

After applying the patch from PR https://github.com/magnumripper/JohnTheRipper/pull/2790,

$ ../run/john hash
Using default input encoding: UTF-8
Loaded 1 password hash (PDF [MD5 SHA2 RC4/AES 32/64])
Cost 1 (revision) is 2 for all loaded hashes
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
vision           (something.pdf)

The bug was present in the format, and not in the pdf2john.pl program.

<!-- gh-comment-id:332470567 --> @kholia commented on GitHub (Sep 27, 2017): Thanks @oscalation. I was able to reproduce and solve the problem. After applying the patch from PR https://github.com/magnumripper/JohnTheRipper/pull/2790, ``` $ ../run/john hash Using default input encoding: UTF-8 Loaded 1 password hash (PDF [MD5 SHA2 RC4/AES 32/64]) Cost 1 (revision) is 2 for all loaded hashes Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status vision (something.pdf) ``` The bug was present in the format, and not in the `pdf2john.pl` program.
Author
Owner

@kholia commented on GitHub (Sep 27, 2017):

PR #2790 has been merged. Hence, this bug can be closed now.

<!-- gh-comment-id:332508200 --> @kholia commented on GitHub (Sep 27, 2017): PR #2790 has been merged. Hence, this bug can be closed now.
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#1786
No description provided.