Interview Prep/Linux/Security, hardening and incident response

You find a crypto-miner using 100% CPU under the `www-data` user. Beyond killing it, what do you do?

AdvancedScenarioSecurity, hardening and incident response
Answer

Situation read → The web app was exploited; the miner is just the symptom.

What I'd do →

  1. Capture ps, ls -l /proc/<PID>/exe, cat /proc/<PID>/cmdline, ss -tnp before killing.
  2. Find persistence: crontab -l -u www-data, /tmp, /var/tmp, /dev/shm, systemd user units, .bashrc.
  3. Find the entry point in the web logs (RCE, upload of a webshell).
  4. Rebuild the server, patch the app, rotate secrets the app could read.
  5. Add prevention: noexec on /tmp and /dev/shm, egress filtering, and a systemd sandbox for the web service.

Why → If you only kill the process, the cron entry restarts it in a minute.

Interview tip → Mention egress restriction; miners and reverse shells need outbound access.

All Linux questions Roadmap: Linux

More on Security, hardening and incident response