corax-team/muninn
GitHub: corax-team/muninn
一款独立的应急响应与取证日志分析工具,将日志解析、SIGMA 威胁检测、搜索引擎与 IOC 富化整合于单个二进制文件中。
Stars: 0 | Forks: 0
Muninn
日志解析器 • SIGMA 引擎 • 威胁检测 • IOC 富化
由 corax 团队开发
入门 — 推荐工作流
``` # 1. 下载 SIGMA 规则 muninn --download-rules all # 2. 将日志解析为持久化数据库(一次性操作) # 这会将所有事件保存到 SQLite — 仅需一次解析,即可无限次查询 muninn -e ./evidence/ --dbfile case001.db # 3. 对已保存的数据库运行分析(即时,无需重新解析) muninn --load-db case001.db -r sigma-rules/ --summary --ioc-extract --login-analysis # 4. 调查 — 快速交互式查询 muninn --load-db case001.db --keyword "mimikatz" muninn --load-db case001.db --sql "SELECT * FROM events WHERE EventID = '4688'" muninn --load-db case001.db --distinct Image muninn --load-db case001.db --field "User=%admin%" # 5. 根据威胁情报检查 IOC muninn --load-db case001.db --ioc-extract --opentip-check YOUR_KEY --opentip-types hash ```替代方案 — 直接扫描(无数据库)
``` # 使用所有规则进行基本扫描 muninn -e ./evidence/ -r sigma-rules/ # 带统计信息的扫描 muninn -e ./evidence/ -r sigma-rules/ --stats # 扫描特定日志文件 muninn -e ./Security.evtx -r sigma-rules/rules/windows/ # 静默模式(仅显示检测结果) muninn -e ./evidence/ -r sigma-rules/ -q # 自定义 JSON 输出 muninn -e ./evidence/ -r sigma-rules/ -o results.json ```搜索 — 关键词、字段、正则、SQL
``` # 关键字搜索(对所有字段进行全文搜索) muninn -e ./evidence/ -k "mimikatz" muninn -e ./evidence/ -k "powershell" muninn -e ./evidence/ -k "cmd.exe" muninn -e ./evidence/ -k "admin" # 字段搜索(LIKE 语法:% = 通配符, _ = 单个字符) muninn -e ./evidence/ -f "EventID=4624" muninn -e ./evidence/ -f "Image=%cmd.exe" muninn -e ./evidence/ -f "User=%admin%" muninn -e ./evidence/ -f "SourceIp=192.168.%" muninn -e ./evidence/ -f "CommandLine=%whoami%" muninn -e ./evidence/ -f "LogonType=10" # 正则表达式搜索 muninn -e ./evidence/ --regex "CommandLine=.*-[eE]nc[oO]?d?e?d?C?o?m?m?a?n?d?\s+[A-Za-z0-9+/=]{20,}" muninn -e ./evidence/ --regex "Image=.*\\\\(cmd|powershell|pwsh)\.exe$" muninn -e ./evidence/ --regex "DestinationIp=^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)" # 原始 SQL 查询 muninn -e ./evidence/ --sql "SELECT * FROM events WHERE \"CommandLine\" LIKE '%whoami%'" muninn -e ./evidence/ --sql "SELECT \"Image\", COUNT(*) as cnt FROM events GROUP BY \"Image\" ORDER BY cnt DESC LIMIT 20" muninn -e ./evidence/ --sql "SELECT DISTINCT \"User\" FROM events WHERE \"EventID\" = '4624'" muninn -e ./evidence/ --sql "SELECT * FROM events WHERE \"EventID\" IN ('4624','4625','4648') LIMIT 100" # 从文件执行 SQL muninn -e ./evidence/ --sql-file queries.sql # 统计与探索 muninn -e ./evidence/ --stats muninn -e ./evidence/ --distinct EventID muninn -e ./evidence/ --distinct Image muninn -e ./evidence/ --distinct User muninn -e ./evidence/ --distinct SourceIp muninn -e ./evidence/ --distinct Channel # 限制结果数量 muninn -e ./evidence/ -k "error" --limit 50 ```SIGMA 检测 — 过滤与性能分析
``` # 最低严重级别过滤 muninn -e ./evidence/ -r sigma-rules/ --min-level high # only high + critical muninn -e ./evidence/ -r sigma-rules/ --min-level critical # only critical muninn -e ./evidence/ -r sigma-rules/ --min-level medium # medium and above # 排除嘈杂规则 muninn -e ./evidence/ -r sigma-rules/ --rulefilter "sysmon config" muninn -e ./evidence/ -r sigma-rules/ --rulefilter "sysmon" --rulefilter "defender" # 规则性能分析 muninn -e ./evidence/ -r sigma-rules/ --profile-rules # 指定规则目录 muninn -e ./evidence/ -r sigma-rules/rules/windows/process_creation/ muninn -e ./evidence/ -r sigma-rules/rules/windows/powershell/ muninn -e ./evidence/ -r sigma-rules/rules/linux/ muninn -e ./evidence/ -r sigma-rules/rules/cloud/aws/ muninn -e ./evidence/ -r sigma-rules/rules/network/ # 使用自定义规则 muninn -e ./evidence/ -r ./custom-rules/my-rule.yml muninn -e ./evidence/ -r ./custom-rules/ # 事件哈希 muninn -e ./evidence/ -r sigma-rules/ --hashes ```高级分析 — MITRE、时间线、异常、IOC、评分
``` # 完整分析流水线 muninn -e ./evidence/ -r sigma-rules/ --stats --timeline --killchain --threat-score --anomalies --ioc-extract --correlate --transforms # MITRE ATT&CK muninn -e ./evidence/ -r sigma-rules/ --killchain # console + auto-save .txt muninn -e ./evidence/ -r sigma-rules/ --killchain kc.html # save as HTML report muninn -e ./evidence/ -r sigma-rules/ --navigator layer.json # ATT&CK Navigator export # 攻击时间线 muninn -e ./evidence/ -r sigma-rules/ --timeline # console + auto-save .txt muninn -e ./evidence/ -r sigma-rules/ --timeline tl.html # save as HTML # 异常检测(无需规则) muninn -e ./evidence/ --anomalies # console + auto-save .txt muninn -e ./evidence/ --anomalies anomalies.json # save as JSON muninn -e ./evidence/ --anomalies anomalies.html # save as HTML # IOC 提取 muninn -e ./evidence/ --ioc-extract # console + auto-save .txt muninn -e ./evidence/ --ioc-extract iocs.html # save as HTML # 结合威胁情报进行 IOC 富化 muninn -e ./evidence/ --ioc-extract --vt-key YOUR_VT_KEY muninn -e ./evidence/ --ioc-extract --abuseipdb-key YOUR_ABUSEIPDB_KEY muninn -e ./evidence/ --ioc-extract --opentip-key YOUR_OPENTIP_KEY # Kaspersky OpenTIP 深度检查(并行,详细报告:TXT + HTML + JSON) muninn -e ./evidence/ --ioc-extract --opentip-check YOUR_KEY # check all IOC types muninn -e ./evidence/ --ioc-extract --opentip-check YOUR_KEY --opentip-types hash # hashes only muninn -e ./evidence/ --ioc-extract --opentip-check YOUR_KEY --opentip-types ip # IPs only muninn -e ./evidence/ --ioc-extract --opentip-check YOUR_KEY --opentip-types hash,ip # hashes + IPs muninn -e ./evidence/ --ioc-extract --opentip-check YOUR_KEY --opentip-max 500 # up to 500 checks # 登录分析(Windows 安全事件 4624/4625/4672) muninn -e ./evidence/ --login-analysis # brute force, lateral movement, privesc # 执行摘要(自动化事件判定) muninn -e ./evidence/ -r sigma-rules/ --summary # Clean / Suspicious / Compromised / Breach # 每个主机/用户的威胁评分 muninn -e ./evidence/ -r sigma-rules/ --threat-score # console + auto-save .txt muninn -e ./evidence/ -r sigma-rules/ --threat-score scores.html # HTML report # 攻击链关联 muninn -e ./evidence/ -r sigma-rules/ --correlate # console + auto-save .txt muninn -e ./evidence/ -r sigma-rules/ --correlate chains.json # save as JSON # 字段转换(base64 解码, LOLBin 检测, DNS 熵, 混淆) muninn -e ./evidence/ --transforms -r sigma-rules/ # 对比两组证据集 muninn -e ./evidence-before/ -r sigma-rules/ --diff ./evidence-after/ ```持久化数据库 — 解析一次,多次查询
解析 4 GB 的 EVTX 日志大约需要 8 分钟。将结果保存到 SQLite 数据库一次 —— 之后可以立即运行任何分析,无需重新解析。内存自适应:自动调整并行度,并对大文件使用磁盘支持引擎,以防止在内存受限的系统上发生 OOM。 ``` # ── 步骤 1:解析日志并保存到数据库(一次性) ────────────────── muninn -e ./evidence/ --dbfile # auto-named: muninn_db_YYYY-MM-DD_HH-MM-SS.db muninn -e ./evidence/ --dbfile case001.db # custom name muninn -e archive.zip --dbfile case001.db # from archive muninn -e encrypted.rar --archive-password "infected" --dbfile case001.db # encrypted archive # ── 步骤 2:查询数据库(即时) ──────────────────────────────── # 搜索 muninn --load-db case001.db --keyword "mimikatz" muninn --load-db case001.db --field "EventID=4624" muninn --load-db case001.db --regex "CommandLine=.*whoami" muninn --load-db case001.db --distinct Image # SQL 查询 muninn --load-db case001.db --sql "SELECT COUNT(*) FROM events" muninn --load-db case001.db --sql "SELECT Image, COUNT(*) as cnt FROM events GROUP BY Image ORDER BY cnt DESC LIMIT 20" muninn --load-db case001.db --sql "SELECT * FROM events WHERE CommandLine LIKE '%mimikatz%'" # ── 步骤 3:运行 SIGMA 规则 ──────────────────────────────────────────── muninn --load-db case001.db -r sigma-rules/ --summary --threat-score muninn --load-db case001.db -r sigma-rules/ --gui report.html # ── 步骤 4:提取并检查 IOC ───────────────────────────────────── # 提取 IOC(IP, 域名, URL, 哈希, 邮件, 文件路径, 注册表键, 服务, 任务, 管道) muninn --load-db case001.db --ioc-extract # 针对 Kaspersky OpenTIP 检查提取的 IOC muninn --load-db case001.db --ioc-extract --opentip-check YOUR_API_KEY # 仅检查哈希 muninn --load-db case001.db --ioc-extract --opentip-check YOUR_API_KEY --opentip-types hash # 仅检查 IP muninn --load-db case001.db --ioc-extract --opentip-check YOUR_API_KEY --opentip-types ip # 检查哈希 + 域名,限制 100 条 muninn --load-db case001.db --ioc-extract --opentip-check YOUR_API_KEY --opentip-types hash,domain --opentip-max 100 # ── 步骤 5:IR 分析 ──────────────────────────────────────────────── muninn --load-db case001.db --login-analysis # authentication analysis muninn --load-db case001.db --anomalies # statistical anomalies muninn --load-db case001.db -r sigma-rules/ --correlate # attack chains ``` `--ioc-extract --opentip-check` 生成的输出文件: - `muninn_iocs_*.txt` — IOC 列表 (文本) - `muninn_iocs_*.csv` — IOC 列表 (CSV, 适用于 Excel/LibreOffice) - `muninn_iocs_*.opentip.txt` — OpenTIP 报告 (文本) - `muninn_iocs_*.opentip.html` — OpenTIP 报告 (交互式 HTML,包含区域和门户链接) - `muninn_iocs_*.opentip.json` — OpenTIP 报告 (结构化 JSON)导出 — HTML, SIEM, SQLite, CSV
``` # HTML 交互式报告 muninn -e ./evidence/ -r sigma-rules/ --gui report.html # 导出至 Splunk muninn -e ./evidence/ -r sigma-rules/ --template splunk --template-output detections.json # 导出至 ELK/OpenSearch muninn -e ./evidence/ -r sigma-rules/ --template elk --template-output detections.ndjson # 导出至 Timesketch muninn -e ./evidence/ -r sigma-rules/ --template timesketch --template-output timeline.jsonl # 导出为 CSV muninn -e ./evidence/ -r sigma-rules/ --template csv --template-output detections.csv # 导出为 SARIF(用于 GitHub Security 标签页等) muninn -e ./evidence/ -r sigma-rules/ --template sarif --template-output results.sarif # 导出 SQLite 数据库以进行自定义查询 muninn -e ./evidence/ --dbfile case.db sqlite3 case.db "SELECT \"Image\", COUNT(*) FROM events GROUP BY \"Image\" ORDER BY COUNT(*) DESC LIMIT 20" # 将扁平化事件导出为 JSONL muninn -e ./evidence/ --keepflat events.jsonl # ATT&CK Navigator 层 muninn -e ./evidence/ -r sigma-rules/ --navigator layer.json ```过滤 — 时间、文件、字段
``` # 基于时间的过滤(ISO 8601) muninn -e ./evidence/ -r sigma-rules/ --after "2025-01-15T00:00:00" muninn -e ./evidence/ -r sigma-rules/ --before "2025-01-16T00:00:00" muninn -e ./evidence/ -r sigma-rules/ --after "2025-01-15T08:00:00" --before "2025-01-15T18:00:00" # 通过 glob 选择文件 muninn -e ./evidence/ -s "*.evtx" -r sigma-rules/ # only EVTX muninn -e ./evidence/ -s "Security*" -r sigma-rules/ # only Security logs muninn -e ./evidence/ -a "*.csv" -r sigma-rules/ # exclude CSV files # 字段映射(重命名所有事件中的字段) muninn -e ./evidence/ -r sigma-rules/ --field-map mapping.yaml # mapping.yaml: { "EventID": "event_id", "SourceIp": "src_ip" } ```性能调优
``` # 控制并行度 muninn -e ./evidence/ -r sigma-rules/ --workers 4 # 4 threads muninn -e ./evidence/ -r sigma-rules/ --workers 16 # 16 threads # 限制内存使用 muninn -e ./evidence/ -r sigma-rules/ --max-events 500000 # cap at 500K events muninn -e ./evidence/ -r sigma-rules/ --batch-size 100000 # larger batches # 创建索引以加快查询速度 muninn -e ./evidence/ -r sigma-rules/ --add-index EventID --add-index Image # 单文件并行处理 muninn -e ./evidence/ -r sigma-rules/ --per-file ```交互模式与实时模式
``` # 交互式终端 UI(需要 --features tui) muninn -e ./evidence/ -r sigma-rules/ --tui # 实时监控(需要 --features live) muninn -e /var/log/ -r sigma-rules/ --live # YAML 配置文件(保留所有设置) muninn --config muninn.yaml # muninn.yaml: # events: ./evidence/ # rules: sigma-rules/ # min_level: medium # stats: true # timeline: true # killchain: true # threat_score: true ```应急响应 — 横向移动
``` # 远程登录(网络 + RDP) muninn -e evidence/ --sql "SELECT * FROM events WHERE \"EventID\" = '4624' AND \"LogonType\" IN ('3','10')" # PsExec 检测 muninn -e evidence/ -k "psexec" # 哈希传递 muninn -e evidence/ --sql "SELECT * FROM events WHERE \"EventID\" = '4624' AND \"LogonType\" = '3' AND \"AuthenticationPackageName\" = 'NTLM'" # WMI 横向移动 muninn -e evidence/ --sql "SELECT * FROM events WHERE \"ParentImage\" LIKE '%wmiprvse.exe' AND \"EventID\" = '1'" # 远程服务创建 muninn -e evidence/ --sql "SELECT * FROM events WHERE \"EventID\" = '7045' AND \"ServiceFileName\" LIKE '%\\\\%'" # RDP 会话 muninn -e evidence/ --sql "SELECT \"TargetUserName\",\"IpAddress\",\"LogonType\" FROM events WHERE \"EventID\" = '4624' AND \"LogonType\" = '10'" # SMB 文件复制 muninn -e evidence/ --sql "SELECT * FROM events WHERE \"EventID\" = '5145' AND \"RelativeTargetName\" LIKE '%.exe'" ```威胁追踪 — 可疑进程
``` # 编码的 PowerShell muninn -e evidence/ --regex "CommandLine=.*-[eE]nc[oO]?d?e?d?C?o?m?m?a?n?d?\s+[A-Za-z0-9+/=]{20,}" # LOLBins 下载文件 muninn -e evidence/ --sql "SELECT \"Image\",\"CommandLine\" FROM events WHERE \"CommandLine\" LIKE '%http%' AND (\"Image\" LIKE '%certutil%' OR \"Image\" LIKE '%mshta%' OR \"Image\" LIKE '%regsvr32%' OR \"Image\" LIKE '%bitsadmin%')" # Office 生成进程 muninn -e evidence/ --sql "SELECT \"Image\",\"CommandLine\",\"ParentImage\" FROM events WHERE \"ParentImage\" LIKE '%WINWORD%' OR \"ParentImage\" LIKE '%EXCEL%' OR \"ParentImage\" LIKE '%OUTLOOK%' OR \"ParentImage\" LIKE '%POWERPNT%'" # 侦察命令 muninn -e evidence/ --sql "SELECT \"CommandLine\",\"User\",\"Image\" FROM events WHERE \"Image\" LIKE '%whoami%' OR \"Image\" LIKE '%net.exe' OR \"Image\" LIKE '%ipconfig%' OR \"Image\" LIKE '%systeminfo%' OR \"Image\" LIKE '%nltest%' OR \"Image\" LIKE '%tasklist%' OR \"Image\" LIKE '%qprocess%'" # 可疑的 PowerShell 下载 muninn -e evidence/ --sql "SELECT \"CommandLine\" FROM events WHERE \"CommandLine\" LIKE '%Invoke-WebRequest%' OR \"CommandLine\" LIKE '%wget%' OR \"CommandLine\" LIKE '%curl%' OR \"CommandLine\" LIKE '%DownloadString%' OR \"CommandLine\" LIKE '%DownloadFile%'" # 进程注入指标(Sysmon 8 — CreateRemoteThread) muninn -e evidence/ --sql "SELECT \"SourceImage\",\"TargetImage\" FROM events WHERE \"EventID\" = '8'" # 来自临时目录的未签名进程 muninn -e evidence/ --sql "SELECT \"Image\",\"CommandLine\" FROM events WHERE \"Image\" LIKE '%\\Temp\\%' OR \"Image\" LIKE '%\\tmp\\%' OR \"Image\" LIKE '%\\AppData\\%'" # 重命名的系统二进制文件 muninn -e evidence/ --sql "SELECT \"Image\",\"OriginalFileName\",\"CommandLine\" FROM events WHERE \"OriginalFileName\" IS NOT NULL AND \"Image\" NOT LIKE '%\\' || \"OriginalFileName\"" ```持久化
``` # 计划任务 muninn -e evidence/ --sql "SELECT \"CommandLine\" FROM events WHERE \"EventID\" = '1' AND \"CommandLine\" LIKE '%schtasks%create%'" # 新服务 muninn -e evidence/ --sql "SELECT \"ServiceName\",\"ImagePath\",\"ServiceType\" FROM events WHERE \"EventID\" = '7045'" # 注册表 Run 键(Sysmon 13) muninn -e evidence/ --sql "SELECT \"Image\",\"TargetObject\",\"Details\" FROM events WHERE \"EventID\" = '13' AND \"TargetObject\" LIKE '%\\Run\\%'" # WMI 事件订阅 muninn -e evidence/ --sql "SELECT * FROM events WHERE \"EventID\" IN ('19','20','21')" # 启动文件夹文件创建(Sysmon 11) muninn -e evidence/ --sql "SELECT \"Image\",\"TargetFilename\" FROM events WHERE \"EventID\" = '11' AND \"TargetFilename\" LIKE '%Startup%'" # DLL 劫持(Sysmon 7 — Image Load) muninn -e evidence/ --sql "SELECT \"Image\",\"ImageLoaded\" FROM events WHERE \"EventID\" = '7' AND \"Signed\" = 'false'" ```凭证访问
``` # LSASS 访问(Sysmon 10) muninn -e evidence/ --sql "SELECT \"SourceImage\",\"GrantedAccess\" FROM events WHERE \"EventID\" = '10' AND \"TargetImage\" LIKE '%lsass.exe'" # Kerberoasting(RC4 加密的 TGS) muninn -e evidence/ --sql "SELECT \"TargetUserName\",\"ServiceName\",\"TicketEncryptionType\" FROM events WHERE \"EventID\" = '4769' AND \"TicketEncryptionType\" = '0x17'" # AS-REP Roasting muninn -e evidence/ --sql "SELECT \"TargetUserName\" FROM events WHERE \"EventID\" = '4768' AND \"TicketEncryptionType\" = '0x17'" # SAM 数据库访问 muninn -e evidence/ --sql "SELECT * FROM events WHERE \"EventID\" = '10' AND \"TargetImage\" LIKE '%\\lsass.exe' AND \"GrantedAccess\" IN ('0x1010','0x1038','0x1fffff')" # SSH 暴力破解 muninn -e auth.log -k "Invalid user" --stats # 登录失败 muninn -e evidence/ --sql "SELECT \"TargetUserName\",\"IpAddress\",COUNT(*) as cnt FROM events WHERE \"EventID\" = '4625' GROUP BY \"TargetUserName\",\"IpAddress\" ORDER BY cnt DESC" # DCSync(目录复制) muninn -e evidence/ --sql "SELECT * FROM events WHERE \"EventID\" = '4662' AND \"Properties\" LIKE '%1131f6ad%'" ```网络分析 — IP、域名、C2
``` # 外部 IP(排除 RFC1918) muninn -e evidence/ --sql " SELECT DISTINCT \"DestinationIp\" FROM events WHERE \"DestinationIp\" IS NOT NULL AND \"DestinationIp\" != '' AND \"DestinationIp\" NOT LIKE '10.%' AND \"DestinationIp\" NOT LIKE '172.16.%' AND \"DestinationIp\" NOT LIKE '172.17.%' AND \"DestinationIp\" NOT LIKE '172.18.%' AND \"DestinationIp\" NOT LIKE '172.19.%' AND \"DestinationIp\" NOT LIKE '172.2_.%' AND \"DestinationIp\" NOT LIKE '172.30.%' AND \"DestinationIp\" NOT LIKE '172.31.%' AND \"DestinationIp\" NOT LIKE '192.168.%' AND \"DestinationIp\" NOT LIKE '127.%' " # C2 常用端口 muninn -e evidence/ --sql " SELECT \"DestinationIp\",\"DestinationPort\",\"Image\" FROM events WHERE \"DestinationPort\" IN ('4444','5555','8080','8443','1337','9001','6666','1234') " # 可疑的 TLD muninn -e evidence/ --sql " SELECT \"QueryName\",\"Image\" FROM events WHERE \"EventID\" = '22' AND (\"QueryName\" LIKE '%.xyz' OR \"QueryName\" LIKE '%.top' OR \"QueryName\" LIKE '%.tk' OR \"QueryName\" LIKE '%.pw' OR \"QueryName\" LIKE '%.onion' OR \"QueryName\" LIKE '%.bit') " # 高频 DNS 查询(可能的信标活动) muninn -e evidence/ --sql "SELECT \"QueryName\", COUNT(*) as cnt FROM events WHERE \"EventID\" = '22' GROUP BY \"QueryName\" HAVING cnt > 100 ORDER BY cnt DESC" # 长 DNS 名称(可能的隧道) muninn -e evidence/ --sql "SELECT \"QueryName\" FROM events WHERE \"EventID\" = '22' AND LENGTH(\"QueryName\") > 50" # 按进程分类的出站连接 muninn -e evidence/ --sql "SELECT \"Image\", COUNT(DISTINCT \"DestinationIp\") as ips FROM events WHERE \"EventID\" = '3' GROUP BY \"Image\" ORDER BY ips DESC LIMIT 20" # 所有唯一的外部 IP muninn -e evidence/ --distinct DestinationIp # 所有唯一的 DNS 查询 muninn -e evidence/ --distinct QueryName ```防御规避
``` # Sysmon 配置篡改 muninn -e evidence/ --sql "SELECT * FROM events WHERE \"EventID\" = '16'" # 日志清除 muninn -e evidence/ --sql "SELECT * FROM events WHERE \"EventID\" IN ('1102','104')" # 禁用 Windows Defender muninn -e evidence/ --sql "SELECT * FROM events WHERE \"CommandLine\" LIKE '%DisableRealtimeMonitoring%' OR \"CommandLine\" LIKE '%Set-MpPreference%'" # AMSI 绕过尝试 muninn -e evidence/ -k "AmsiUtils" muninn -e evidence/ --sql "SELECT \"CommandLine\" FROM events WHERE \"CommandLine\" LIKE '%amsi%bypass%' OR \"CommandLine\" LIKE '%AmsiInitFailed%'" # Timestomping(Sysmon 2 — FileCreateTime 已更改) muninn -e evidence/ --sql "SELECT \"Image\",\"TargetFilename\" FROM events WHERE \"EventID\" = '2'" # 进程镂空(Sysmon 25 — ProcessTampering) muninn -e evidence/ --sql "SELECT * FROM events WHERE \"EventID\" = '25'" ```Linux 与云
``` # Linux — sudo 滥用 muninn -e /var/log/auth.log -k "sudo" --stats # Linux — SSH 暴力破解 muninn -e /var/log/auth.log --sql "SELECT * FROM events WHERE \"_raw\" LIKE '%Failed password%'" # Linux — cron 持久化 muninn -e /var/log/syslog -k "CRON" --stats # Linux — 新用户 muninn -e /var/log/auth.log -k "useradd" # AWS CloudTrail — 无 MFA 的控制台登录 muninn -e cloudtrail/ --sql "SELECT * FROM events WHERE \"eventName\" = 'ConsoleLogin' AND \"additionalEventData\" NOT LIKE '%MFAUsed%Yes%'" # AWS — IAM 变更 muninn -e cloudtrail/ --sql "SELECT \"eventName\",\"userIdentity\",\"requestParameters\" FROM events WHERE \"eventSource\" = 'iam.amazonaws.com'" # Azure — 风险登录 muninn -e azure-logs/ --sql "SELECT * FROM events WHERE \"riskState\" = 'atRisk'" # Zeek — DNS 查询 muninn -e zeek-logs/dns.log --distinct query muninn -e zeek-logs/dns.log --sql "SELECT \"query\", COUNT(*) as cnt FROM events GROUP BY \"query\" ORDER BY cnt DESC LIMIT 30" ```数据探索与导出
``` # 字段统计 muninn -e evidence/ --stats muninn -e evidence/ --distinct EventID muninn -e evidence/ --distinct Image muninn -e evidence/ --distinct User muninn -e evidence/ --distinct Channel muninn -e evidence/ --distinct LogonType # 导出到 SQLite 以进行高级分析 muninn -e evidence/ --dbfile case.db sqlite3 case.db "SELECT \"Image\", COUNT(*) as cnt FROM events WHERE \"EventID\" = '1' GROUP BY \"Image\" ORDER BY cnt DESC LIMIT 20" sqlite3 case.db ".schema events" # 按数量排名的热门进程 muninn -e evidence/ --sql "SELECT \"Image\", COUNT(*) as cnt FROM events WHERE \"Image\" IS NOT NULL GROUP BY \"Image\" ORDER BY cnt DESC LIMIT 30" # 事件时间线(每小时分布) muninn -e evidence/ --sql "SELECT SUBSTR(\"SystemTime\",1,13) as hour, COUNT(*) as cnt FROM events WHERE \"SystemTime\" IS NOT NULL GROUP BY hour ORDER BY hour" # 活动最多的用户 muninn -e evidence/ --sql "SELECT \"User\", COUNT(*) as cnt FROM events WHERE \"User\" IS NOT NULL GROUP BY \"User\" ORDER BY cnt DESC LIMIT 20" ```完整调查工作流
``` # 步骤 1:下载规则 muninn --download-rules all # 步骤 2:快速分类 muninn -e ./evidence/ -r sigma-rules/ --min-level high --stats # 步骤 3:完整分析 muninn -e ./evidence/ -r sigma-rules/ --stats --timeline --killchain --threat-score --anomalies --ioc-extract --correlate --gui report.html # 步骤 4:导出以进行 SIEM 接收 muninn -e ./evidence/ -r sigma-rules/ --template splunk --template-output splunk-import.json # 步骤 5:使用 TUI 进行深入研究 muninn -e ./evidence/ -r sigma-rules/ --tui # 步骤 6:导出富化的 IOC muninn -e ./evidence/ --ioc-extract --vt-key YOUR_KEY -o ioc-report.json # 步骤 7:比较修复前后的差异 muninn -e ./evidence-before/ -r sigma-rules/ --diff ./evidence-after/ ```支持的 SIGMA 修饰符
| 修饰符 | 示例 | 描述 | |----------|---------|-------------| | `contains` | `CommandLine\|contains: 'whoami'` | 子字符串匹配 | | `startswith` | `Image\|startswith: 'C:\Windows'` | 前缀匹配 | | `endswith` | `Image\|endswith: '\cmd.exe'` | 后缀匹配 | | `re` | `CommandLine\|re: '.*-enc\s+'` | 正则表达式 | | `all` | `CommandLine\|contains\|all:` | 所有值必须匹配 | | `base64` | `CommandLine\|base64: 'whoami'` | Base64 编码值 | | `base64offset` | `CommandLine\|base64offset: 'admin'` | 带偏移变体的 Base64 | | `windash` | `CommandLine\|windash\|contains: '-enc'` | 破折号变体 (`-`, `/`, `--`) | | `cidr` | `SourceIp\|cidr: '10.0.0.0/8'` | IP 范围 | | `gt/gte/lt/lte` | `EventID\|gte: 4624` | 数值比较 |功能标志、Docker、交叉编译
| 功能 | 描述 | |---------|-------------| | `all-parsers` | 所有格式解析器 (默认) | | `cli` | CLI 二进制文件 | | `archive` | .gz/.zip/.bz2/.tar.gz/.tgz/.rar/.7z 支持 (flate2, zip, bzip2, tar, unrar, sevenz-rust) | | `download` | 从 SigmaHQ 发布版下载 SIGMA 规则 | | `ioc-enrich` | 通过 VirusTotal, AbuseIPDB, OpenTIP 进行 IOC 富化 | | `tui` | 交互式终端 UI (ratatui, crossterm) | | `live` | 实时目录监控 | | `parser-evtx` | Windows EVTX | | `parser-syslog` | Syslog RFC 3164/5424 | | `parser-cef` | 通用事件格式 | | `parser-leef` | 日志事件扩展格式 | | `parser-zeek` | Zeek/Bro TSV | | `parser-w3c` | W3C 扩展日志 | ``` # Docker docker build -t muninn . docker run -v ./evidence:/case/evidence -v ./sigma_rules:/case/sigma_rules muninn -e /case/evidence/ -r /case/sigma_rules/ --stats # 交叉编译为 Windows rustup target add x86_64-pc-windows-msvc cargo build --release --features "all-parsers,cli" --target x86_64-pc-windows-msvc ```标签:AMSI绕过, Cloudflare, IOC富化, Kaspersky OpenTIP, Linux审计, MITRE ATT&CK, PE 加载器, SIGMA规则, SQLite, Sysmon, Windows事件日志, Zeek日志, 可视化界面, 威胁检测, 库, 应急响应, 异常检测, 搜索引擎, 攻击关联, 数字取证, 无需SIEM, 网络安全, 自动化脚本, 通知系统, 隐私保护