Skip to content

Instantly share code, notes, and snippets.

@todd-dsm
Created May 23, 2014 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todd-dsm/adb303e265cfbdf1a7f0 to your computer and use it in GitHub Desktop.
Save todd-dsm/adb303e265cfbdf1a7f0 to your computer and use it in GitHub Desktop.
# Find and World-Writable files criteria:
# 1) files but not hard/soft links
# 2) in any directory except: /proc, /dev, libs, or /sys
# 3) with +o=w permissions
# 4) print it all to a file
find / \( -type f -o ! -type l \) \
-name "proc" -prune -o -name "dev" -prune -o -name "sys" -prune \
-o -name "lib" -prune -o -name "lib64" -prune \
-o -perm 0002 -o ! -perm 777 -o ! -perm 775 \
\( -printf '%#m %u %g %p\n' \)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment