I make a terrible mistake. I totally lost my paper with the secret password for my encrypted external GUID hard drive. This external drive contains many pictures but also some works documents very usefull. So it would be very interesting for me to get through this password.
I can remember maybe 50% of my password.I calculated that with the known part of my password I will have a maximum of 250 000 possible combination. A program like crunch could do the list of all the combination but I think it is not the most difficult part of this mission.
I have to build a small program to fill the dialog box and trying all the 250 000 combination. I already tried to do this with Apple Script but I didn’t found the command to fill in the combination in the dialog box “Enter a password to unlock the disk”. This dialog box appear when we plug the disk to the mac.
Does somebody know well applescript to helping me to interact with this unlocker disk dialog box? Or maybe somebody have an other solution to unlock it without applescript?
If somebody is interested to helping me I will be very grateful.
Best Answer
As a proof of concept, I formatted a USB Thumb-drive using a GUID Partition Map and formatted it Mac OS Extended (Journaled) naming it "Encrypted".
Then in Finder, I selected the disk named "Encrypted" and control-clicked selecting Encrypt "Encrypted"..., while setting its password to "password".
When it was done encrypting, using Terminal, I ascertained the
UUID
I'd need to use with thediskutil
command in my script with the following command:diskutil cs list
I wanted the
UUID
of theLogical Volume
where it showedVolume Name: Encrypted
and in this case it showed it as:Here's the output of
diskutil cs list
, so as to see from what I drew theUUID
.With now having the correct
UUID
, I created my bash script in Terminal:I then added the following code:
Note: Replace the
UUID
above with theUUID
of the Logical Volume of your encrypted drive.I saved and closed the script named "unlock" and made it executable using:
I then created a dictionary file,
touch dictionary.txt
and populated the file. Of course in your case, you'd use as you mentioned the program namedcrunch
to create your dictionary file(s).I then ejected and remove the USB Thumb-drive from my system.
I then plugged in the USB Thumb-drive and when the "Enter a password to unlock the disk "Encrypted"." dialog box appeared, I clicked the Cancel button.
Now I was ready to unlock it using the bash script and
dictionary.txt
file from Terminal.To show what I put in the
dictionary.txt
file:Here's the output of:
./unlock dictionary.txt
As you can see it tried what was in the dictionary.txt file up until if found the correct password and when the correct password was tested it unlocked and mounted the disk, prints out what the correct password was and exits the script.
The reason for printing out all passwords, is so if you need to stop the script you can then remove the tried passwords from the dictionary.txt file before starting again.
Note: It is important that before running the bash script you have first freshly plugged in the drive and clicked the Cancel button, then run the script.