mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2616] GPG symmetric encryption and gpg2john parsing problems #1707
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#1707
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 @kholia on GitHub (Jul 7, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2616
Setup
OK cases
Not OK
GPG files lacking MDC seem to be run into parsing problems.
If the size and contents of "large" file are varied, gpg2john runs into multiple different problems. These
gpg2johnerror message can also change for different runs ofgpgon the same input file.For other files, the following error message is shown by
gpg2john,Note: Cracking of symmetrically encrypted files lacking MDC is currently not practically possible due to too many false positives involved. See https://github.com/magnumripper/JohnTheRipper/issues/1892 for details.
@kholia commented on GitHub (Jul 7, 2017):
The bug seems to be in
Symmetrically_Encrypted_Data_Packetfunction (affected function). It seems that inappropriate code fromSymmetrically_Encrypted_and_MDC_Packetfunction was inserted into the affected function.Here is a symmetrically encrypted GPG file which gets cracked only after applying this patch.
I am not sure if this patch solves the problem 100% but it is a start.
Tip: Use
pgpdump(gpg2john is based on it) to rule out parsing problems with the original files.@2600box commented on GitHub (Jul 7, 2017):
I applied the patch and we have some functionality. I was able to test your file as well as two of my own. Your file and one of mine work. One of mine does not, because it large at 3GB.
gpg2john is creating huge files. with a small 197MB file, it becomes a 393MB hash. When I try this on a large file of 3GB it becomes a 9GB hash which john will not accept.
Also, I didn't know exactly how I am supposed to use pgpdump. Is it supposed to be used on the hash?
pgpdump example.hash? because that just gives mepgpdump: can't find PGP armor boundary.for interest here are some pgpdump info on my files.
3GB file:
196MB file:
your example:
Working cracked file example here:
@kholia commented on GitHub (Jul 7, 2017):
Quick note: Run
pgpdumpon original.gpgfiles, and not on hashes. Ourgpg2johntool is a modified version of pgpdump. Running pgpdump won't extract hashes. I suggested running pgpdump to rule out basic parsing problems with our/your gpg files.@kholia commented on GitHub (Jul 7, 2017):
I don't think there is a reasonable way to handle / crack such large
.gpgfiles currently.However, I might have a new idea to try here. Since, there is no MDC, we actually don't need to generate a full hash which includes all 3 GB of the original data, especially when we only use 4 bytes of it, currently! We could generate a truncated hash (i.e. limited to 64 KB), and process such hashes with JtR.
The bigger problem is that cracking of symmetrically encrypted files lacking MDC is currently not practically possible due to too many false positives involved. See #1892 for details. You will run into this problem eventually.
Maybe https://github.com/kholia/PGPCrack-NG can work but it has never been tested under such "extreme" conditions.
Let us know if you find a software solution which works better for you!
@2600box commented on GitHub (Jul 7, 2017):
Thanks for the feedback. I will test PGPCrack-NG with a very large file and see if it has any problems.
Would prefer the possibility of using JtR however.
@2600box commented on GitHub (Jul 10, 2017):
I tested with PGPCrack-NG on a 3GB gpg cast5 without MDC and it worked as expected. No errors.
Is there an open issue for me to track progress of this idea to add the functionality you mentioned?
@kholia commented on GitHub (Jul 10, 2017):
Glad to hear that PGPCrack-NG is working :-)
You can keep an eye on https://github.com/magnumripper/JohnTheRipper/issues/1892 but there has been no progress on it in a long time.
I tried to understand the inner workings of PGPCrack-NG last weekend but didn't make much progress. For now, I recommend using PGPCrack-NG.
@ghost commented on GitHub (Oct 30, 2017):
I ran into this problem. In case it helps with the bug hunt:
The hash produced by
gpg2johnwas 4gb (four times bigger than the source content).So I started to follow the pgpcrack-ng suggestion. There's a problem building PGPCrack-NG on debian. I took these steps:
aptitude install libpth-dev libbz2-dev libassuan-dev libgcrypt20-dev libgpg-error-devcd ~/src/git clone https://github.com/kholia/PGPCrack-NG.git/usr/include/libassuan2does not exist, so updatedMakefileto reference the directory forlibassuan.aand libassuan.so(/usr/lib/x86_64-linux-gnu/`).makeI have the following zlib files, so I'm not sure why it's not finding them.
@kholia commented on GitHub (Oct 30, 2017):
These are kernel headers!
Just install the
zlib-devor a similar package to build the package on Debian. IIRC latest Debian breaks the existing project documentation.This is the real problem and can't be solved 100%. It also has nothing to do with the build problems you report.
@ghost commented on GitHub (Oct 30, 2017):
Thanks. I installed
zlib1g-devand it built. (zlib-devwasn't available). You might want to add that to the readme.@kholia commented on GitHub (Oct 30, 2017):
I don't have the resources to maintain documentation for every new distribution. You may send patches if you care.
@ghost commented on GitHub (Oct 30, 2017):
I'm a github novice but i'll try.
The next problem is the readme shows:
3. john -i -stdout | ./PGPCrack-NG <PGP file>and
johngivesUnknown option: "-i". Is that meant to be for incremental mode, despite using a word list?@kholia commented on GitHub (Oct 30, 2017):
Read the updated documentation. Things evolve, and existing documentation breaks all the time. I don't have the resources to offer you any further support.
@frank-dittrich commented on GitHub (Oct 30, 2017):
Some time ago, there was only one john option starting with letter i,
--incremental, now jumbo hasThat's why, -i is ambiguous. The error message could be more helpful in such a case.
Use
-incor--incor--incremental...