nbayoungboyavatarfag !!gd2wBdoT4c
ID:DsD8fjsV
No.4138895
Report
#!/bin/bash
# OpSec & System Security Health Check Script
echo "=========="
echo " System Hardening & OpSec Check "
echo "=========="
sleep 1
# 1. Firewall Check
echo -e "\n[*] Checking Firewall Status…"
if command -v ufw > /dev/null; then
sudo ufw status verbose
elif command -v firewall-cmd > /dev/null; then
sudo firewall-cmd –state
else
echo "[-] No standard firewall management tool (UFW/firewalld) detected."
fi
# 2. SSH Configuration Hardening Check
echo -e "\n[*] Auditing SSH Configuration (/etc/ssh/sshd_config)…"
if [ -f /etc/ssh/sshd_config ]; then
echo "Checking Root Login setting:"
grep -i "^PermitRootLogin" /etc/ssh/sshd_config || echo " -> PermitRootLogin not explicitly set."
echo "Checking Password Authentication setting:"
grep -i "^PasswordAuthentication" /etc/ssh/sshd_config || echo " -> PasswordAuthentication not explicitly set."
else
echo "[-] SSH server configuration file not found."
fi
# 3. Open Ports Check
echo -e "\n[*] Checking Active Network Connections & Listening Ports…"
if command -v ss > /dev/null; then
ss -tulpn | grep LISTEN
else
netstat -tulpn | grep LISTEN
fi
# 4. File Permissions Check
echo -e "\n[*] Checking file permissions on sensitive paths…"
ls -ld /etc/shadow /etc/passwd
echo -e "\n=========="
echo "[+] Audit complete."
echo "=========="