Module 17: Linux Privilege Escalation

Enumerating Linux

A very useful site for privilege escalation:

Understanding Files and Users Privileges on Linux

File permissions, nothin' fancy to add.

Manual Enumeration

Automated Enumeration

Bash script to check for privilege escalation vectors: /usr/bin/unix-privesc-check Note: This runs via /bin/sh by default, run with bash to avoid issues with if statements.

Exposed Confidential Information

Inspecting User Trails

Check environment variables via env, dig into where they come from if important information is stored to validate it.

Creating a custom wordlist with crunch:

Inspecting Service Footprints

Watching for processes that may be started with important information:

If we have privileges to capture network traffice:

Insecure File Permissions

Abusing Cron Jobs

Searching syslog for cronjobs (also reviewing /var/log/cron.log):

Abusing Password Authentication

If the /etc/passwd file is writable, we can abuse this due to Linux using authentication here prior to /etc/shadow for backwards compatability.

Generating a hash via openssl then adding it to /etc/passwd if it's writable:

Insecure System Components

Abusing Setuid Binaries and Capabilities

Searching for binaries with capability misconfigurations:

Abusing Sudo

See what commands can be potentially abused via sudo:

Exploiting Kernel Vulnerabilities

Last updated