Discussion:
[john-users] dmg file with lost password
Ian Boyd
2018-02-26 14:21:14 UTC
Permalink
Issues: I understand computers and can usually figure things out, but not good or experienced at the back end of things.. ie coding or understanding how to alter a code to make a program function the way you want it to.

1. I have been using Terminal, Xcode, and Bbedit and been trying to follow the posted instructions on Openwall, the JtR community, and from here http://easymactips.blogspot.ca/2012/09/john-ripper-tutorial-examples-and.html <http://easymactips.blogspot.ca/2012/09/john-ripper-tutorial-examples-and.html> but the john-1.8.0.9-jumbo-macosx_v3 doesn’t have the src file as it does in the instructions. I have read through the instructions several times, but get lost understanding different hashes and altering the config file, etc...

Then I found Johnny!!! http://openwall.info/wiki/john/johnny <http://openwall.info/wiki/john/johnny> (super awesome and makes it easier for someone like myself) So WHO EVER made Johnny
 THANK YOU! AWESOME JOB!

2. Using Johnny, and trying to figure out how to crack one password for my .dmg file. This program makes it easier to work with, but are there any helpful tips on who to use to crack one file?
When I think I scan the file properly i get a "Warning: invalid UTF-8 seen reading” and the computer stalls at 57%
Claudio André
2018-02-26 18:11:49 UTC
Permalink
Post by Ian Boyd
2. Using Johnny, and trying to figure out how to crack one password for my .dmg file. This program makes it easier to work with, but are there any helpful tips on who to use to crack one file?
When I think I scan the file properly i get a "Warning: invalid UTF-8 seen reading” and the computer stalls at 57%
Have you run the 2john tool. I mean:

`dmg2john [path]/yourfile.dmg> dmg_hash.txt`

I never used johnny, but I expected that after the 2john seen above, a
simple:

- file -> open(or open hash file, or similar) -> "dmg_hash.txt" should work.

If this is not the case?

Claudio
Solar Designer
2018-02-27 20:48:36 UTC
Permalink
Hi Ian,

