Stored Passwords and File Permissions Flashcards
(9 cards)
What does the path of elevating privileges via stored passwords and file permissions consist of?
This path consists in searching for stored passwords, weak file permissions and ssh keys.
Why is it important to look the bash history?
The bash history can contain sensitive information such as previously typed passwords and sensitive files locations and names.
How to use find to look for the “Password” string inside files?
$ find / -type f -exec grep -i -I "Password" {} /dev/null \;
As a regular user, what kind of access should you expect for the passwd and shadow files?
As a regular user we should have read access to the passwd file and no access whatsoever to the shadow file.
What can you do if the shadow file is writable?
You could replace the password hash of any user, including root, to a known hash. Then you can just login with the password that matches the new hash.
What can you do with a writable passwd file?
You can edit an user id and group id to the same values of the root user. Also you can create another user by copying the root line and inserting a known hash to replace the x placeholder.
Another possibility is to replace the x placeholder of an user with a known hash.
What ssh sensitive files should you look for?
The authorized-keys, known_hosts files. Also private keys files, they usually start with “id_”.
How would you use the find command to look for private key files?
$ find / -name id_'*' 2>/dev/null
This command will list files that start with “id_”
How to use ssh with an identity file?
$ ssh -i privkeyfile username@ip