mirror of
https://github.com/openwall/john.git
synced 2026-12-03 20:43:49 +07:00
[GH-ISSUE #1556] pdf2john.py doesn't extract the owner hash if the user password is null #1019
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#1019
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 @akhepcat on GitHub (Jul 13, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1556
Originally assigned to: @kholia on GitHub.
As you can see by this extract from pdfparse, there's no user password. But there is an owner password set. (the actual hash has been munged for safety)
obj 47918 0
Type:
Referencing:
<<
/CF
<<
/StdCF
<<
/AuthEvent /DocOpen
/CFM /AESV2
/Length 16
>>
>>
/Filter /Standard
/Length 128
/O '(\xc5\xff\xafBG<\x02j\x0fv$\xb3>r\x7fL\x9a\xf9\x94IT\xc5\xff\t\xfd7\xbc\xac\xf6\xc1^\xb2)'
/P -1340
/R 4
/StmF /StdCF
/StrF /StdCF
/U '("\x99\xa8v D\xb3\x96\x17\x8d@\x95\x03\xb9\x13Z\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00)'
/V 4
obj 48389 0
Type: /XRef
Referencing: 47918 0 R, 45900 0 R, 45902 0 R
Contains stream
<<
/DecodeParms
<<
/Columns 5
/Predictor 12
>>
/Encrypt 47918 0 R
/Filter /FlateDecode
/ID [<50F143EA493FF43B6045E2060A8519E2><13A4C0BE6360764EAD661371B32F8B80>]
/Info 45900 0 R
/Length 3768
/Root 45902 0 R
/Size 48390
/Type /XRef
/W [1 3 1]
pdf2john.py simply errors out that the file is not encrypted.
Oddly, if I copy the /O password bits into the /U position, it still reports the file as not encrypted.
the pdf-extract-owner.py (as linked elsewhere) take the /O field and format it into plain hex, but I don't know how to munge that into a proper hash format, especially without the /U field info - which I think are both used in the hash line?
@akhepcat commented on GitHub (Jul 13, 2015):
further edit - it SEEMS as if https://github.com/kholia/npdf2john is able to pull the password out.
i've yet to try it in john.
@kholia commented on GitHub (Mar 28, 2016):
Such a sample .pdf file can be found at,
http://www.novapdf.com/uploads/novapdf_en/media_items/pdf-example-encryption.original.pdf
JtR + npdf2john is easily able to crack this owner-password-protected PDF file.
@kholia commented on GitHub (Mar 28, 2016):
Well, JtR prints a blank password which might not be correct. See https://github.com/magnumripper/JohnTheRipper/issues/761 for details.
@kholia commented on GitHub (Mar 29, 2016):
#761 is now closed, hence closing this one too.