Location of admin password file

Solution 1:

In recent versions of OS X (I forget whether this changed in 10.6 or 10.7), the shadow hashes were moved from /var/db/shadow/hash/<generateduid> into the main user database as an attribute in /var/db/dslocal/nodes/Default/users/<accountname>.plist. You can get them from the .plist directly (with e.g. the defaults command), but it's probably best to go through directory services with the dscl command, especially because that can also tell you what format it's in (SALTED-SHA512-PBKDF2 in this example):

$ sudo dscl . read /Users/joeuser AuthenticationAuthority
AuthenticationAuthority: ;ShadowHash;HASHLIST:<SALTED-SHA512-PBKDF2> ;Kerberosv5
;;joeuser@LKDC:SHA1.35AA07E97624F005350C5DC08A0633E9AFE17A14;LKDC:SHA1.35AA07E97
624F005350C5DC08A0633E9AFE17A14
$ sudo dscl . read /Users/joeuser dsAttrTypeNative:ShadowHashData
dsAttrTypeNative:ShadowHashData:
 62706c69 73743030 d101025f 10145341 4c544544 2d534841 3531322d 50424b44 4632d30
3 04050607 0857656e 74726f70 79547361 6c745a69 74657261 74696f6e 734f1080 4a52f1
ce a8cbadda 6c0e5483 9e7c3663 4d3c3327 d6dc6ad9 eb6ae851 d5837201 e15d8a58 641cf
ab0 46fc7b18 4bfafab7 8b44a6a6 424a241e 239ee429 12a7c304 2de27551 218257a7 a26e
f16d ceeac49f 5e3161c3 b63cab11 f6d92601 85cc134a 4e8ca7ad 7bd826be fc08606e eb1
2c642 5ec370e8 95ffb534 42488365 61649a73 4f1020f7 54827b04 dd6f6c24 799a8cb8 d1
5243a6 42a3cef4 566100d3 177cfeec b251f211 6532080b 22293136 41c4e700 00000000 0
0010100 00000000 00000900 00000000 00000000 00000000 0000ea

Solution 2:

The hash should be located at /var/db/shadow/hash under the GUID for the user.

The user GUID can be found by running:

dscl localhost -read /Search/Users/<username> | grep GeneratedUID | cut -c15-