external attack surface is key
- Determine which services should be accessible.
- Block (firewall) or stop services that shouldn't be.
- Secure services that should be.
- Update to latest version
- Check Attack Vectors
- Remove things that run on a "schedule" or "when a specific event occurs".
- Prepare for active defence. (Wireshark and/or auditing)
- Check for privilege escalation or persistence attack vectors.
Note: If server is really outdated, don't worry about 6 because there's nothing you can do unless there's potential to escalate through a service.
- Change root and user passwords
- Remove unneeded users
- Check group membership and sudo permissions
- Upgrade outdated packages
- Check cron and anacron (if applicable) jobs
/etc/crontab,/etc/cron.allow,/etc/cron.*directories and/var/spool/cron- same files/folders as above but replace
cronwithanacron - For competitions, easiest is to disable the cron service with
systemctl disable cronorcrond
- Check systemd timers
- Check running processes
- Apply host firewall
- I'd use
ufw,firewalld,iptables,nftablesin that order
- I'd use
- Configure and secure externally-accessible services (depends on service)
- Backup required directories both locally and remotely
- Easiest way is to
tarzip the directory then access remote backup server throughsftp
- Easiest way is to
- Set up command line auditing
- Start Wireshark capture
If in a competition, I would make services accessible at this point because your external attack surface is minimised. The rest can be done on the fly.
- Check open ports - consult the port closing flowchart
- Check enabled (startup) services
- Check running services
- Check additional privilege escalation attack vectors
- world readable/writable dirs/files
- writable files for each user
- SUID/SGID binaries
probably too advanced for limited-time competitions like NCAE Cyber Games, but if you're feeling adventurous, here are some ideas
- antivirus: ClamAV
- network IDS/IPS: Snort
- SIEM: Wazuh
- WAF: ModSecurity