Page cover

Linux Enum & Privilege Escalation

Enumeration

-> Get system distribution and version

cat /etc/*-release

-> Get kernel version

cat /proc/version   
uname -a

-> View variable environments

env
cat /etc/profile
cat /etc/bashrc
cat ~/.bash_profile
cat ~/.bashrc
cat ~/.bash_logout
cat ~/.zshrc

-> View user command history

cat ~/.bash_history
cat ~/.zsh_history
cat ~/.nano_history
cat ~/.atftp_history
cat ~/.mysql_history
cat ~/.php_history

-> List running processes

-> View interfaces and network information

-> View all active TCP connections and the TCP and UDP ports the host is listening on.

-> Get DNS resolver and hosts mapped to an IP

-> Get system user, group and password information

Extracting database information

PostgreSQL

-> psql terminal as postgres user

-> list the databases

-> select the database

-> list the tables

-> dump

-> read files

SQLite

-> access database

-> list the tables

-> dump

MySQL

-> list the databases

-> select the database

-> list the tables

-> dump

Other Tips

-> Perform code review on web server files (/var/www/html); -> Check log files for credentials;


Privilege Escalation

Crontab [PrivEsc]

-> Enumeration

-> Exploitation

SUID [PrivEsc]

-> Enumeration

or

-> Exploitation https://gtfobins.github.io/arrow-up-right

Capabilities [PrivEsc]

-> Enumeration

-> Exploitation https://gtfobins.github.io/arrow-up-right

Binary with Sudo [PrivEsc]

or

-> Exploitation https://gtfobins.github.io/arrow-up-right

Run commands as another user with permission through sudo [PrivEsc]

Weak File Permissions / Passwd Writabble [PrivEsc]

-> Enumeration

-> Exploitation

NFS Root Squashing

-> Detection - VM Owned

-> Viewing nfs directories with access - Attacker VM

-> Get nfs version - Attacker VM

-> Mount - Attacker VM

-> Creating and compiling file for privesc - Attacker VM

-> Exploitation - VM Owned

sudo < v1.28 - @sickrov [PrivEsc]

Docker Breakout [PrivEsc]

-> Search the socket

-> list images

-> Exploitation

Linux Enumeration Tools [PrivEsc]

-> Linpeas

https://github.com/carlospolop/PEASS-ng/tree/master/linPEASarrow-up-right

-> pspy (unprivileged Linux process snooping)

https://github.com/DominicBreuker/pspyarrow-up-right

-> linux-exploit-suggester

or

https://github.com/The-Z-Labs/linux-exploit-suggesterarrow-up-right

-> Unix Privesc Check

https://pentestmonkey.net/tools/audit/unix-privesc-checkarrow-up-right

Last updated