Contains active security breaches by isolating systems, blocking attacker comms via firewalls/DNS, quarantining endpoints with EDR, and preserving evidence. For live incident response.
npx claudepluginhub killvxk/cybersecurity-skills-zhThis skill uses the workspace's default tool permissions.
- 在网络或系统上检测到活跃的未授权访问
Executes containment strategies to stop active adversaries during confirmed breaches, preventing lateral movement via network segmentation, endpoint isolation, credential revocation, and access controls. For incident response in live threats.
Executes containment strategies for active security breaches using network segmentation, endpoint isolation, credential revocation, and access controls to halt lateral movement. For live incident response.
Executes incident response containment for active breaches: assesses scope, isolates endpoints via EDR, segments networks, revokes credentials to stop lateral movement.
Share bugs, ideas, or general feedback.
# 在 SIEM 中检查关联告警 - Splunk 示例
index=security sourcetype=ids_alerts severity=critical
| stats count by src_ip, dest_ip, signature
| where count > 5
| sort -count
# 通过 CrowdStrike Falcon API 验证端点告警
curl -X GET "https://api.crowdstrike.com/detects/queries/detects/v1?filter=status:'new'+max_severity_displayname:'Critical'" \
-H "Authorization: Bearer $FALCON_TOKEN"
# 识别所有与攻击者 C2 通信的系统
# 使用 Zeek 连接日志
cat conn.log | zeek-cut id.orig_h id.resp_h id.resp_p duration orig_bytes resp_bytes \
| awk '$3 == 443 && $5 > 1000000' | sort -t$'\t' -k5 -rn | head -20
# 检查 Windows 事件日志中的横向移动
wevtutil qe Security /q:"*[System[(EventID=4624)] and EventData[Data[@Name='LogonType']='3']]" /f:text /c:50
# 查询 Active Directory 中最近的认证异常
Get-WinEvent -FilterHashtable @{LogName='Security';ID=4625} -MaxEvents 100 |
Group-Object -Property {$_.Properties[5].Value} | Sort-Object Count -Descending
# 在边界防火墙阻断攻击者 IP(Palo Alto 示例)
set cli pager off
configure
set rulebase security rules emergency-block from any to any source [attacker_ip] action deny
set rulebase security rules emergency-block from any to any destination [attacker_ip] action deny
commit force
# 在交换机层面隔离受攻陷 VLAN(Cisco)
configure terminal
interface vlan 100
shutdown
end
write memory
# 在 DNS 层面阻断 C2 域名
# 添加到 DNS Sinkhole 或 RPZ
echo "attacker-c2-domain.com CNAME ." >> /etc/bind/rpz.local
rndc reload
# CrowdStrike - 通过 API 对主机进行网络遏制
curl -X POST "https://api.crowdstrike.com/devices/entities/devices-actions/v2?action_name=contain" \
-H "Authorization: Bearer $FALCON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"ids": ["device_id_1", "device_id_2"]}'
# Microsoft Defender for Endpoint - 隔离计算机
curl -X POST "https://api.securitycenter.microsoft.com/api/machines/{machineId}/isolate" \
-H "Authorization: Bearer $MDE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"Comment": "IR-2024-001: 活跃攻陷遏制", "IsolationType": "Full"}'
# SentinelOne - 断开网络连接
curl -X POST "https://usea1.sentinelone.net/web/api/v2.1/agents/actions/disconnect" \
-H "Authorization: ApiToken $S1_TOKEN" \
-H "Content-Type: application/json" \
-d '{"filter": {"ids": ["agent_id"]}, "data": {}}'
# 从受攻陷 Windows 主机采集实时内存
winpmem_mini_x64.exe memdump_hostname_$(date +%Y%m%d).raw
# 采集网络连接和运行中的进程
netstat -anob > netstat_capture_$(date +%Y%m%d_%H%M).txt
tasklist /V /FO CSV > process_list_$(date +%Y%m%d_%H%M).csv
wmic process list full > process_detail_$(date +%Y%m%d_%H%M).txt
# Linux 易失性证据采集
dd if=/proc/kcore of=/mnt/forensics/memory_$(hostname)_$(date +%Y%m%d).raw bs=1M
ss -tulnp > /mnt/forensics/network_$(hostname).txt
ps auxwwf > /mnt/forensics/processes_$(hostname).txt
# 禁用受攻陷的 Active Directory 账号
Import-Module ActiveDirectory
Disable-ADAccount -Identity "compromised_user"
Set-ADUser -Identity "compromised_user" -Description "已禁用 - IR-2024-001 $(Get-Date)"
# 撤销所有活跃会话
Revoke-AzureADUserAllRefreshToken -ObjectId "user_object_id"
# 重置服务账号凭据
Set-ADAccountPassword -Identity "svc_compromised" -Reset -NewPassword (ConvertTo-SecureString "TempP@ss$(Get-Random)" -AsPlainText -Force)
# 验证没有活跃的 C2 通信
tcpdump -i eth0 host attacker_ip -c 100 -w verification_capture.pcap
# 检查新的横向移动尝试
index=security sourcetype=wineventlog EventCode=4624 LogonType=3
earliest=-15m
| stats count by src_ip, dest_ip
| where src_ip IN ("compromised_hosts")
# 验证端点隔离状态
curl -X GET "https://api.crowdstrike.com/devices/entities/devices/v2?ids=device_id" \
-H "Authorization: Bearer $FALCON_TOKEN" | jq '.resources[].status'
| 概念 | 说明 |
|---|---|
| 短期遏制(Short-term Containment) | 阻止活跃损害的即时措施(网络隔离、账号禁用) |
| 长期遏制(Long-term Containment) | 在调查继续进行时的可持续措施(VLAN 分段、增强监控) |
| 证据保全(Evidence Preservation) | 在遏制措施销毁取证产物之前采集易失性数据 |
| 爆炸半径(Blast Radius) | 攻陷影响的系统、账号和数据的总范围 |
| 遏制边界(Containment Boundary) | 为防止进一步传播而建立的网络和逻辑边界 |
| 杀伤链中断(Kill Chain Disruption) | 在尽可能早的阶段打断攻击者的操作链 |
| 业务连续性(Business Continuity) | 在遏制威胁的同时维持关键运营 |
| 工具 | 用途 |
|---|---|
| CrowdStrike Falcon | 端点检测、主机网络遏制 |
| Microsoft Defender for Endpoint | 端点隔离和自动调查 |
| Palo Alto NGFW | 用于 IP/域名阻断的边界防火墙规则 |
| Splunk/Elastic SIEM | 实时告警关联和范围分析 |
| Zeek(Bro) | 用于 C2 识别的网络流量分析 |
| Velociraptor | 远程取证采集和端点查询 |
| Active Directory | 账号管理和认证控制 |