Passwords and Keys: History Files
Using misconfigured sudo rights for /usr/bin/nano, pull the /etc/shadow and /etc/passwd files, combine them with unshadow, and crack the passwords with john.
sudo nano /etc/shadow
sudo nano /etc/passwd
We can also use openssl passwd -1 -salt THM password1 and plug the result into /etc/passwd:
hacker:$1$THM$WnbwlliCqxFRQepUTCkUT1:0:0:root:/root:/bin/bash
Password File (pass.bak)
It's worth checking a user's /home/<username> folder for a file called pass.bak. If one is there, we can view their password in cleartext via cat.
History Files
View the contents of all the hidden history files in the user's home directory: cat ~/.*history | less.
Config Files
Another method is looking in config files for passwords. For example, a user has an openvpn file in their home directory: cat /home/user/myvpn.ovpn reveals another filepath for an authentication file.
SSH Keys
Sometimes people make backups of important files but fail to secure them with proper permissions.
Find hidden files and directories with this command: ls -la /.