Thank you for bringing this to the list.
Post by Ian Boyd
1. I have been using Terminal, Xcode, and Bbedit and been trying to follow the posted instructions on Openwall, the JtR community, and from here http://easymactips.blogspot.ca/2012/09/john-ripper-tutorial-examples-and.html
These instructions are about building JtR from source, and they're out
of date.
Post by Ian Boyd
but the john-1.8.0.9-jumbo-macosx_v3 doesn't have the src file as it does in the instructions.
This is a binary (already built) download contributed by a user (so you
don't need to build it, hence the lack of src in there). This build
should be readily usable, without needing Xcode.
Post by Ian Boyd
Then I found Johnny!!! http://openwall.info/wiki/john/johnny (super awesome and makes it easier for someone like myself) So WHO EVER made Johnny??? THANK YOU! AWESOME JOB!
Aleksey, Shinnok, and Mathieu made it. They'd be happy to hear you
found it useful, and we should probably merge Johnny into the main jumbo
tree so that more people find it and so that we keep it consistent with
the rest of jumbo.
Post by Ian Boyd
2. Using Johnny, and trying to figure out how to crack one password for my .dmg file. This program makes it easier to work with, but are there any helpful tips on who to use to crack one file?
When I think I scan the file properly i get a "Warning: invalid UTF-8 seen reading??? and the computer stalls at 57%
It's hard to help you with this without knowing exactly how you used
Johnny and what else it outputs besides that warning and the 57%.

As Claudio correctly pointed out, you should have started by using
dmg2john. You can probably do this from Johnny itself, using the dialog
shown on this screenshot:

Loading Image...

I guess you need to choose dmg in the "Choose file format" drop-down.

Please confirm that you did this (or if not, do it) and please also show
us the full output from JtR (copy-paste from a Johnny window).

In our off-list discussion, I wrote that "In our experience with
forgotten passwords to .dmg files, failure is more likely than success"
and you asked "Why are dmg files usually unsuccessful to crack?" I'll
answer here: Apple has made the "key derivation" step (deriving an
internal encryption key from a user-entered password/passphrase)
purposefully computationally expensive (slow). This is an industry
standard thing to do, and Apple did it right (although in more recent
years even more expensive key derivation methods have been designed).
Without specialized hardware (ASICs, which some three-letter agencies
probably have, but we don't), JtR is only able to test a few thousand to
maybe 10 thousand candidate passwords per second per GPU, against a dmg
file generated/protected on a recent version of OS X. (For ancient
versions, speeds may be 100 times higher.) This means that a user might
realistically test, say, a billion of candidate passwords before giving
up (this might be a day on the latest high-end GPU, or a few months on a
laptop/desktop CPU - but exact times may vary greatly). And that's just
not enough to crack a semi-strong password/passphrase unless quite some
information about what it can vs. cannot be like is known (can be
recalled and input to the program). Of course, the weakest passwords
(such as those within the top few million of common passwords) can be
cracked anyway, but when people ask for help it's unusual for their
forgotten password/phrase to be a common one (although this happens).

I hope this helps.

Alexander
Shinnok
2018-03-27 08:07:31 UTC
Permalink
Ian,
Post by Solar Designer
Then I found Johnny!!! http://openwall.info/wiki/john/johnny <http://openwall.info/wiki/john/johnny> (super awesome and makes it easier for someone like myself) So WHO EVER made Johnny??? THANK YOU! AWESOME JOB!
Aleksey, Shinnok, and Mathieu made it. They'd be happy to hear you
found it useful, and we should probably merge Johnny into the main jumbo
tree so that more people find it and so that we keep it consistent with
the rest of jumbo.
Thanks for the kind words and really glad that Johnny helped in shaving off some of that initial FUD when trying out JtR for the first time. Speaking for Mathieu and Aleksey here too. :)

PS: I might get some time allotted to bring Johnny into 2018 this year. There's some improvements, testing and finishing touches I'd like to do.

Best regards,
Shinnok

Ian Boyd
2018-02-27 21:35:22 UTC
Permalink
HI Alexander,

Thanks for the “out of date” information about building JtR from source, I abandoned my attempts once I found Johnny. :)
Post by Solar Designer
Post by Ian Boyd
2. Using Johnny, and trying to figure out how to crack one password for my .dmg file. This program makes it easier to work with, but are there any helpful tips on who to use to crack one file?
When I think I scan the file properly i get a "Warning: invalid UTF-8 seen reading??? and the computer stalls at 57%
It's hard to help you with this without knowing exactly how you used
Johnny and what else it outputs besides that warning and the 57%.
As Claudio correctly pointed out, you should have started by using
dmg2john. You can probably do this from Johnny itself, using the dialog
http://openwall.info/wiki/_media/john/johnny/johnnyscreen-6.png
I guess you need to choose dmg in the "Choose file format" drop-down.
Please confirm that you did this (or if not, do it) and please also show
us the full output from JtR (copy-paste from a Johnny window).
I believe I did get Johnny to work using the dmgsjohn. file and chose the dmg for the file format in the drop down.
The program has currently been running for a total time of 2:17:48:33 and has worked through Single rule, Wordlist rule, and has been working on incremental rule for some time. But it’s my understanding that incremental typically takes the longest time. Is this correct?
Can this process take a long time?
Post by Solar Designer
In our off-list discussion, I wrote that "In our experience with
forgotten passwords to .dmg files, failure is more likely than success"
and you asked "Why are dmg files usually unsuccessful to crack?" I'll
answer here: Apple has made the "key derivation" step (deriving an
internal encryption key from a user-entered password/passphrase)
purposefully computationally expensive (slow). This is an industry
standard thing to do, and Apple did it right (although in more recent
years even more expensive key derivation methods have been designed).
Without specialized hardware (ASICs, which some three-letter agencies
probably have, but we don't), JtR is only able to test a few thousand to
maybe 10 thousand candidate passwords per second per GPU, against a dmg
file generated/protected on a recent version of OS X. (For ancient
versions, speeds may be 100 times higher.) This means that a user might
realistically test, say, a billion of candidate passwords before giving
up (this might be a day on the latest high-end GPU, or a few months on a
laptop/desktop CPU - but exact times may vary greatly). And that's just
not enough to crack a semi-strong password/passphrase unless quite some
information about what it can vs. cannot be like is known (can be
recalled and input to the program). Of course, the weakest passwords
(such as those within the top few million of common passwords) can be
cracked anyway, but when people ask for help it's unusual for their
forgotten password/phrase to be a common one (although this happens).
Thanks for this information, I have a better understanding of why this process takes so long. It helps a lot.

You have been really helpful in this process and I really appreciate all this information and guidance.

All the best,
Ian
Solar Designer
2018-02-27 22:01:21 UTC
Permalink
This post might be inappropriate. Click to display it.
Ian Boyd
2018-02-27 22:06:50 UTC
Permalink
Is this the information you are looking for regarding showing the full output?

[22:37:12] /Users/ianboyd/Downloads/john-1.8.0.9-jumbo-macosx_v3/run/john --format=dmg-opencl --single --session=/Users/ianboyd/.john/sessions/02-24-18-22-37-12 /Users/ianboyd/Desktop/Johnny files/dmgpass.lst
Device 1: Intel(R) Iris(TM) Graphics 6100
Using default input encoding: UTF-8
Loaded 1 password hash (dmg-opencl, Apple DMG [PBKDF2-SHA1 OpenCL 3DES/AES])
Will run 4 OpenMP threads
/-------------------------------------
[22:38:35] /Users/ianboyd/Downloads/john-1.8.0.9-jumbo-macosx_v3/run/john --restore=/Users/ianboyd/.john/sessions/02-24-18-22-33-44
Loaded 1 password hash (dmg, Apple DMG [PBKDF2-SHA1 256/256 AVX2 8x 3DES/AES])
Will run 4 OpenMP threads
/-\|/-\|/-\|/-\|/-\|/Proceeding with single, rules:Single
Press 'q' or Ctrl-C to abort, almost any other key for status
0g 0:00:02:05 22.65% 1/3 (ETA: 22:45:42) 0g/s 87.55p/s 87.55c/s 87.55C/s Users/users/ianboyd/desktop/files/information.dmgs
Proceeding with wordlist:/Users/ianboyd/Downloads/john-1.8.0.9-jumbo-macosx_v3/run/password.lst and rules:Wordlist
Proceeding with incremental:ASCII
Post by Solar Designer
Post by Ian Boyd
I believe I did get Johnny to work using the dmgsjohn. file and chose the dmg for the file format in the drop down.
The program has currently been running for a total time of 2:17:48:33 and has worked through Single rule, Wordlist rule, and has been working on incremental rule for some time. But it's my understanding that incremental typically takes the longest time. Is this correct?
Can this process take a long time?
Yes, it can take forever, unless it cracks your password first. To have
a better chance of cracking the password, you'll need to focus the
attack using whatever information about the password you can recall.
But first of all you should really want to "show us the full output from
JtR (copy-paste from a Johnny window)". Without that, we can't be
confident you ran it correctly and that it is doing what it should be.
By incorrect invocation, it is possible to have it spend a lot of time
processing without it actually doing anything even remotely reasonable.
Another thing you might want to do is generate a test dmg file with an
obviously very weak password and have JtR crack that. This will serve
to verify that you do things right and will show you what the output of
a correctly running attack should look like.
Alexander
Solar Designer
2018-02-27 22:19:49 UTC
Permalink
Post by Ian Boyd
Is this the information you are looking for regarding showing the full output?
[22:37:12] /Users/ianboyd/Downloads/john-1.8.0.9-jumbo-macosx_v3/run/john --format=dmg-opencl --single --session=/Users/ianboyd/.john/sessions/02-24-18-22-37-12 /Users/ianboyd/Desktop/Johnny files/dmgpass.lst
Device 1: Intel(R) Iris(TM) Graphics 6100
Using default input encoding: UTF-8
Loaded 1 password hash (dmg-opencl, Apple DMG [PBKDF2-SHA1 OpenCL 3DES/AES])
Will run 4 OpenMP threads
-------------------------------------
[22:38:35] /Users/ianboyd/Downloads/john-1.8.0.9-jumbo-macosx_v3/run/john --restore=/Users/ianboyd/.john/sessions/02-24-18-22-33-44
Loaded 1 password hash (dmg, Apple DMG [PBKDF2-SHA1 256/256 AVX2 8x 3DES/AES])
Will run 4 OpenMP threads
Proceeding with single, rules:Single
Press 'q' or Ctrl-C to abort, almost any other key for status
0g 0:00:02:05 22.65% 1/3 (ETA: 22:45:42) 0g/s 87.55p/s 87.55c/s 87.55C/s Users/users/ianboyd/desktop/files/information.dmgs
Proceeding with wordlist:/Users/ianboyd/Downloads/john-1.8.0.9-jumbo-macosx_v3/run/password.lst and rules:Wordlist
Proceeding with incremental:ASCII
Yes, and this looks reasonable. :-)

