2

I've got an embedded device (it's a wifi camera) that I've managed to login on. I copied the passwd file and started john the ripper. It's taking quite some time.

$ cat passwd
root:9so4MTVQCT0io:0:0:root:/root:/bin/sh

$ john passwd
Loaded 1 password hash (descrypt, traditional crypt(3) [DES 128/128 SSE2-16])
Press 'q' or Ctrl-C to abort, almost any other key for status
Warning: MaxLen = 13 is too large for the current hash type, reduced to 8

Since I have access to the system, and I can change the password, would it be helpful to john if I changed the password multiple times (copying the hash each time)? Picking passwords like, 'password', 'pass123', etc, might help john find the salt (?) and make it easier to know which salt to use for this one? Or am I misunderstanding the idea of salting passwords? (I get that ideally from a security standpoint, each password would be salted differently, but I'm not sure if this is. Is there a way to know?)

Any thoughts? Thanks!

P.S. I posted this in unix.stackexch but I think this is a better place, so please forgive (or correct) this cross post.

2 Answers 2

6

Since I have access to the system, and I can change the password, would it be helpful to john if I changed the password multiple times (copying the hash each time)?

No, that won't help, except insofar as the more weak password you try, the more likely John is to get one quickly.

Picking passwords like, 'password', 'pass123', etc, might help john find the salt (?) and make it easier to know which salt to use for this one?

John knows the salt; it's encoded into the hashed password string. See the description of Traditional Unix DES password hashes; basically the password you enter is truncated down to 56 bits, a 12 bit hash is generated, and the hash is used to "perturb the algorithm" as those 56 bits are used to generate a password hash. Then the hashed password and the 12 bits of hash are concatenated and the resulting string is base64'd, resulting in the string 9so4MTVQCT0io you see above.

Or am I misunderstanding the idea of salting passwords? (I get that ideally from a security standpoint, each password would be salted differently, but I'm not sure if this is. Is there a way to know?)

The idea of a salt is that if your password is "Alpha123", and my password is "Alpha123", the fact that the system generates a different salt for each user each time they enter a new password means that these same passwords will result in different password hashes.

In Unix password hashes, the salt is always stored alongside the password. The traditional DES algorithm mashes the bits in before base64-encoding the hashed password, so it's not obvious. Newer password hashes are formatted to store the algorithm used, the salt, and the hashed password all in separate parts of a string segregated by the $ character:

$6$S9WFQfN9$q/4hhcE3zCfQhY/5I1KLpuw4nc8mD.suhGV.QTvcT.qfauOGBFTeOJMyRn0XjjMYIYsdEYmvULUbNua0/oFdS/

In this case, '6' means the password is hashed with SHA-512 and S9WFQfN9 is the salt.

1

No, it will not help "find the salt" or otherwise speed up the process. In fact, the salt is considered known by the attacker since it is stored alongside the hash, and is not supposed to mitigate this attack, as it only prevents the attacker from making precomputed tables for each hash.

In your case, I don't even see a salt alongside the hash, so it's even further nulled.

Edit: as pointed out below by @gowenfawr, the salt is embedded in the hash.

2
  • That makes sense. Never quite understood why salting mattered or what it did. So this password is probably not salted, then? I input this hash into a few different online cracking sites which I presume have full rainbow tables, but they were unable to match it. Does that mean anything? I have no urgency in cracking it. I'm just very curious.
    – justin
    Jun 3, 2017 at 18:35
  • 2
    That's a traditional Unix DES password hash; the salt and encrypted password are mashed together and then base64'd for readability. You're confused because it doesn't look like all newer passwd/shadow entries which are of the form $algorithm$salt$hashed-password and the salt is stored separate from the encrypted password, segregated by the $ character.
    – gowenfawr
    Jun 3, 2017 at 19:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .