Home Writable /etc/shadow
Post
Cancel

Writable /etc/shadow

Writable /etc/shadow

The /etc/shadow file contains user password hashes and is usually readable only by the root user.

Enumeration

We are going to exploit a misconfigured /etc/shadow file to escalate our privileges to root. Let’s check the permission on /etc/shadow.

linpriv

As you can see, we have Write permission on /etc/shadow file.

Exploitation

We will generate a new password and edit the /etc/shadow file by placing the root hash with the one we have generated. After that, we will use the password to login to root account.

linpriv

linpriv

linpriv

Well…As you can see, we have logged in as root user.

This post is licensed under CC BY 4.0 by the author.