Privilege Escalation

Linpeas

Things to focus on when using linpeas
  • Kernel Exploits
  • Vulnerable Software
  • User Privileges
  • Sudo
  • SUID
  • Windows Token Privileges
  • Scheduled Tasks
  • /etc/crontab
  • /etc/cron.d
  • /var/spool/cron/crontabs/root
  • If we can write to a directory called by a cron job, we can write a Bash script with a reverse shell command, which should send us a reverse shell when it runs
  • Exposed Credentials
  • Config.php, .log
  • SSH Keys
  • Finally, let's discuss SSH keys. If we have read access to the .ssh directory for a specific user, we can read their private SSH keys located in /home/user/.ssh/id_rsa or /root/.ssh/id_rsay and use them to log in to the server
  • We first set permissions with chmod 600 id_rsa
  • We grab the key and: ssh root@<ip> -i id_rsa