A Python-based Linux security auditing tool that scans for common misconfigurations and generates security reports.
Built to practice Linux security concepts, Python automation, and basic security assessment techniques.
- Check SSH root login status
- Check SSH password authentication status
- Check firewall status
- List sudo users
- Detect world-writable files
- Detect executable files
- List open ports
- Audit a custom directory for world-writable and executable files
- Generate terminal reports
- Export reports to TXT and JSON format
linux-security-audit/
├── src/
│ ├── checks.py # security checks (SSH, firewall, sudo, ports, files)
│ ├── reporter.py # report generation and TXT/JSON export
│ └── main.py # CLI entry point
├── reports/ # generated audit reports
└── README.md
git clone https://github.com/yugg755i/linux-security-audit.git
cd linux-security-audit- Python 3.10+
- Linux system
- Standard Python libraries only
Run the audit:
python src/main.pySave report as TXT:
python src/main.py --save-txtSave report as JSON:
python src/main.py --save-jsonAudit a specific directory:
python src/main.py --path /var/wwwSave both formats:
python src/main.py --save-txt --save-json[HIGH] Root SSH login enabled
[MEDIUM] Password authentication enabled
[INFO] Firewall active
[INFO] 1 sudo users found: admin
[MEDIUM] 5 world-writable files found
[INFO] 1042 executable files found
[INFO] 6 open ports: 22,80,443,3306,5432,8080
Findings are categorized as HIGH, MEDIUM, or INFO based on severity.
- Python 3.10+
- Standard library only (no external dependencies)