Current versions of JtR may also print a message like:

Cost 1 (iteration count) is 234567 for all loaded hashes

Is this not printed for you? Looks like it is not, which surprises me.

Anyway, you'll want to proceed with that test with a dmg file having a
known weak password. Not only to verify your procedure (per the above,
it looks correct to me), but also to test software compatibility
(although ideally you'd generate the test dmg file on the same version
of OS X that was used to generate your target dmg file).

Alexander
Ian Boyd
2018-03-01 19:51:42 UTC
Permalink
HI Alexander,

I tested a dmg file with a weak password and it took like 2 seconds to crack. So I’m hoping, knock on wood, that the results are the same for my dmg file.
I know it was a longer password with both upper and lower case, but even if the word shows up I can try different variations of it. Fingers Crossed.

Ian
Post by Solar Designer
Post by Ian Boyd
Is this the information you are looking for regarding showing the full output?
[22:37:12] /Users/ianboyd/Downloads/john-1.8.0.9-jumbo-macosx_v3/run/john --format=dmg-opencl --single --session=/Users/ianboyd/.john/sessions/02-24-18-22-37-12 /Users/ianboyd/Desktop/Johnny files/dmgpass.lst
Device 1: Intel(R) Iris(TM) Graphics 6100
Using default input encoding: UTF-8
Loaded 1 password hash (dmg-opencl, Apple DMG [PBKDF2-SHA1 OpenCL 3DES/AES])
Will run 4 OpenMP threads
-------------------------------------
[22:38:35] /Users/ianboyd/Downloads/john-1.8.0.9-jumbo-macosx_v3/run/john --restore=/Users/ianboyd/.john/sessions/02-24-18-22-33-44
Loaded 1 password hash (dmg, Apple DMG [PBKDF2-SHA1 256/256 AVX2 8x 3DES/AES])
Will run 4 OpenMP threads
Proceeding with single, rules:Single
Press 'q' or Ctrl-C to abort, almost any other key for status
0g 0:00:02:05 22.65% 1/3 (ETA: 22:45:42) 0g/s 87.55p/s 87.55c/s 87.55C/s Users/users/ianboyd/desktop/files/information.dmgs
Proceeding with wordlist:/Users/ianboyd/Downloads/john-1.8.0.9-jumbo-macosx_v3/run/password.lst and rules:Wordlist
Proceeding with incremental:ASCII
Yes, and this looks reasonable. :-)
Cost 1 (iteration count) is 234567 for all loaded hashes
Is this not printed for you? Looks like it is not, which surprises me.
Anyway, you'll want to proceed with that test with a dmg file having a
known weak password. Not only to verify your procedure (per the above,
it looks correct to me), but also to test software compatibility
(although ideally you'd generate the test dmg file on the same version
of OS X that was used to generate your target dmg file).
Alexander
Loading...