/cybersecurity-skills-zh:performing-threat-hunting-with-elastic-siemfrom cybersecurity-skills-zh
Performs proactive threat hunting in Elastic Security SIEM using KQL/EQL queries, Timeline investigations, and MITRE ATT&CK-based hypotheses to detect threats evading automated detection.
Ships in cybersecurity-skills-zh. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
以下情况使用本技能:
不适用于实时告警分类——该场景应使用 Elastic Security 告警队列配合自动检测规则。
kibana_security_solution 和相关索引的 read 访问权限基于威胁情报、ATT&CK 技术或异常现象制定假设:
假设示例:"攻击者正在使用离地攻击(LOLBins)执行操作,具体是使用 certutil.exe 进行文件下载(T1105 — 工具传输入侵)。"
定义范围:
logs-endpoint.events.process-*、logs-windows.sysmon_operational-*-urlcache、-split 或 -decode 标志的 certutil.exe打开 Kibana Discover 并使用 KQL(Kibana 查询语言)进行查询:
process.name: "certutil.exe" and process.args: ("-urlcache" or "-split" or "-decode" or "-encode" or "-verifyctl")
排除已知合法用途进行精炼:
process.name: "certutil.exe"
and process.args: ("-urlcache" or "-split" or "-decode")
and not process.parent.name: ("sccm*.exe" or "ccmexec.exe")
and not user.name: "SYSTEM"
使用编码命令进行 PowerShell 狩猎(T1059.001):
process.name: "powershell.exe"
and process.args: ("-enc" or "-encodedcommand" or "-e " or "frombase64string" or "iex" or "invoke-expression")
and not process.parent.executable: "C:\\Windows\\System32\\svchost.exe"
Elastic 事件查询语言(EQL)支持狩猎多步骤攻击序列:
检测父子进程异常(T1055 — 进程注入):
sequence by host.name with maxspan=5m
[process where event.type == "start" and process.name == "explorer.exe"]
[process where event.type == "start" and process.parent.name == "explorer.exe"
and process.name in ("cmd.exe", "powershell.exe", "rundll32.exe", "regsvr32.exe")]
检测凭据转储序列(T1003):
sequence by host.name with maxspan=2m
[process where event.type == "start"
and process.name in ("procdump.exe", "procdump64.exe", "rundll32.exe", "taskmgr.exe")
and process.args : "*lsass*"]
[file where event.type == "creation"
and file.extension in ("dmp", "dump", "bin")]
检测通过 PsExec 进行横向移动(T1021.002):
sequence by source.ip with maxspan=1m
[authentication where event.outcome == "success" and winlog.logon.type == "Network"]
[process where event.type == "start"
and process.name == "psexesvc.exe"]
在 Elastic Security 中创建 Timeline 调查以进行协作分析:
host.name: "WORKSTATION-042" and event.category: ("process" or "network" or "file")
添加关键字段列:@timestamp、event.action、process.name、process.args、user.name、source.ip、destination.ip
将成功的狩猎查询转换为 Elastic 检测规则:
{
"name": "Certutil 下载活动",
"description": "检测用于文件下载的 certutil.exe,一种常见的 LOLBin 技术",
"risk_score": 73,
"severity": "high",
"type": "eql",
"query": "process where event.type == \"start\" and process.name == \"certutil.exe\" and process.args : (\"-urlcache\", \"-split\", \"-decode\") and not process.parent.name : (\"ccmexec.exe\", \"sccm*.exe\")",
"threat": [
{
"framework": "MITRE ATT&CK",
"tactic": {
"id": "TA0011",
"name": "Command and Control"
},
"technique": [
{
"id": "T1105",
"name": "Ingress Tool Transfer"
}
]
}
],
"tags": ["Hunting", "LOLBins", "T1105"],
"interval": "5m",
"from": "now-6m",
"enabled": true
}
通过 Elastic Security API 部署:
curl -X POST "https://kibana:5601/api/detection_engine/rules" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey YOUR_API_KEY" \
-d @certutil_rule.json
使用聚合创建狩猎仪表板:
GET logs-endpoint.events.process-*/_search
{
"size": 0,
"query": {
"bool": {
"must": [
{"term": {"process.name": "certutil.exe"}},
{"range": {"@timestamp": {"gte": "now-30d"}}}
]
}
},
"aggs": {
"by_host": {
"terms": {"field": "host.name", "size": 20},
"aggs": {
"by_user": {
"terms": {"field": "user.name", "size": 10}
},
"by_args": {
"terms": {"field": "process.args", "size": 10}
}
}
}
}
}
在结构化狩猎报告中记录发现结果并更新检测覆盖率:
| 术语 | 定义 |
|---|---|
| KQL | Kibana 查询语言——用于在 Kibana Discover 和仪表板中过滤数据的简化查询语法 |
| EQL | 事件查询语言——Elastic 的序列感知查询语言,用于检测多步骤攻击模式 |
| ECS | Elastic 通用模式——标准化字段命名规范,支持跨数据源关联 |
| Timeline | Elastic Security 调查工作区,用于协作事件分析和注释 |
| 假设驱动狩猎 | 从攻击者行为理论出发,针对遥测数据进行测试的结构化方法 |
| LOLBins | 离地二进制(Living Off the Land Binaries)——被攻击者滥用的合法 Windows 工具(certutil、mshta、rundll32) |
威胁狩猎报告 — TH-2024-012
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
假设: 攻击者使用 certutil.exe 进行工具下载(T1105)
时间段: 2024-02-15 至 2024-03-15
数据源: Elastic Endpoint(进程事件)、Sysmon
发现结果:
certutil 执行总次数: 342
带 -urlcache 标志: 12(3.5%)
可疑(非 SCCM): 3 个已确认异常
受影响主机:
WORKSTATION-042(财务) — certutil 从外部 IP 下载 payload.exe
SERVER-DB-03(数据库) — certutil 解码 base64 编码二进制文件
LAPTOP-EXEC-07(高管) — certutil 从 Pastebin 下载脚本
已采取行动:
[完成] 3 台主机已隔离进行取证调查
[完成] 检测规则"Certutil 下载活动"已部署(ID: elastic-th012)
[完成] ATT&CK Navigator 已更新:T1105 覆盖率 = 绿色
结论: 假设已确认——3 个真阳性发现已上报 IR
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub killvxk/cybersecurity-skills-zh --plugin cybersecurity-skills-zh735 skills in this plugin
/acquiring-disk-image-with-dd-and-dcfldd使用 dd 和 dcfldd 创建取证级逐位磁盘镜像,通过哈希验证保持证据完整性。/analyzing-active-directory-acl-abuse使用 ldap3 检测 Active Directory 中危险的 ACL 配置错误,识别 GenericAll、WriteDACL 和 WriteOwner 等滥用路径/analyzing-android-malware-with-apktool使用 apktool 进行反编译、jadx 恢复 Java 源码、androguard 进行权限分析,对 Android APK 恶意软件样本执行静态分析,包括清单检查和可疑 API 调用检测。/analyzing-api-gateway-access-logs解析 API 网关访问日志(AWS API Gateway、Kong、Nginx),检测 BOLA/IDOR 攻击、速率限制绕过、凭据扫描和注入尝试。使用 pandas 进行请求模式的统计分析和异常检测。适用于调查 API 滥用或构建 API 专项威胁检测规则。
/analyzing-apt-group-with-mitre-navigator使用 MITRE ATT&CK Navigator 分析高级持续性威胁(APT)组织的技术手法,创建对手 TTP 的分层热力图,用于检测差距分析和威胁导向防御。/analyzing-azure-activity-logs-for-threats通过 azure-monitor-query 查询 Azure Monitor 活动日志和登录日志,检测可疑管理操作、不可能的地理旅行(Impossible Travel)、权限提升和资源修改。为 Azure 环境的威胁狩猎构建 KQL 查询。适用于调查可疑的 Azure 租户活动或构建云 SIEM 检测规则。
Other plugins' skills for the same job