Stored Passwords and File Permissions Flashcards

1
Q

What does the path of elevating privileges via stored passwords and file permissions consist of?

A

This path consists in searching for stored passwords, weak file permissions and ssh keys.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is it important to look the bash history?

A

The bash history can contain sensitive information such as previously typed passwords and sensitive files locations and names.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to use find to look for the “Password” string inside files?

A
$ find / -type f -exec grep -i -I "Password" {} /dev/null \;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

As a regular user, what kind of access should you expect for the passwd and shadow files?

A

As a regular user we should have read access to the passwd file and no access whatsoever to the shadow file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What can you do if the shadow file is writable?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What can you do with a writable passwd file?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What ssh sensitive files should you look for?

A

The authorized-keys, known_hosts files. Also private keys files, they usually start with “id_”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How would you use the find command to look for private key files?

A
$ find / -name id_'*' 2>/dev/null

This command will list files that start with “id_”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to use ssh with an identity file?

A
$ ssh -i privkeyfile username@ip
How well did you know this?
1
Not at all
2
3
4
5
Perfectly