Linux

Test For Kernel Exploits

uname -a
cat /etc/issue
cat /etc/*-release
les.sh

Test For sudo permissions

sudo -l

General Scoping

grep -Ri 'db' /var/www --color=auto
grep -Ri 'sql' /var/www --color=auto
grep -Ri '$db_name' /var/www --color=auto
ls -lsa /tmp/
ls -lsa /dev/shm
ls -lsa /opt/
ls -lsa /
ls -ls /etc anything other than root:root root:fuse root:shadow root:dip

Vulnerable Driver Discovery

List drivers

get libata driver information and version

Test SUDO

Reference https://gtfobins.github.io/

Nano

Awk

Nmap

Vim

LD_PRELOAD

create file as malicious.c

compile and load

Shared Object Injection

Run strace on SUIDs to find "foundso.so"

create foundso.c

Test SUID files

Reference https://gtfobins.github.io/ and google the rest not listed.

Test etc/passwd & etc/shadow

Test for readable / writeable /etc/passwd OR /etc/shadow

Only if Both Readable

Writable etc/passwd

Stored Passwords & Keys

OVPN Files

Irssi Files

Bash History

SSH Keys

Abusing Intended Functionality

Symlinks

Nginx below 1.6.2-5+deb8u3 logrotate Local Privilege Escalation

Environment Variables

Path

C functions such as setresgid, setresuid, and system are of interest and should be investigated. Relative path commands such as "service" apache2 start can be abused.

Functions, ShellOpts & PS4

C functions such as setresgid, setresuid, and system are of interest and should be investigated. Absolute or Relative path commands such as "service" can be abused by creating functions in the current shell session.

Method 1

Method 2

Capabilities

Python 2.6

Cron

Path

This abuses misconfigured path in "/etc/crontab". If a user has write permissions in the directory that is in the path. create a file with the same name as the cronjob with malicious contents.

Wildcards

Tar

Exploitable if cronjob script that is using tar and has a wildcard * Example: tar czf /tmp/backup.tar.gz

Wait for execution

File Overwrite

Exploitable if script is writeable by the current user

NFS Root Squashing

Victim Machine

Kali Machine

Victim Machine

Mysql

prequisites - a valid database

Run LinPEAS

try passwords found in config PHP files

Last updated