Incident Response Plan
Incident Response Plan
- Environment: Tools (ELK Stack, Wazuh, TheHive, MISP, Cortex) are properly
configured and integrated
- Training: Watching more than a video demo
Identification:
- Monitoring :
Wazuh for endpoint detection and response
ELK Stack Vizualizing log data
Zeek for network traffic analysis
-Alert Generation:
Rules:
Attack1: Web Server Scan
Web Scanner Activity - Nmap: event.dataset: "zeek.http" and user_agent.original:
*Nmap*
Excessive Web Traffic: event.dataset: "zeek.http" > source.ip and destination.ip
>=1000 in 5min
-Initial Triage:
Verify alerts triggered by the rules
Assess the serverity and potential impact of the incident
Containment
-Disable network access for the affected system;, isolate it.
Windows:
Open Command Prompt as Administrartor and run: netsh interface set interface
"Ethernet" admin=disable
Control Panel > Network and Sharing Center > Change adapter settings
Linux:
cmd: sudo ifconfig eth0 down
-Or Automating Isolation with Wazuh Active Response
Create script
Configure isolate-endpoint in /var/ossec/etc/ossec.conf
Eradication
-Identify Root Cause
Conduct a thorough Investigation
Use Cortex for analyzing observables (IP, email addresses, URLs, domain names..)
-Remove Malicious Components
Attack1: Verify no unauthorized access
Checking Web Server Logs: Using PowerShell command to filter logs for suspicious
IP
Example: Select-String -Path "C:\path\to\server.log" -Pattern "Nmap"
Review Recent Changes: Review any changes made to the system that could indicate
unauthorized access or modifications.
Check Installed Programs: Look for any recently installed programs that you did
not authorize
Get-WmiObject -Class Win32_Product | Select-Object -Property Name, InstallDate |
Sort-Object -Property InstallDate
Check User Accounts: Ensure no unauthorized user accounts have been created.
Example command to list user accounts:
Get-LocalUser | Select-Object -Property Name, Enabled, LastLogon
Check for Scheduled Tasks: Look for any suspicious scheduled tasks.
Example command to list scheduled tasks:
Get-ScheduledTask | Where-Object { $_.State -eq "Ready" -or $_.State -eq
"Running" } | Select-Object -Property TaskName, State
Summary
Check Web Server Logs:
Review logs for any suspicious activity, such as unusual IP addresses or user
agents.
Check System Logs for Unauthorized Access:
Use Event Viewer to look for signs of unauthorized access in Security and
Application logs.
Verify Integrity of Web Server Files:
Use PowerShell to check for recently modified files and compare them against known
good backups.
Review Recent Changes:
Check for unauthorized installed programs, user accounts, and scheduled tasks.
Identify and remove the keylogger and any associated malicious scripts.
Example command to identify running processes and remove malicious ones:
Get-Process | Where-Object { $_.Path -like "*keylogger*" } | Stop-Process -Force
Check for any ongoing data exfiltration processes and terminate them.
Example command to monitor and terminate FTP connections:
Get-NetTCPConnection -RemotePort 21 | Stop-Process -Force
Ensure all security configurations are reviewed and hardened to prevent similar
attacks.
Example actions include:
Enabling two-factor authentication.
Regularly updating software and operating systems.
Conducting regular security audits and vulnerability assessments.
Summary
Identify Root Cause:
Attack 1: Verify no unauthorized access or changes to the web server, restore from
backups, apply patches.
Attack 2: Remove malicious files/scripts, restore system integrity, re-enable
Windows Defender, apply patches.
Attack 3: Remove keylogger and related scripts, clean registry, ensure no data
exfiltration, verify system integrity.
Document All Steps:
Ensure all actions taken are documented for compliance, review, and future
learning.
Recovery
Restore Systems
Objective: Restore systems from clean backups, ensuring all patches and updates are
applied.
Open Control Panel and go to System and Security > Backup and Restore (Windows 7).
Click Restore my files and follow the wizard to restore from a backup.
Using PowerShell to Restore Files from a Backup:
# Copy files from backup directory to original location
Copy-Item -Path "C:\Backup\WebServer\*" -Destination "C:\Path\To\Web\Server" -
Recurse -Force
# Install updates
Install-WindowsUpdate -AcceptAll -AutoReboot
2. Monitor Systems
Objective: Increase monitoring on restored systems to detect any signs of recurring
issues and validate the integrity of restored systems before returning to
production.
Steps:
1. Post-Incident Review
Objective: Conduct a thorough review of the incident to understand what happened,
how it was handled, and what can be improved.
Steps:
Include all relevant stakeholders: SOC team, IT staff, management, and any affected
business units.
Conduct a Detailed Review:
Steps:
Steps:
Update incident response policies and procedures based on the incident review.
Implement improvements to address identified gaps and enhance response
effectiveness.
Training and Awareness:
Conduct training sessions for the SOC team on updated procedures and best
practices.
Increase awareness among employees about new threats and preventive measures
through regular training and communication.
By following these steps, you can ensure that your organization continuously
improves its incident response capabilities and reduces the likelihood of future
incidents.
Final Notes
Documentation: Ensure every step of the incident response process is documented for
compliance and review purposes.
Continuous Improvement: Regularly update your incident response plan based on the
evolving threat landscape and past incident reviews.
Integration: Ensure that all tools (ELK, Wazuh, TheHive, MISP, Cortex) are well
integrated to provide a cohesive security monitoring and incident response
capability.