w
who -a
cat /etc/passwd
cat /etc/sudoers
cat /etc/group
Try logging in
su <user> #with or without password, try stupid things like root - root
su - <user> #simulate full login
sudo su #switch to root, requires sudo permission and knowledge of the user's password
sudo - su #sometimes is allowed while the version without the - is blocked
User files enumeration
Enumerate home folders
find /home/*/ -type f 2>/dev/null
ls -lah /home/*
ls -lah /home/*/*
ls -lah /home/*/.ssh
ls -lah /home/*/.gnupg
ls -lah /home/*/.bash_history
Writable files
Owned files
find /etc /var /home /bin /usr /opt /tmp /mnt -type f -exec ls -lah '{}' \; 2>/dev/null | grep $(whoami)
Writable folders
find / -type d -exec ls -ld '{}' \; 2>/dev/null | grep $(whoami);
Writable files
find /etc /var /home /bin /usr /opt /tmp /mnt -writable -type f -exec ls -lah '{}' \; 2>/dev/null
OS
Arch and kernel
hostname
cat /etc/issue
cat /etc/*-release
uname -a
uname -m
Env and modules
sudo -V
lsmod
/sbin/modinfo <module name>
Enumerate possible defenses
AppArmor
if [ `whichaa-status2>/dev/null` ]; thenaa-statuselif [ `whichapparmor_status2>/dev/null` ]; thenapparmor_statuselif [ `ls-d/etc/apparmor*2>/dev/null` ]; thenls-d/etc/apparmor*elseecho"Not found AppArmor"fi
find /etc -type f -name *.service -exec ls -lah {} \; | grep $(whoami)
Enumerate service manager type
pstree | head -3 #check first line. It may display either systemd or init
Enumerate init.d services
service --status-all #list all services
service --status-all | grep '\[ + \]' #list running services
service <name> status #service info
ls -l /etc/init.d/* #list all service conf files
Enumerate systemd services
systemctl list-units --type=service #list all services
systemctl --type=service --state=<active|running> #list running services
systemctl status <service> #service info
systemctl list-unit-files --state=enabled #list conf files of active services
ls -l /etc/systemd/system /usr/lib/systemd/service | grep .service #list service conf files
Installed software
dpkg -l
rpm -qa
pacman -Q
Self-elevating binaries
find / -perm -u=s -type f 2>/dev/null
find / -perm -g=s -type f 2>/dev/null
getcap -r / | grep cap_setuid