📑
Security Notes
  • Readme
  • Resources
    • Useful sites
    • Metasploit
      • Searchsploit
      • Msfvenom
      • Meterpreter
    • Shells
    • Linux
      • Cron
      • Connection
      • Compilers
    • Windows
      • Kernel exploits table
    • Bruteforce
      • Checklist
      • John the Ripper
      • Hashcat
    • BOF
      • Assembly
    • Gaining access checklist
  • Cloud - AWS
    • Enumeration
    • References
    • Bucket S3
      • Public Bucket
      • AMI Files
      • File upload to RCE
    • EC2
      • cloud-init Exploits
      • SSRF To AWS Role compromise
      • Unencrypted EBS
    • IAM
      • Account Disclosure by resource policy
    • Lambda Function
      • Code Injection
      • Attacking APIs
    • VPC
      • Expose Resources
  • Networking
    • Nmap
      • Scan types
    • TCPDump
    • Port forwarding
    • Ports
      • 21 - FTP
      • 22 - SSH
      • 25 465 587 - SMTP
      • 53 - DNS
      • 110 995 - POP3
      • 111 - NFS
      • 113 - Ident
      • 123 - NTP
      • 135 137 139 - RPC
      • 143 993 - IMAP
      • 161 - SNMP
      • 389 - LDAP
      • 139 445 - SMB
      • 873 - Rsync
      • 6379 - Redis
      • 6667 - IRC
  • Linux PrivEsc
    • Checklist
    • Enumeration
      • Important files
      • Memory Dump
    • Privileges Exploitation
    • Wildcard Exploits
    • Sudo Exploits
    • Docker Container
    • Docker Groups
    • Common Exploits
  • Windows PrivEsc
    • Checklist
    • Enumeration
      • Important Files
    • Antivirus evasion tools
    • Unquoted paths
    • Always install elevated
    • Vulnerable services
    • Client side
    • Exploitable privileges
      • Juicy Potato
    • UAC bypass
    • Common Exploits
  • Active Directory
    • Introduction
    • Checklist
    • Enumeration
    • Enable RDP
    • Kerberos
    • Rubeus
    • Credentials harvesting
      • Domain Controller specific
    • Connection
    • Pass The Hash
    • Kerberoast
    • ASREProast
    • Tickets
  • Web Attacks
    • Checklist
    • Enumeration
      • URL bruteforcing
    • APIs and Fields
    • Authentication
    • Filter Evasion
      • Fuzzying and encoding
    • File Vulnerabilities
      • LFI List
      • PHP shells
    • RCE
    • Code Injection
    • Dependency Injection
    • Joomla
    • Wordpress
    • WebDAV
    • HTTP
    • XSS
      • DOM Based
      • Reflected
      • Filter Evasion
    • SSI
    • SSTI
    • RCE
    • CSRF
    • SQL injection
      • sqlmap
      • PostgreSQL
      • Oracle
      • MSSQL
      • MySQL
      • Login
    • XPath injection
    • XXE
    • CORS
  • MOBILE PENTESTING
    • Static Code Analysis
    • Dynamic Code Analysis
    • Network Traffic Analysis
Powered by GitBook
On this page
  • Users
  • Who am i?
  • Other users
  • Try logging in
  • User files enumeration
  • Enumerate home folders
  • Writable files
  • OS
  • Arch and kernel
  • Env and modules
  • Enumerate possible defenses
  • Processes
  • Running
  • Scheduled tasks
  • Services
  • Installed software
  • Self-elevating binaries
  • Network
  • Interfaces
  • Processes (reveal localhost services)
  • Dump
  • Firewall
  • Drives
  1. Linux PrivEsc

Enumeration

Users

Who am i?

whoami
id
sudo -l
sudo --version
echo $PATH
printenv
(env || set) 2>/dev/null

Other users

w
who -a
cat /etc/passwd
cat /etc/sudoers
cat /etc/group

Try logging in

