is a Linux Priv Esc Cheat Sheet.
// Determine linux distribution and version
cat /etc/issue
cat /etc/*-release
cat /etc/lsb-release
cat /etc/redhat-release
// Determine kernel version - 32 or 64-bit?
cat /proc/version
uname -a
uname -mrs
rpm -q kernel
dmesg | grep Linux
ls /boot | grep vmlinuz-
// List environment variables
cat /etc/profile
cat /etc/bashrc
cat ~/.bash_profile
cat ~/.bashrc
cat ~/.bash_logout
env
// Determine if there is a printer
lpstat -a
// Determine which services are running
ps aux
ps -ef
top
cat /etc/service
// Determine which services are running as root
ps aux | grep root
ps -ef | grep root
// Determine installed applications
ls -alh /usr/bin/
ls -alh /sbin/
dpkg -l
rpm -qa
ls -alh /var/cache/apt/archivesO
ls -alh /var/cache/yum/
// Syslog Configuration
cat /etc/syslog.conf
cat /var/log/syslog.conf
(or just: locate syslog.conf)
// Web Server Configurations
cat /etc/chttp.conf
cat /etc/lighttpd.conf
cat /etc/apache2/apache2.conf
cat /etc/httpd/conf/httpd.conf
cat /opt/lampp/etc/httpd.conf
// PHP Configuration
/etc/php5/apache2/php.ini
// Printer (cupsd) Configuration
cat /etc/cups/cupsd.conf
// MySql
cat /etc/my.conf
// Inetd Configuration
cat /etc/inetd.conf
// List All
ls -aRl /etc/ | awk '$1 ~ /^.*r.*/'
// Determine scheduled jobs
crontab -l
ls -alh /var/spool/cron
ls -al /etc/ | grep cron
ls -al /etc/cron*
cat /etc/cron*
cat /etc/at.allow
cat /etc/at.deny
cat /etc/cron.allow
cat /etc/cron.deny
cat /etc/crontab
cat /etc/anacrontab
cat /var/spool/cron/crontabs/root
// Locate any plaintext usernames and passwords
grep -i user [filename]
grep -i pass [filename]
grep -C 5 "password" [filename]
find . -name "*.php" -print0 | xargs -0 grep -i -n "var $password" # Joomla
// Identify connected NICs and other networks
/sbin/ifconfig -a
cat /etc/network/interfaces
cat /etc/sysconfig/network
// Identify connected users and hosts
lsof -i
lsof -i :80
grep 80 /etc/services
netstat -antup
netstat -antpx
netstat -tulpn
chkconfig --list
chkconfig --list | grep 3:on
last
w
// Identify cached IP or MAC addresses
arp -a
route
/sbin/route -nee
// Identify network configuration Settings (DHCP, DNS, Gateway)
cat /etc/resolv.conf
cat /etc/sysconfig/network
cat /etc/networks
iptables -L
hostname
dnsdomainname
// Is packet sniffing possible
# tcpdump tcp dst [ip] [port] and tcp dst [ip] [port]
tcpdump tcp dst 192.168.1.7 80 and tcp dst 10.2.2.222 21
// Check for ports open for local only connections
netstat -tupan
// Is tunnelling possible?
ssh -D 127.0.0.1:9050 -N [username]@[ip]
proxychains ifconfig
// Identify the current user and users in the system
id
who
w
last
cat /etc/passwd | cut -d : -f 1 # List users
grep -v -E "^#" /etc/passwd | awk -F: '$3 == 0 { print $1}' # List of super users
awk -F: '($3 == "0") {print}' /etc/passwd # List of super users
// List Sudoers
cat /etc/sudoers
// Show which commands sudo allows you to run
sudo -l
// Attempt to display sensitive files
cat /etc/passwd
cat /etc/group
cat /etc/shadow
ls -alh /var/mail/
// Check for anything interesting in home directories
ls -ahlR /root/
ls -ahlR /home/
// Are there any hardcoded passwords in scripts, databases or configuration files
cat /var/apache2/config.inc
cat /var/lib/mysql/mysql/user.MYD
cat /root/anaconda-ks.cfg
// Check user history for credentials and activity
cat ~/.bash_history
cat ~/.nano_history
cat ~/.atftp_history
cat ~/.mysql_history
cat ~/.php_history
// Check user profile and mail
cat ~/.bashrc
cat ~/.profile
cat /var/mail/root
cat /var/spool/mail/root