Skip to content
Pwnversity
DFIR-INCIDENTESintermediate · 12 min · upd. 2026-11

Incident response

NIST SP 800-61r3NIS2RGPD

Incident response (IR) is the structured process of detecting a compromise, containing it, evicting the attacker, restoring service and learning so it does not happen again. Improvised IR destroys evidence, tips off the attacker and stretches the outage; prepared IR cuts impact, cost and legal risk. This page is the entry point to the DFIR area: from here you move on to system triage, chain of custody, memory forensics, disk forensics and cloud forensics.

An incident raises three questions at once, and they pull in different directions: how do I stop the damage?, what exactly happened? and who must I notify, and by when?. Shutting everything down answers the first and wipes out the second; investigating without containing lets the attacker keep working; forgetting the third turns a technical incident into a fine. IR exists to order those decisions with roles, criteria and deadlines agreed before anything happens.

The classic four-phase cycle (preparation; detection and analysis; containment, eradication and recovery; post-incident activity) came from NIST SP 800-61 r2 (2012). In April 2025 NIST published revision 3, which supersedes r2 and recasts IR as a NIST Cybersecurity Framework 2.0 profile: response is no longer an isolated block but is spread across the six CSF functions.

CSF 2.0 function Role in incident response
Govern IR policy, roles, authority to isolate systems, relationship with legal and leadership
Identify Inventory of critical assets and data; continuous improvement from past incidents
Protect Controls that reduce likelihood and impact (MFA, segmentation, immutable backups)
Detect Detection and analysis of adverse events (SIEM, EDR)
Respond Management, analysis, containment, eradication, notification and communication
Recover Verified restoration and communication about recovery

The practical idea behind r3 is that preparation and lessons learned are not phases of the incident but continuous work across the organization. The four classic phases are still useful as an operational script during the crisis, and that is how this page uses them.

flowchart LR
    P["Preparation<br/>(Govern · Identify · Protect)"] --> D["Detection and analysis<br/>(Detect)"]
    D --> C["Containment"]
    C --> E["Eradication"]
    E --> R["Recovery<br/>(Recover)"]
    R --> L["Lessons learned<br/>(Identify · improvement)"]
    L --> P
    D -. "scope changes" .-> C
    E -. "attacker returns" .-> D

Whatever does not exist before the incident will not be built well during it.

  • Plan and playbooks per scenario: ransomware, cloud account takeover, data leak, BEC (CEO fraud), insider. Each playbook says who decides to isolate, who talks to legal and who talks to the press.
  • Delegated authority: the on-call lead must be able to isolate a production server without waiting for a committee. If it is not written down, nobody does it at 3 a.m.
  • Out-of-band channel: phones and a chat room that do not depend on the compromised domain (see the Scattered Spider case below).
  • Prior visibility: centralized logs with enough retention, EDR deployed, Sysmon or equivalent on Windows and auditd on Linux. Without historical telemetry there is no way to know how long the attacker has been inside.
  • Response kit ready: a preconfigured triage collector (see system triage), memory acquisition, clean external drives, chain of custody forms.
  • Offline or immutable backups, tested with real restores (backups).
  • Contacts agreed in advance: national CSIRT, insurer, outside counsel, IR provider on retainer and the data protection authority.
  • Tabletop exercises at least once a year with leadership in the room.

The alert almost never says “incident”. It says “impossible travel sign-in”, “encoded PowerShell spawned by Word” or “a user cannot open their files”. The work in this phase is getting from event to incident with a defensible scope.

  1. Validate: false positive, unusual legitimate activity or real compromise? Check with the system owner and against telemetry.
  2. Classify and prioritize by functional impact, information impact and recoverability effort.
  3. Open the incident log from minute one: timeline, decisions and who took them. That log later feeds the regulatory notification and the final report.
  4. Scope it: affected hosts, accounts, data and time window. IOCs from the first host are hunted across the whole fleet (threat hunting).
  5. Preserve before touching: acquire memory and a triage collection from key systems following the order of volatility (see chain of custody).

Questions the analysis must answer before eradication:

Question Typical source
What was the initial access? VPN/IdP logs, email, web server logs, Windows artifacts
Which accounts does the attacker control? Authentication events, changes to privileged groups, IdP logs
What persistence did they leave? Services, scheduled tasks, Run keys, WMI, cron, systemd, OAuth apps
Did they move laterally? 4624 type 3/10 events, RDP, WinRM, SMB, network traffic
Did they exfiltrate data? Proxy, NetFlow, upload volume, tools like rclone on the host
Since when? A timeline tying all of the above together

