Open Aphex1979 opened 2 years ago
Unfortunately i cannot provide this PDF or recreate another one because it has sensitive data inside (it was created by my employer)
While that is totally understandable it makes it hard for anyone to look into this. Perhaps the file is damaged/truncated?
While that is totally understandable it makes it hard for anyone to look into this. Perhaps the file is damaged/truncated? I was able to open the PDF file now with the proper password provided by my employer. In the file properties in Acrobat i can see now the application which did create the pdf -> "L2001 PDF-Generator" Created with PDFlib+PDI 9.0.1 (C++/Linux-x86_64). I hope that helps.
For our formats, PDF 1.5 or 1.7 is less important but the "encryption version" (for lack of a better term) is /V 5
and /R 6
. Our formats currently only use the latter (so R 6) for picking algo.
Some stuff picked from above:
/ID [<DDB44FE6BEF1C7D4D6AF9A4109667235> <DDB44FE6BEF1C7D4D6AF9A4109667235>]
(...)
<< /Filter /Standard /V 5 /R 6 /Length 256 /P -1036 /U <E6781751CD886628E361A6B80B14D4278C3B65272F118D05933F27DCDB0047279FFB2545CE9EC93A284F9C9F1F62B884> /UE <35E287EBAF0ED0EB9998729B4E114017C6DC6C3EC4F47B23298F5F149619535C> /O <D57B595AE21A1EDB5314FFB20EE3632F3B9FBB72E03BACE179976E6FFF758B91673B773566CE63A8EAD403B5EB59837F> /OE <C5F52133A6A5A4F19814716D9CAD47B556C59C6EA25CAE0C32DE17565EA1722B> /CF 20 0 R /StmF /StdCF /StrF /StdCF /Perms <BC5E73CABE80FF8988B78C41A9D4E076> >>
I think the above is all that's needed to make up a hash that JtR and hashcat understands. Something like this:
$pdf$5*6*256*-1036*0*16*ddb44fe6bef1c7d4d6af9a4109667235*48*e6781751cd886628e361a6b80b14d4278c3b65272f118d05933f27dcdb0047279ffb2545ce9ec93a284f9c9f1f62b884*48*d57b595ae21a1edb5314ffb20ee3632f3b9fbb72e03bace179976e6fff758b91673b773566ce63a8ead403b5eb59837f
AFAICS I only guessed a single thing here: The
*0*
, which is a flag "encrypt_metadata". It could possibly be the zero in/CF 20 0 R
(I didn't try to check the docs for it) or maybe it's found elsewhere. Anyway that is either 1 or 0.
The question though, is why pdf2john.pl
couldn't parse it. @Aphex1979 did you ever try the alternative Python version pdf2john.py
? I would guess that one is newer than the Perl version.
I tried to extract the hash from a strongly encrypted PDF file to get the real password, because the provided password is not working. Therefore i setup Kali Linux yesterday and updated/upgraded it and did a fresh install of JohnTheRipper
git clone https://github.com/magnumripper/JohnTheRipper.git
The hash file generated has only the path and name to the pdf:
When i create an encrypted pdf via $ qpdf --encrypt abc123 abc123 256 -- sample.pdf sample_encrypted.pdf everything works fine.
I did some more investigations of the PDF file with pdfid and pdf-parser
(this is the only occurence of /Encrypt in this file)
/U /UE /O /OE => a lot of security
The header of the PDF (first 19 lines):
Another useful information could be the following output of qpdf:
Conclusion: The PDF version is 1.5. But it is using AES 265 encryption (/V 5 /R 6) according to qpdf-documentation this got introduced with PDF 1.7?
Unfortunately i cannot provide this PDF or recreate another one because it has sensitive data inside (it was created by my employer)
System information:
Should this PDF work with pdf2john.pl or is it planned to support it in the future?
If any other information is needed i'm glad to provide it here.