0

My goal is to check if the password used by admin is the default password.

I work on a Linux-based router. I know the password is stored as a hashed value in /etc/passwd.

In generic Linux machines, /etc/passwd has a field to indicate which hashing algorithm is used (for e.g. $1 for MD5).

Is there any way to get the salt and hashing algorithm used from the /etc/passwd file?

Maybe any tool or command? John cannot be used.

Ladadadada
  • 5,163
  • 1
  • 24
  • 41
  • Yes it is dupe:http://security.stackexchange.com/questions/3989/how-to-determine-what-type-of-encoding-encryption-has-been-used and http://stackoverflow.com/questions/1442422/determine-hash-algorithm – kiBytes Feb 10 '14 at 11:42
  • John The Ripper is a password cracker that understand which hashing algorithm that is used in /etc/passwd and /etc/shadow – Dog eat cat world Feb 10 '14 at 11:46
  • 2
    I think this is an X: Y question. Why do you care about the algorithim? If you want to check if the admin has used the default password, login with username Admin, password Default Password. – MCW Feb 10 '14 at 12:29
  • @Dogeatcatworld I do not have /etc/shadow, only /etc/passwd, that too is in a different way from usual LINUX machine. – Christy George Feb 12 '14 at 08:54
  • @MarkC.Wallace I need to implement a flag which indicates if default password is used. I cannot log out and check in a program. All that can be done is to read from /etc/passwd and compare the hashed value. – Christy George Feb 12 '14 at 08:56
  • It might help if you could paste a representative line from `/etc/passwd` into your question. Obviously, don't choose one where the password is a secret. – Ladadadada Feb 12 '14 at 14:36
  • If the "ldd" tool is available, you might get a hint of crypto algorithm based on the libraries used (i.e. by /bin/passwd). Checking PAM configuration might also prove valuable... – Dog eat cat world Mar 03 '14 at 15:58

0 Answers0