Contain and Investigate a Compromised Linux Web Server

8 steps · about 2 h 42 min · Intermediate

  1. Set forensic priorities before touching the host (doc, NIST, 16 min)

    Clear roles and objectives reduce the chance that urgent containment destroys evidence or expands the outage.

  2. Frame containment and recovery from malicious code (doc, NIST, 28 min)

    The malware-handling lifecycle keeps technical actions connected to analysis, containment, eradication and lessons learned.

  3. Preserve evidence in order of volatility (doc, IETF Datatracker, 22 min)

    Memory, network state and running processes can disappear before disks are copied, so acquisition order matters.

  4. Record active network state (tutorial, Linux man-pages, 14 min)

    Per-process network views can reveal unexpected listeners and remote command channels while preserving raw evidence.

  5. Capture process timing and execution state (tutorial, Linux man-pages, 16 min)

    Process state, parentage, timing and execution details help connect suspicious activity to services and sessions.

  6. Check common transient persistence locations (tutorial, systemd, 18 min)

    Temporary-file rules and runtime directories help explain what should exist and what may have been planted.

  7. Hunt scheduled-task persistence (doc, MITRE ATT&CK, 18 min)

    Cron and systemd timers are common persistence mechanisms that need both configuration and execution evidence.

  8. Hunt web-shell persistence before rebuilding (tutorial, MITRE ATT&CK, 30 min)

    A clean recovery must remove the initial access and persistence paths while preserving indicators for wider hunting.