su <user>    #with or without password, try stupid things like root - root
su - <user>  #simulate full login
sudo su      #switch to root, requires sudo permission and knowledge of the user's password
sudo - su    #sometimes is allowed while the version without the - is blocked

User files enumeration

Enumerate home folders

find /home/*/ -type f 2>/dev/null
ls -lah /home/*
ls -lah /home/*/*

ls -lah /home/*/.ssh
ls -lah /home/*/.gnupg
ls -lah /home/*/.bash_history

Writable files

Owned files

find /etc /var /home /bin /usr /opt /tmp /mnt -type f -exec ls -lah '{}' \; 2>/dev/null | grep $(whoami)

Writable folders

find / -type d -exec ls -ld '{}' \; 2>/dev/null | grep $(whoami);

Writable files

find /etc /var /home /bin /usr /opt /tmp /mnt -writable -type f -exec ls -lah '{}' \; 2>/dev/null

OS

Arch and kernel

hostname
cat /etc/issue
cat /etc/*-release
uname -a
uname -m

Env and modules

sudo -V
lsmod
/sbin/modinfo <module name>

Enumerate possible defenses

AppArmor

if [ `which aa-status 2>/dev/null` ]; then
    aa-status
  elif [ `which apparmor_status 2>/dev/null` ]; then
    apparmor_status
  elif [ `ls -d /etc/apparmor* 2>/dev/null` ]; then
    ls -d /etc/apparmor*
  else
    echo "Not found AppArmor"
fi

Grsecurity

((uname -r | grep "\-grsec" >/dev/null 2>&1 || grep "grsecurity" /etc/sysctl.conf >/dev/null 2>&1) && echo "Yes" || echo "Not found grsecurity")

PaX

(which paxctl-ng paxctl >/dev/null 2>&1 && echo "Yes" || echo "Not found PaX")

Execshield

(grep "exec-shield" /etc/sysctl.conf || echo "Not found Execshield")

SElinux

 (sestatus 2>/dev/null || echo "Not found sestatus")

ASLR

cat /proc/sys/kernel/randomize_va_space 2>/dev/null
#If 0, not enabled

Processes

Running

ps aux

#list processes without ps or top
readlink -f /proc/*/exe
cat /proc/*/comm

Scheduled tasks

ls -lah /etc/cron*
cat /etc/crontab
cat /etc/cron-hourly
cat /etc/cron-daily
cat /etc/cron-weekly
cat /etc/cron-monthly

Services

Enumerate writable service files

find /etc -type f -name *.service -exec ls -lah {} \; | grep $(whoami)

Enumerate service manager type

pstree | head -3    #check first line. It may display either systemd or init

Enumerate init.d services

service --status-all                     #list all services
service --status-all | grep '\[ + \]'    #list running services
service <name> status                    #service info
ls -l /etc/init.d/*                      #list all service conf files

Enumerate systemd services

systemctl list-units --type=service                                  #list all services
systemctl --type=service --state=<active|running>                    #list running services
systemctl status <service>                                           #service info
systemctl list-unit-files --state=enabled                            #list conf files of active services
ls -l /etc/systemd/system /usr/lib/systemd/service | grep .service   #list service conf files

Installed software

dpkg -l
rpm -qa
pacman -Q

Self-elevating binaries

find / -perm -u=s -type f 2>/dev/null
find / -perm -g=s -type f 2>/dev/null
getcap -r / | grep cap_setuid

Network

Interfaces

ifconfig -a
ip a

Processes (reveal localhost services)

netstat -antp
ss -antp
lsof -i

Dump

cat /sbin/route(l)
cat /sbin/tables
cat /proc/net/*
cat /etc/aliases

Firewall

grep -Hs iptables /etc/*
cat /etc/iptables-backup
sudo cat /etc/iptables/*

Drives

mount
cat /etc/fstab
/bin/lsblk
ls -alhtr /mnt
ls -alhtr /media
PreviousChecklistNextImportant files

Last updated 1 year ago