Interview Prep/Linux/Firewalls, MAC & Compliance

How do you find world-writable files and other risky permissions?

BeginnerProductionFirewalls, MAC & Compliance
Answer
sudo find / -xdev -type f -perm -0002 -ls 2>/dev/null           # world-writable files
sudo find / -xdev -type d -perm -0002 ! -perm -1000 -ls 2>/dev/null   # world-writable dirs without sticky bit
sudo find / -xdev \( -perm -4000 -o -perm -2000 \) -type f 2>/dev/null   # SUID/SGID

Run these in scheduled compliance scans and compare against a known-good baseline.

All Linux questions Roadmap: Linux

More on Firewalls, MAC & Compliance