Skip to content
Tutorials Center
My learning

Topics

Lesson 32 of 37 ยท Reporting and Response

Handing Off to Incident Response: Scoping and Containment

Turn analysis results into incident response actions: scope the infection with indicators, contain and eradicate safely, preserve evidence, and learn from it. Includes runnable log-hunting models.

An analyst answers "what is this file and what does it do?" An incident responder answers "which of our systems are affected, how do we stop it, and how do we get back to normal?" The two jobs depend on each other. Your findings tell the responders what to look for; their findings (new samples, new hosts, new tools) feed back into your analysis. This lesson shows how to hand over what you know and how responders use it.

The material is conceptual, with invented logs. The Python stand-ins search small made-up log lists for your indicators, which is the logic of the searches a security operations team runs in its log platform. Nothing here touches real systems.

Incident response phases

Prepare Tools, logging, playbooks.
Detect and analyse Confirm and scope.
Contain, eradicate, recover Stop it, remove it, restore.
Lessons learned Improve for next time.

Based on the common NIST-style cycle.

1 / 2

What responders need from you

Good analysis hand-offs answer these questions in the first page:

  1. Is it malicious, and how sure are you? Confidence changes how aggressively people act.
  2. What does it do? Capability in plain words: steals saved passwords, installs a backdoor, encrypts files.
  3. How does it get in and spread? Delivery vector, whether it moves laterally or only runs on one host.
  4. What should we search for? Hashes, file paths, registry keys, mutexes, domains, IP addresses, user agents, scheduled task names, with the defanged format from the indicators lesson.
  5. How does it persist? Responders need exact locations to remove it and to confirm removal.
  6. What data could be affected? Credentials, documents, browser data. This drives password resets and notification decisions.
  7. What do you not know? Missing second stage, unobserved commands, uncertainty about the actor.

Add detection content (the YARA and Sigma rules) and an ATT&CK-style behaviour table so detection engineers can check coverage.

Scoping: how far did it spread?

Scoping means finding every affected system, account and data store. Start with your indicators and search wide:

  • Endpoint telemetry: process creation events, file creation by path or hash, registry changes, scheduled tasks and services.
  • Network logs: DNS queries for the domains, proxy and firewall connections to the IPs, unusual ports and user agents.
  • Email and web gateways: who received the delivery message, who clicked.
  • Authentication logs: accounts used from unusual hosts, since many families steal credentials.

Search in both directions: look forward from the first known infected host (what did it contact next?), and backward (how did it get in?). Record the first and last time each indicator appears: those dates define the window of compromise and tell you how far back you must investigate.

The first stand-in looks for a few made-up indicators in a list of proxy log lines, counts the distinct hosts, and reports the earliest and latest time.

Python Hunt indicators in proxy logs

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The search finds two hosts. A responder would now check each one's endpoint logs for the file and registry indicators, because a single proxy log can miss infected hosts that did not reach the internet in the period covered. Notice that pc-014 also contacted a raw IP after the beaconing: that is a lead for the second stage the analysis could not recover.

Containment

Containment limits damage while you investigate. Typical actions, from least to most disruptive:

  • Block the indicators: domains and IPs at DNS, proxy and firewall; hashes in endpoint protection.
  • Isolate affected hosts from the network (many endpoint products can do this remotely while keeping a channel for investigators).
  • Disable or reset compromised accounts and revoke sessions and tokens.
  • Preserve evidence first. Before powering off or reimaging, capture what you need: memory image (volatile data disappears at shutdown), disk image or triage collection, relevant logs. Record who did what and when.

Responders weigh business impact: isolating a production server may cost more than the infection. Your confidence level and the malware's behaviour (does it spread, does it destroy data) inform that choice.

Eradication and recovery

Eradication removes the malware and everything that lets it return: the executable, persistence entries (Run keys, tasks, services), any dropped tools, malicious accounts and changed settings. Your analysis supplies the removal list; the responders must verify it, for example by searching again for each indicator on the cleaned host. For serious compromises, the safest option is to rebuild from a known-good image rather than to clean in place, because you can rarely prove nothing else was changed.

Recovery restores systems and data, with heightened monitoring afterwards for the indicators and for behaviours of the family. Passwords and keys that the malware could have read must be rotated, not only on the infected host but wherever those credentials work.

A cleanup checklist from analysis notes

The second stand-in turns the persistence findings of an analysis into a verification checklist, then checks it against a made-up host snapshot. It shows how analysis facts become concrete, testable steps.

Python Turn persistence findings into a verification checklist

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The file is gone but the Run key and the scheduled task survived, so the machine would reinfect at the next logon. This is the classic mistake in cleanup: removing the visible file and forgetting persistence.

Lessons learned

After recovery, hold a short review without blame. Useful questions: How did it get in, and what would have stopped it earlier? How long was the window of compromise, and why was it not detected sooner? Which detections fired, which did not, and which new ones should be added? Did the playbook work? Feed the answers into your ATT&CK coverage map and into the detection backlog, and update the analysis notes with anything the responders found, such as the initial delivery method or additional tools.

Only investigate and act on systems you are authorised to handle. Containment actions such as isolating hosts or resetting accounts belong to the incident response process and its decision makers, not to a single analyst's judgement.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why capture a memory image before powering off an infected host?

    Memory holds evidence that disappears when the machine is off.
  2. 2. What does the window of compromise tell responders?

    First and last seen times for the indicators define the period to examine.
  3. 3. A cleaned host still has the malware's Run key. What is the risk?

    Persistence entries must be removed along with files, then verified.
  4. 4. Which hand-off item helps responders decide how aggressively to act?

    Confidence and capability determine proportionate containment.

Summary

  • Hand over verdict and confidence, capability, delivery and spread, indicators, persistence, data at risk and unknowns.
  • Scoping searches endpoints, network, email and authentication logs forward and backward to define the window of compromise.
  • Contain by blocking, isolating hosts and resetting credentials, but preserve evidence first.
  • Eradicate persistence as well as files, verify by searching again, and rebuild when trust is lost.
  • Rotate credentials the malware could have read.
  • Run a blameless review and feed results back into detections and analysis.

Next: Sharing Intelligence Safely