NCAE Mapping Hub
Overview Scoreboard Data Roles Exercised Checklists Lessons Skill Drills Practice Terminal Progress
published priority 6 30 min. 60 XP.

Backups + Cron = Self-Healing Configs

Even a basic 60-second cron that restores critical configs from a known-good tarball will undo most red-team tampering automatically. This lesson covers the 3 parts: capturing the golden snapshot, writing the restore script, and wiring it up in cron.

Objectives

Quick reference

CommandPurpose
tar -czf /root/golden.tar.gz /etc/ssh /etc/samba /etc/bind /etc/apache2 /etc/postgresql Create golden tarball
tar -xzf /root/golden.tar.gz -C / Restore into place
crontab -e Edit current user's crontab
crontab -l List current user's crontab
systemctl list-timers See active systemd timers (cron alternative)
journalctl -u cron --since '10 minutes ago' Verify cron fired

Common pitfalls

Skill drills

  1. 1. Cron line for 'every minute'?
    * * * * *
  2. 2. Command to list your crontab?
    crontab -l
  3. 3. Tar flag for gzip compression?
    -z (as in -czf)
  4. 4. Where cron stores per-user crontabs on most Linux?
    /var/spool/cron/crontabs/

NCAE scoreboard patterns this lesson prevents