Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

raiderpj

macrumors newbie
Original poster
Aug 3, 2011
1
0
So, I have a bit of a problem. I have an encrypted dmg file that I have forgotten the password for. Thanks to a younger (and dumber) version of myself using formulaic passwords, I was able to create a relatively small wordlist of the possible passwords. After some research, I found an applescript on an old metafilter discussion here that would test the wordlist against the encrypted dmg.

When I try to run the script in the applescript editor i get the following error (also in the attached screen shot):

"Expected end of line, etc. but found parameter name."​

Here is the script:

Code:
#!/bin/bash
for word in $(cat wordlist.txt | grep -v "#")
do
	echo -n $word | hdiutil attach -mount -encryption -stdinpass - image.dmg
	if [[ $? = 0 ]] 
	then 
		echo "Password found!"
		echo $word
		exit 0
	fi
done

echo "password not found :("
exit 1

If anyone could help me out with the applescript I would really appreciate it. I know next to nothing about applescripts.
 

Attachments

  • Screen Shot 2011-08-04 at 12.30.12 AM.png
    Screen Shot 2011-08-04 at 12.30.12 AM.png
    115.1 KB · Views: 123
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.