01-25-2017, 05:28 PM
Hello guys, I need to recover "edit password" from a PDF file. How can I extract "edit password" hash? Thank you!
|
Extract PDF hash (edit passwd)
|
|
01-25-2017, 05:28 PM
Hello guys, I need to recover "edit password" from a PDF file. How can I extract "edit password" hash? Thank you!
01-25-2017, 07:08 PM
Yes, but I get: «AttributeError: 'str' object has no attribute 'decode'». It works with "read password" only, I need to extract "owner password" hash.
01-25-2017, 07:46 PM
Look up
Click Wiki Click FAQ CTRL+F Type "PDF" ... Boy that was difficult. (01-25-2017, 07:08 PM)kiara Wrote: did u try (01-25-2017, 07:46 PM)Xanadrel Wrote: Look upThanks... I get this: Code: $pdf$4*4*128*-1084*1*16*51765003ed0e2944a8991e710ec8aaa1*32*6554d929ab86fdd40a078d4e8cefb0ea2e0000000000000059028800188f3b00*32*34d5f6a6a8766b703d03a9ed1a8e3565f5cd34a85a506332737a70fb429e2bf6This is empty (this file doesn't have open password). I need to extract the hash of "edit password".
01-25-2017, 09:41 PM
Hashcat only supports cracking encrypted PDFs. Usually when only an edit password is applied, the document is not encrypted. You can use one of many freely-available tools to simply strip out the edit password entirely without cracking it.
01-25-2017, 09:46 PM
(01-25-2017, 09:41 PM)epixoip Wrote: Hashcat only supports cracking encrypted PDFs. Usually when only an edit password is applied, the document is not encrypted. You can use one of many freely-available tools to simply strip out the edit password entirely without cracking it. Hi epixoip, I know this, but I need to recover the password. Thanks anyway! Code: $ ./pdfcrack.exe -f ...EDIT: Hashcat can't crack this password. Pdfcrack can do it, but much slower...
01-26-2017, 03:16 AM
As I said above, Hashcat only supports encrypted PDFs. It does not support cracking edit passwords.
It seems that the differences between the algorithms used for checking the owner password (- editing - permissions) compared to the user password (password to open the file aka encrypted PDFs) at least for rev 3 (PDF 1.4 - 1.6 (Acrobat 5 - 8)) is very little:
the difference is just the input (length) to the first MD5 and what is used for the rc4 key. Here is a diff of the -m 10500 kernel (the file is [hashcat_root]/OpenCL/m10500.cl): Code: diff --git a/OpenCL/m10500.cl b/OpenCL/m10500.clyou can play with it by just using "git apply a.patch" and removing the cached kernels (rm -r [hashcat_root]/kernels). The only changes you need to do with the "hash" itself is to swap the user and owner part (i.e. swap the 2 last fields with the 2 second to last fields), e.g.: Code: $pdf$2*3*128*-3904*1*16*631ed33746e50fba5caf56bcc39e09c6*32*5f9d0e4f0b39835dace0d306c40cd6b700000000000000000000000000000000*32*842103b0a0dc886db9223b94afe2d7cd63389079b61986a4fcf70095ad630c24Code: $pdf$2*3*128*-3904*1*0*631ed33746e50fba5caf56bcc39e09c6*32*842103b0a0dc886db9223b94afe2d7cd63389079b61986a4fcf70095ad630c24*32*5f9d0e4f0b39835dace0d306c40cd6b700000000000000000000000000000000or Code: $pdf$4*4*128*-1084*1*16*51765003ed0e2944a8991e710ec8aaa1*32*6554d929ab86fdd40a078d4e8cefb0ea2e0000000000000059028800188f3b00*32*34d5f6a6a8766b703d03a9ed1a8e3565f5cd34a85a506332737a70fb429e2bf6Code: $pdf$4*4*128*-1084*1*16*51765003ed0e2944a8991e710ec8aaa1*32*34d5f6a6a8766b703d03a9ed1a8e3565f5cd34a85a506332737a70fb429e2bf6*32*6554d929ab86fdd40a078d4e8cefb0ea2e0000000000000059028800188f3b00Example run: Code: ./hashcat -m 10500 '$pdf$2*3*128*-3904*1*16*631ed33746e50fba5caf56bcc39e09c6*32*842103b0a0dc886db9223b94afe2d7cd63389079b61986a4fcf70095ad630c24*32*5f9d0e4f0b39835dace0d306c40cd6b700000000000000000000000000000000' dict.txtI just think that support for this type of password recovery is just not demanded enough. Most users just workaround the permissions, without even caring what the password is. But of course for some forensic use cases it could be sometimes nice to get the password that was originally used to produce the PDF file. The file used for analysis: http://www.filedropper.com/pdfownerpassonly |
|
« Next Oldest | Next Newest »
|