Pages: 1
Posted on 03-19-14, 12:50 am
Pokey
me some orange juice my hand

Karma: 674
Posts: 520/699
Since: 09-24-12
I have a mac, with mavericks on it and probably the best version, which is 10.6 or something? Not sure about that.

Anyways, as title says, I need to read the root password with terminal, to make a long story short. I know how to change it, but read it? Found nothing.
Posted on 03-19-14, 07:23 pm
AxewAxew

Karma: 673
Posts: 528/583
Since: 07-02-11
This is impossible.

The passwords are stored as 'hashes'; hashes are small strings of text which passwords/whatever you put in are turned into. The point of this is that hashing the same string will always give the same result, but you still can't turn the hash back into the source string without bruteforcing it, which would take a really long time. So basically password hashes can be used for checking for the right password, without the system actually knowing what the password is.

tl;dr: Passwords are stored in a way that make them (mostly) impossible to read.
Posted on 03-20-14, 12:42 am
Pokey
me some orange juice my hand

Karma: 674
Posts: 521/699
Since: 09-24-12
Well, if I have a way to translate hashes...

How would I find the hash?
Posted on 03-20-14, 03:55 pm (rev. 1 by xfix on 03-20-14, 03:56 pm)
All aboard the RandomTests train!

Karma: 789
Posts: 331/352
Since: 05-01-12
They are stored in /var/db/shadow/hash/. Only root can read those, and the files have user's UUID as user name. To get UUID, run the following command.

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

When you open the correct file, they contain SHA1 between bytes 169 and 216. To get them, run the following command.

cut -c169-216 <filename>

Please note that this only applies to Mac OS X 10.6. Newer versions have more secure method of storing password that is salted in addition (so you cannot simply decrypt passwords).
Posted on 03-20-14, 06:15 pm
Snifit


Karma: 16
Posts: 255/286
Since: 08-05-13
Posted by py_hacker
I have a mac, with mavericks on it and probably the best version, which is 10.6 or something? Not sure about that.

Anyways, as title says, I need to read the root password with terminal, to make a long story short. I know how to change it, but read it? Found nothing.

Mavericks is version 10.9. You can check by going to the apple logo in the top left screen and clicking on about this mac...
Posted on 03-21-14, 04:36 pm
Pokey
me some orange juice my hand

Karma: 674
Posts: 522/699
Since: 09-24-12
Well thanks. I found another way to do what I wanted, but thanks still!
Pages: 1