Password Authentication Abuse
Last updated
Last updated
Unless a centralised credential system is set up such as AD or LDAP, linux passwords are stored in /etc/shadow
For backwards compatibility, if a password hash is present in the second column of an /etc/passwd
user record, it is considered valid for authentication and it takes precedence over the respective entry in /etc/shadow
. So we can abuse a writable etc/passwd
file.
Generate a password hash using:
Now we are root.
Note the 0s for uid and gid.