mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #761] pdf2john.py does not extract pdf document with locked printing #396
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#396
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 @martiGIT on GitHub (Sep 25, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/761
While extracting password from pdf file with locked printing (only), hash is extracted, but cracking results with empty password (I assume that password hash is taken only form file lock, which in fact is empty). No option to extract printing password.
@magnumripper commented on GitHub (Oct 3, 2014):
Could you by any chance submit a pdf file which has this problem? Obviously we could produce that ourselves but it would likely speed up the handling of this issue.
http://openwall.info/wiki/john/sample-non-hashes?&#PDF would be a good place.
@kholia commented on GitHub (Oct 4, 2014):
@magnumripper sometimes, I feel like bringing the old
pdf2john.plback again. I am curious how it handles such files.@martiGIT it would be awesome to have a sample problematic .pdf file.
@magnumripper commented on GitHub (Oct 4, 2014):
I can't find any pdf2john.pl in history but we had src/pdf2john.c in
96e20a31^@kholia commented on GitHub (Oct 4, 2014):
My bad. I was thinking about the https://github.com/kholia/npdf2john project.
@martiGIT commented on GitHub (Oct 4, 2014):
@magnumripper I does not have upload access to wiki page, so here is a link:
http://m.zyy.pl/f/0956b2311069c11e13972591a13a9667.pdf
@magnumripper commented on GitHub (Oct 4, 2014):
Thanks. So @kholia could you take a look at this?
@magnumripper commented on GitHub (Oct 4, 2014):
Hmm or perhaps @ShaneQful ?
@kholia commented on GitHub (Oct 4, 2014):
@martiGIT @magnumripper I can print that .pdf file with no problems (using evince).
https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt might come in handy while debugging this problem.
@martiGIT commented on GitHub (Oct 5, 2014):
@kholia @magnumripper right, this "permission" does not work with linux, I know, that if somebody want to print "print secured" document, there is an easy way to cheat it, but acrobat reader still won't permit printing.
@ShaneQful commented on GitHub (Oct 5, 2014):
I can have a look at it after work tomorrow, if you'd like ... been meaning to try help out again anyway
@martiGIT commented on GitHub (Oct 6, 2014):
@kholia great source.
As I marked, print permission is only a flag, which is respected by Adobe Acrobat (also Reader) (and other software as e.g. Finereader). If it is hard to extract this hash, we don't have to reinvent the wheel. The simplest way to remove this flag is to reprint (like print to pdf), or resave this kind of document in software that does not check additional permissions.
@kholia commented on GitHub (Oct 6, 2014):
@martiGIT @magnumripper The old pdf2john.c had a flag to extract such hashes, IIRC. I haven't looked at it in a while though.
@ShaneQful commented on GitHub (Oct 6, 2014):
No joy yet, although did find an issue with the last commit on this file not testing against the sample non hashes
github.com/magnumripper/JohnTheRipper@292b35c90f@magnumripper commented on GitHub (Oct 7, 2014):
Separate issue for that in #789 just ftr
@kholia commented on GitHub (Dec 8, 2014):
I don't think that this issue is important enough to block the release of
1.8.0-jumbo1.Can we please move this to the next milestone?
@ShaneQful commented on GitHub (Feb 21, 2015):
So after having a little look at the issue, the older pdf2john.c could do this but only for really old versions of the pdf spec. In order to do this properly for all versions, the algorithms for generating the owner password have to be implemented. Unfortunately we can't just take these from other open source projects as most don't bother to implent them as it's kinda pointless DRM that only works if you open the pdf in an adobe product.
Essentially the fix is to implement the algorithms for the owner password described here : http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf
And to add a flag in the to say which password you want.
Going to remove myself as assignee as work is a bit hectic at the moment and I don't have the time to work on this, apologies.
@kholia commented on GitHub (Mar 28, 2016):
@ShaneQful thanks for all the research on this topic!
I agree that it seems to be pretty pointless to implement this, the reporter can simply use "Sumatra PDF reader" to bypass owner password restrictions. Should we just close this ticket?
@ShaneQful commented on GitHub (Mar 28, 2016):
Yeah I think we can close it. I don't think any other pdf viewer other than adobe's even bothers to check the field. If one of the open source pdf viewers start to do this check we can always take their code once it's implemented.