Defensive security · Lesson 2 of 2

Incident response: what to do when things go wrong

The incident response lifecycle explained for beginners, plus a step-by-step plan for when your own account or device gets hacked.

⏱ 15 min🎯 Beginner🧪 Hands-on✅ 4-question quiz✓ Completed

By the end, you’ll be able to…

  • Describe the phases of incident response
  • Explain why preserving evidence and staying calm matter
  • Follow a personal recovery plan when an account is hacked

Key words

Incident
An event that actually harms, or threatens, the security of systems or data.
Containment
Stopping the damage from spreading, for example by isolating a device.
Eradication
Removing the cause: deleting malware, closing the hole, resetting stolen passwords.
Recovery
Getting systems back to normal and making sure they stay clean.
Lessons learned
Reviewing what happened afterwards, so it doesn’t happen again.
Forensics
Carefully collecting and examining digital evidence.

See all 127 words in the glossary →

Incidents happen to everyone

Even well-defended organisations have incidents. What separates a bad day from a disaster is how they respond. Incident response (IR) is a calm, practised plan for exactly that moment.

The incident response lifecycle

The US National Institute of Standards and Technology (NIST) describes a classic cycle in its incident handling guide (SP 800-61). NIST updated that guide in 2025 to line up with its Cybersecurity Framework, but these phases are still the clearest way to learn:

  1. Prepareplans, contacts, backups, logging
  2. Detect & analyseis it real? how big?
  3. Containstop the spread
  4. Eradicate & recoverremove the cause, restore
  5. Lessons learnedimprove for next time
The cycle repeats: what you learn feeds into better preparation.
  • Prepare: know who to call, keep backups, turn on logging. Most of IR happens before the incident.
  • Detect & analyse: confirm it’s real, then work out what’s affected. This is where the blue team’s alerts and logs come in.
  • Contain: isolate infected machines, disable stolen accounts, block attacker addresses.
  • Eradicate & recover: remove malware, patch the hole, reset credentials, restore from clean backups, and watch closely.
  • Lessons learned: a blameless review. What worked? What should change?

Evidence matters

It’s tempting to immediately wipe everything. But evidence tells you how the attacker got in. Without it, you might rebuild with the same hole still open. Responders often capture memory and disk images first. Free tools like Autopsy help investigators examine disk images afterwards.

✅ Do
  • Write down what you saw and when
  • Disconnect from the network to contain
  • Tell the right people quickly
  • Change passwords from a clean device
⛔ Don’t
  • Panic-delete files and logs
  • “Hack back” the attacker (that’s illegal too)
  • Pay ransoms or scammers on your own
  • Hide it because you feel embarrassed
Mistakes during an incident usually come from rushing. Slow is smooth, smooth is fast.

Your personal incident plan: “my account got hacked”

The same phases work at home. If someone takes over your email, games or social account:

  1. Secure the email firstit can reset everything else
  2. Change the passwordfrom a clean device
  3. Sign out everywherekills stolen sessions
  4. Turn on MFAideally passkey or authenticator
  5. Check for changesforwarding rules, recovery info, new apps
  6. Warn friendsattackers often message your contacts
If you can’t get in, use the platform’s official account recovery page. Never pay someone who offers to “recover” it.

Also change the password on any other site where you reused it, and check your devices for malware (see Malware, updates & backups), because infostealers are a common cause.

Who to tell

  • A parent, guardian or trusted adult, especially if money, threats or personal photos are involved.
  • Your school or workplace IT team if it involves their accounts or devices. They’d much rather know early.
  • The platform, using its official reporting tools.
  • For crimes like fraud or extortion, the police. In the US, also ReportFraud.ftc.gov, and IdentityTheft.gov for identity theft. Other countries have their own official services.
🤔 Something not clicking?

🧪 Hands-on

Practice

Put the incident response phases in the right order. Tap them in sequence.

Then use this checklist if one of your accounts is ever taken over. Ticks are saved in this browser.

✅ Check yourself

Quick quiz

Every answer comes with an explanation, right or wrong. Your best score is saved in this browser.

Q1. Malware is found on one laptop in a school. What should usually happen first?
Q2. Why is it risky to immediately delete everything after an incident?
Q3. Your social account is taken over. Which account should you secure first?
Q4. What is the goal of a lessons-learned review?

What’s next

Up next · new track: Security toolsBuild a safe practice lab →Set up a free home cybersecurity lab with VirtualBox or UTM, Ubuntu and Kali Linux, snapshots and isolated networks, so you can practise safely.⏱ 20 min