WEBTOOLIST.
STATIC WEB PLATFORM
NO ACCOUNTS / NOTHING TO INSTALL

$ webtoolist --script file-permission-audit

File Permission Audit

Find world-writable files and directories, excluding known-safe locations.

category Security shell Bash 4+ updated 2026-09-03
permissionsauditsecurityfind
Safety notes
  • Read-only: lists permissions, does not change them.
  • Some world-writable paths are normal (e.g. /tmp); the default excludes cover the common ones.

Dependencies: find

Usage

  • Pass a root directory (default /).
  • Set LIMIT to cap the output (default 50).

Script

#!/usr/bin/env bash
set -euo pipefail

root="${1:-/}"
limit="${LIMIT:-50}"

find "$root" -xdev \
  \( -path /proc -o -path /sys -o -path /dev -o -path /run -o -path /tmp -o -path /var/tmp \) -prune -o \
  -type f -perm -0002 -print 2>/dev/null \
  | head -n "$limit"

Example

sudo ./file-permission-audit /
sudo LIMIT=200 ./file-permission-audit /srv

Notes

  • A world-writable file is not automatically a vulnerability, but it deserves a reason.
  • Use namei -l PATH to see the full permission chain for a specific file.

Related scripts

SSH Hardening Audit

Inspect sshd configuration for common risky settings without changing anything.

Security

Find Large Files

Locate files above a size threshold and show them largest first.

File Management

Fuzzy Find Helper

Search filenames interactively with fzf when available, falling back to find.

Shell Productivity