Extract PDF hash (edit passwd) - Printable Version +- hashcat Forum (https://hashcat.net/forum) +-- Forum: Support (https://hashcat.net/forum/forum-3.html) +--- Forum: hashcat (https://hashcat.net/forum/forum-45.html) +--- Thread: Extract PDF hash (edit passwd) (/thread-6233.html) Pages:
1
2
|
Extract PDF hash (edit passwd) - eneru - 01-25-2017 Hello guys, I need to recover "edit password" from a PDF file. How can I extract "edit password" hash? Thank you! RE: Extract PDF hash (edit passwd) - kiara - 01-25-2017 did u try pdf2john? https://github.com/magnumripper/JohnTheRipper/blob/unstable-jumbo/run/pdf2john.py RE: Extract PDF hash (edit passwd) - eneru - 01-25-2017 Yes, but I get: «AttributeError: 'str' object has no attribute 'decode'». It works with "read password" only, I need to extract "owner password" hash. RE: Extract PDF hash (edit passwd) - Xanadrel - 01-25-2017 Look up Click Wiki Click FAQ CTRL+F Type "PDF" ... Boy that was difficult. RE: Extract PDF hash (edit passwd) - eneru - 01-25-2017 (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*34d5f6a6a8766b703d03a9ed1a8e3565f5cd34a85a506332737a70fb429e2bf6 This is empty (this file doesn't have open password). I need to extract the hash of "edit password". RE: Extract PDF hash (edit passwd) - epixoip - 01-25-2017 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. RE: Extract PDF hash (edit passwd) - eneru - 01-25-2017 (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! RE: Extract PDF hash (edit passwd) - eneru - 01-25-2017 Code: $ ./pdfcrack.exe -f ... EDIT: Hashcat can't crack this password. Pdfcrack can do it, but much slower... RE: Extract PDF hash (edit passwd) - epixoip - 01-26-2017 As I said above, Hashcat only supports encrypted PDFs. It does not support cracking edit passwords. RE: Extract PDF hash (edit passwd) - philsmd - 01-26-2017 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.cl you 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*842103b0a0dc886db9223b94afe2d7cd63389079b61986a4fcf70095ad630c24 Code: $pdf$2*3*128*-3904*1*0*631ed33746e50fba5caf56bcc39e09c6*32*842103b0a0dc886db9223b94afe2d7cd63389079b61986a4fcf70095ad630c24*32*5f9d0e4f0b39835dace0d306c40cd6b700000000000000000000000000000000 or Code: $pdf$4*4*128*-1084*1*16*51765003ed0e2944a8991e710ec8aaa1*32*6554d929ab86fdd40a078d4e8cefb0ea2e0000000000000059028800188f3b00*32*34d5f6a6a8766b703d03a9ed1a8e3565f5cd34a85a506332737a70fb429e2bf6 Code: $pdf$4*4*128*-1084*1*16*51765003ed0e2944a8991e710ec8aaa1*32*34d5f6a6a8766b703d03a9ed1a8e3565f5cd34a85a506332737a70fb429e2bf6*32*6554d929ab86fdd40a078d4e8cefb0ea2e0000000000000059028800188f3b00 Example run: Code: ./hashcat -m 10500 '$pdf$2*3*128*-3904*1*16*631ed33746e50fba5caf56bcc39e09c6*32*842103b0a0dc886db9223b94afe2d7cd63389079b61986a4fcf70095ad630c24*32*5f9d0e4f0b39835dace0d306c40cd6b700000000000000000000000000000000' dict.txt I 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 |