A lightweight Bash utility for auditing Linux file permissions and identifying common permission-related security issues.
The tool recursively scans a target directory and provides an interactive menu for inspecting different types of permission configurations commonly encountered during Linux system administration and security assessments.
- π Scan directories recursively
- π Detect files with unexpected permissions
- π Identify SUID files
- π₯ Detect SGID files
- π Check Sticky Bit status
- π Find world-writable files
- π€ Display file ownership information
- π₯οΈ Interactive terminal menu
- β‘ Lightweight (pure Bash)
The utility currently supports the following checks:
| 1 | Files with unexpected permissions (based on built-in permission rules) | | 2 | Detect SUID files | | 3 | Detect SGID files | | 4 | Check Sticky Bit | | 5 | Find World Writable files | | 6 | Verify file ownership | | 7 | Exit |
The script requires:
- Linux
- Bash
- find
- stat
- Standard GNU utilities
No additional packages are required.
Make the script executable:
chmod +x permission-auditor.shRun the auditor:
./permission-auditor.sh /path/to/directoryExample:
./permission-auditor.sh /var/www
======================================
Linux Permission Auditor
======================================
1) Files with 777 permissions
2) SUID files
3) Files with SGID
4) Sticky Bit
5) World Writable
6) Owner verification
7) Exit
Select the desired audit option from the interactive menu.
The script contains a built-in permission policy for common file extensions.
Example:
| sh | 755 | | py | 755 | | html | 644 | | css | 644 | | js | 644 | | txt | 644 | | json | 644 | | conf | 600 | | env | 600 | | key | 600 | | pem | 600 |
If an extension is not listed, the auditor reports it as an Unknown extension.
- The supplied path must be an existing directory.
- The utility is intended as a lightweight auditing tool.
- It is designed for educational purposes and basic permission analysis.
- It is not a replacement for professional security auditing software.
- Bash
- find
- stat
- grep
- Linux file permissions
- SUID / SGID / Sticky Bit