Containment limits the damage without destroying evidence or tipping off the attacker too early.

  • Short term: isolate hosts at the network level (EDR isolation or a quarantine VLAN) instead of powering them off; powering off wipes memory, which may hold encryption keys, injected processes and live connections.
  • Accounts: disable or force a password change and invalidate sessions and tokens (revoke refresh tokens at the IdP); changing only the password does not evict someone who already holds a valid token.
  • Network: block C2 domains and IPs at the perimeter and in DNS.
  • Long term: keep the business running on clean systems while eradication is prepared.

Remove everything the attacker left behind. Whatever is missed becomes their way back in.

  • Remove malware, webshells, remote access tools and accounts created by the attacker.
  • Remove every persistence mechanism identified during analysis (malware persistence, AD persistence).
  • Fix the vulnerability or misconfiguration used for initial access.
  • Rotate credentials broadly: privileged accounts, service accounts, application secrets and API keys.
  • In a domain compromise, reset the krbtgt password twice, waiting between resets at least the maximum ticket lifetime (10 hours by default) so replication and legitimate sessions do not break. The directory keeps the current and the previous password; after a single reset, Golden Tickets signed with the previous one remain valid.
  • When a system’s integrity is in doubt, rebuilding from a clean image is more reliable than “cleaning”.
  • Restore from backups verified to predate the compromise and scanned: restoring a backup that already contains the persistence reinfects the environment.
  • Return to production gradually and with heightened monitoring for weeks, watching for the incident IOCs.
  • Prioritize identity: without a trustworthy directory nothing else can be rebuilt (see the Maersk case).
  • Record the real RTO against the target and feed it into the continuity plan.

A blameless meeting within two weeks of closing the incident:

  • What happened, when was it detected and how long did each phase take?
  • What worked, what failed and what was missing (logs, permissions, contacts)?
  • Concrete actions with an owner and a date: new detection rules, architecture changes, training.
  • Metrics tracked over time: time to detect, time to contain, number of affected systems.

In the EU, notification is not optional and runs on its own clock, which starts when the organization becomes aware of the incident, not when the investigation ends.

Regulation To whom Deadline
NIS2 Art. 23 — significant incident CSIRT or competent authority Early warning within 24 h; incident notification within 72 h with an initial assessment of severity, impact and available IOCs; final report within one month of the notification (or a progress report if still ongoing)
GDPR Art. 33 — personal data breach Supervisory authority (in Spain, the AEPD) Without undue delay and, where feasible, within 72 h; if later, the reasons for the delay must be given
GDPR Art. 34 Affected individuals Without undue delay when the breach is likely to result in a high risk to their rights

Anti-forensics and evasion during the response

Section titled “Anti-forensics and evasion during the response”

The attacker keeps playing during the incident:

  • Log wiping: clearing the Windows event logs (generates event 1102 in Security and 104 in System), history -c or deleting /var/log on Linux. This is why logs must be shipped to a central system the attacker does not control.
  • Timestomping: altering file timestamps to hide them in the timeline.
  • Living off the land (LOLBins): using legitimate system tools so no custom binaries are left behind.
  • Spying on the response: reading the security team’s email or joining incident calls to anticipate containment.
  • Disguised wipers: malware that looks like ransomware but only destroys; the “negotiation” is a distraction (ransomware).
  • Scattered Spider (FBI/CISA joint advisory AA23-320A, November 2023, updated July 2025): the advisory documents that the group frequently joined victims’ incident response and remediation calls and conferences, likely to see how they were being hunted and adapt the intrusion. Direct lesson: the crisis channel must be out of band and every participant’s identity verified.
  • Maersk and NotPetya (2017): the malware destroyed the shipping company’s domain controllers within hours. Recovering the directory was possible because a domain controller in the Ghana office was offline due to a power cut when the attack hit. Lesson: identity is the first thing you must be able to rebuild, and relying on luck is not a plan; you need offline directory backups and a rehearsed forest recovery procedure.
  • IR plan and per-scenario playbooks approved by leadership
  • Delegated authority to isolate systems without waiting for a committee
  • Out-of-band communication channel and participant verification
  • Centralized logs with enough retention, out of the attacker’s reach
  • Triage kit and memory acquisition tested
  • Incident log opened from the first alert
  • Evidence preserved before containing or rebuilding
  • Coordinated containment; sessions and tokens revoked, not just passwords
  • Complete eradication: persistence, accounts, initial access, krbtgt ×2 where applicable
  • Restore from backups verified as clean
  • NIS2 (24 h / 72 h / 1 month) and GDPR (72 h) notifications assessed and documented
  • Lessons learned with actions, owners and dates