-stdinpass
read a null-terminated passphrase from standard input. Ifthe standard input is a tty, the passphrase will be read with readpassphrase(3). -stdinpass replaces -passphrase though the latter is still supported for compatibility. Beware that the password will contain any newlines before the NULL. See the EXAMPLES section.echo -n password|hdiutil attach -mount -encryption -stdinpass - image.dmg
#!/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
echo -n FooBar | hdiutil attach -mount required -encryption -stdinpass ~/foobar.dmg
#!/bin/bash
for word in $(cat ~/passwordlist.txt | grep -v "#")
do
echo $word
echo -n $word | hdiutil attach -mount required -encryption -stdinpass ~/foobar.dmg
if [[ $? = 0 ]]
then
echo "Password found!"
echo $word
exit 0
fi
done
echo "password not found :("
exit 1
AGIP-NET
hdiutil: attach failed - Authentication error
AGPS-NET
hdiutil: attach failed - Authentication error
AGPS-WAN
hdiutil: attach failed - Authentication error
AGRI-FER
hdiutil: attach failed - Authentication error
FooBar
hdiutil: attach failed - Authentication error
AlpoCAN
hdiutil: attach failed - Authentication error
^Ccanceling...
for word in $(cat ~/passwordlist.txt | sed -e 's/.$//' | grep -v "#")
posted by bonaldi at 3:04 PM on September 24, 2006