bolens/aur-response-toolkit

GitHub: bolens/aur-response-toolkit

面向 Arch Linux 的 Fish shell 应急响应工具包,用于检测、分流和恢复 AUR 供应链恶意软件事件。

Stars: 1 | Forks: 0

# aur-response-toolkit [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/e298826bfa143119.svg)](https://github.com/bolens/aur-response-toolkit/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/github/license/bolens/aur-response-toolkit)](LICENSE) Fish shell 工具包,用于**检测、分流和恢复** Arch 用户仓库(AUR)供应链安全事件。**[Atomic Arch](https://www.sonatype.com/blog/atomic-arch-npm-campaign-adds-malicious-dependency)**(2026 年 6 月 — `atomic-lockfile` / `js-digest` npm 钩子,[`deps`](https://ioctl.fail/preliminary-analysis-of-aur-malware/) 窃密木马)是默认的主要扫描项;可选的活动活动涵盖 **Chaos RAT**、**Mini Shai-Hulud** 和 **xeactor**(2018 年)。 ## TL;DR 在 **2026 年 6 月 9 日至 14 日**期间使用过 AUR?克隆仓库、运行扫描,并根据退出代码采取行动: ``` git clone https://github.com/bolens/aur-response-toolkit.git && cd aur-response-toolkit && chmod +x run.fish run.sh install.fish lint.fish scripts/*/*.fish && fish run.fish ``` - **退出码 `0`** — 未发现可疑项;您可以收工了(或者如果您仍想进行凭证检查,可以运行 `fish run.fish --audit`)。 - **退出码 `1`** — 发现入侵指标;请按照下方的[恢复流程](#decision-flow)操作。 - **退出码 `2`** — 仅有警告(安全加固建议,或时间窗口内安装的未知且无危害的 AUR 软件包) - **退出码 `3`** — 数据不足(无法读取 `pacman.log`);请使用适当的权限重新运行。 - **退出码 `4`** — 无效的 CLI 参数。 遭遇入侵后的引导式恢复:`fish run.fish --recover` 离线或物理隔离环境:附加 `--local` 以使用内置的软件包列表。 ### 决策流程 ``` flowchart TD A[Clone repo & make scripts executable] --> B["fish run.fish
(--local · --chaos-rat · --shai-hulud · --xeactor)"] B --> C{Exit code?} C -->|0 Clean| D([No action required]) D -.->|optional| E["run.fish --audit"] C -->|1 Compromise| F{gh-token-monitor
persistence?} F -->|yes| G[Disable gh-token-monitor
before revoking tokens] G --> REC F -->|no| REC REC["recovery/remove-packages.fish --dry-run
(--list atomic-arch · chaos-rat · shai-hulud · xeactor)"] REC --> REM[recovery/remove-packages.fish] REM --> AUD["run.fish --audit --report"] AUD --> ROT[recovery/rotate-hints.fish] ROT --> SCR[recovery/scrub-history.fish] SCR --> DONE([Rotate all credentials
the machine had access to]) C -->|1| WIZ["run.fish --recover"] WIZ --> REC C -->|2 Warnings| H{Optional campaign hit
or hardening only?} H -->|chaos-rat / shai-hulud / xeactor| REC H -->|hardening / benign unknown| I([Review output;
optional recovery/apply-hardening.fish]) C -->|3 Insufficient data| J([Fix pacman.log access; re-run]) C -->|4 Invalid args| K([Fix CLI flags]) ``` ## 快速开始 ``` git clone https://github.com/bolens/aur-response-toolkit.git cd aur-response-toolkit chmod +x run.fish run.sh install.fish lint.fish scripts/*/*.fish # 可选:安装 symlinks 到 ~/.local/bin fish install.fish # 全系统 FHS 安装 (/usr/share + /usr/bin;需要 root) sudo fish install.fish --system # 或者:sudo fish install.fish --prefix /usr/local # Packagers:fish install.fish --prefix /usr --destdir /tmp/stage # AUR (Arch):paru -S aur-response-toolkit # 全面扫描(从网络获取最新的受感染软件包列表) fish run.fish # 离线扫描(使用内置的 data/lists/atomic-arch-pkgs.txt) fish run.fish --local # Bash 登录 shell?使用 wrapper: ./run.sh --local ``` **退出代码:** `0` 干净 · `1` 入侵 · `2` 警告 · `3` 数据不足 · `4` 无效参数。请参阅[自动化](#automation)。 ## 环境要求 Arch Linux(或基于 pacman 的衍生发行版)。`pacman` 本身随基础系统附带 —— 无需单独安装。 像 `realpath`、`sha256sum` 和 `zstdcat` 这样的命令是**其他软件包内部的二进制文件**,而不是独立的软件包名称。请在下表中搜索 **pacman 软件包**,而不是命令名称。 | 角色 | 命令 | Pacman 软件包 | 替代方案(无需额外软件包) | |------|------------|----------------|-----------------------------| | **必需** | [Fish](https://fishshell.com/) | `fish` | — | | | `curl` | `curl` | — | | | `find` | `findutils` | — | | | `comm`, `date`, `sha256sum`, `realpath` | `coreutils` | `readlink -f` (`aur_realpath`); `openssl dgst` (`aur_sha256`; 软件包 `openssl`) | | | `grep`(在没有 `rg` 时使用) | `grep` | — | | **可选(推荐)** | `fd` | `fd` | GNU `find` (`aur_find`) | | | `rg` | `ripgrep` | `grep` (`aur_grep`) | | | `curlie` | `curlie` | `curl` (`aur_curl`; `file://` 始终使用 `curl`) | | | `zstdcat` | `zstd` | `zstd -dc` (`aur_zstdcat`; `.zst` 滚动的 pacman 日志) | | | `jq` | `jq` | 手动构建的 JSON 摘要 / `aur_docker_config_registry_keys` | | | `pgrep` | `procps-ng` | `ps` + `aur_grep`(运行时进程 IOC) | | | `ss` | `iproute2` | `netstat` (`net-tools`) → `lsof` | | **可选(AUR / node)** | AUR 助手缓存扫描 | `paru`, `yay`, `pikaur`, `trizen` 或 `aura`(AUR);`libpamac`(Manjaro GUI) | `makepkg`(包含在 `pacman` 中;仅扫描构建目录) | | | npm 缓存扫描 | `npm` | — | | | bun 缓存扫描 | `bun` | — | ### 安装命令 复制其中一个代码块。`--needed` 会跳过您已经安装的软件包。 **仅必需**(运行扫描的最低要求): ``` sudo pacman -S --needed fish curl findutils coreutils grep ``` **可选的推荐工具**(更快的搜索、更丰富的 JSON、`.zst` pacman 日志、运行时 IOC —— 按需添加): ``` sudo pacman -S --needed fd ripgrep curlie zstd jq procps-ng iproute2 ``` **全部安装**(必需项 + 所有可选的 pacman 仓库工具 + npm + bun): ``` sudo pacman -S --needed fish curl findutils coreutils grep fd ripgrep curlie zstd jq procps-ng iproute2 npm bun ``` **AUR 专属附加项**(在上述 pacman 命令行之后使用您的 AUR 助手安装;选择其中一个助手,不要全部安装): ``` paru -S --needed paru # or: yay -S --needed yay ``` 所有的垫片(shim)都位于 `lib/common.fish`、`lib/ioc.fish` 和 `lib/reports.fish` 中。脚本和测试会调用 `aur_*` 助手函数 —— 而不是直接使用原生的 `grep`、`find`、`curl`、`sha256sum`、`pgrep` 或 `ss` —— 这样 Fish 别名和可选的更快速工具就能生效,且无需在调用点进行条件分支。 ### 支持的发行版 任何支持 AUR 访问且**基于 pacman** 的系统都在范围内 —— 因为这些攻击活动针对的是 AUR 软件包,而不是官方的 `[core]`/`[extra]` 仓库: | 发行版家族 | 示例 | 备注 | |---------------|----------|-------| | Arch Linux | Arch, CachyOS, EndeavourOS, Garuda, ArcoLinux | 完全支持 | | 独立的 pacman 分支 | Manjaro, Artix, Parabola | 安装日期检查使用 pacman 本地数据库中的 `%INSTALLDATE%`(不受区域设置影响)。位于 `/var/tmp/pamac-build-*` 的 Pamac 构建缓存会被自动扫描。 | | 不支持 | Debian, Fedora, NixOS(没有 Arch/pacman 层) | 无 `pacman` / AUR 工作流 | **Manjaro / 仅使用 pamac 的用户:** PKGBUILD 钩子扫描涵盖了 pamac 构建目录(包括 pamac.conf 中自定义的 `BuildDirectory`)。仅通过 GUI 安装的用户会跳过 shell 历史记录检查,但软件包/日志/时间线扫描仍然适用。请确保 `pacman.log` 是可读的(如果遇到退出码 `3`,请使用 `sudo fish run.fish`)。对于 chroot 环境或自定义的 pamac 构建目录,可以在 `~/.config/aur-response/config.fish` 中覆盖路径设置。 ## 完整扫描如何运作 `run.fish` 会按顺序执行七个步骤。当之前的步骤发现问题时,或者当您传入 `--audit` 参数时,步骤 6-7 会自动运行。 | 步骤 | 脚本 | 检查内容 | |:----:|--------|----------------| | 1 | `check/atomic-arch-pkgs.fish` | Atomic Arch 列表;根据安装日期判定为 HIGH/LOW | | 1b | `check/chaos-rat-pkgs.fish` | 可选:Chaos RAT 软件包;根据 **2025 年 7 月 16-18 日**的安装日期判定为 HIGH/LOW | | 1c | `check/shai-hulud-pkgs.fish` | 可选:Mini Shai-Hulud 软件包;根据 **2026 年 5 月 16-17 日**的安装日期判定为 HIGH/LOW | | 1d | `check/xeactor-pkgs.fish` | 可选:xeactor 软件包;根据 **2018 年 6 月 7 日-7 月 10 日**的安装日期判定为 HIGH/LOW | | 2 | `scan/aur-window.fish` | 在 **2026 年 6 月 9-14 日**期间的外部 AUR 活动;分级分流(严重 → 退出 `1`,良性的未知项 → 退出 `2`) | | 3 | `scan/atomic-arch-timeline.fish` | 在 Atomic Arch 时间窗口内,`pacman.log` 中已知受感染的软件包 | | 3b | `scan/chaos-rat-timeline.fish` | 可选:在 **2025 年 7 月 16-18 日**期间,`pacman.log` 中的 Chaos RAT 软件包 | | 3c | `scan/shai-hulud-timeline.fish` | 可选:在 **2026 年 5 月 16-17 日**期间,`pacman.log` 中的 Shai-Hulud 软件包 | | 3d | `scan/xeactor-timeline.fish` | 可选:在 **2018 年 6 月 7 日-7 月 10 日**期间,`pacman.log` 中的 xeactor 软件包 | | 4 | `scan/malware-artifacts.fish` | 攻击活动的 ELF 文件(多 SHA256)、恶意的 npm/bun 缓存、AUR 缓存钩子、eBPF 映射、运行时 IOC、额外的持久化机制 | | 4b | `scan/similar-heuristics.fish` | 已安装且**不在** Atomic Arch 列表中的外部软件包 —— 类似攻击活动的钩子/混淆启发式扫描 | | 5 | `scan/hardening.fish` | `npm ignore-scripts`、bun 环境变量、AUR 助手审查设置(paru/yay/pamac/trizen/aura/aurman)、历史记录中相关的自动安装标志 | | 6 | `audit/stolen-credentials.fish` | SSH、git、docker、浏览器、聊天应用、环境变量文件、shell 历史记录 | | 7 | `recovery/rotate-hints.fish` | 具体的注销和轮换命令 | Atomic Arch 软件包列表会在网络上从上游来源进行合并,并缓存在 `data/lists/atomic-arch-pkgs.txt` 中。有关 URL、IOC 参考和许可证说明,请参阅 **[`data/docs/atomic-arch.md`](data/docs/atomic-arch.md)**。所有攻击活动的索引:[`data/docs/sources.md`](data/docs/sources.md)。 ### 配置 将 `config.fish.example` 复制到 `~/.config/aur-response/config.fish` 以覆盖以下设置: - `AUR_DEV_ROOT` — 扫描 `.env` / `stack.env` 文件的目录(默认:`~/dev`) - `AUR_DEPS_SEARCH_PATHS` — 用于 `deps` ELF 搜索的额外路径 - `AUR_PACMAN_LOG_DIR` — pacman 日志目录(默认:`/var/log`;在 chroot/容器中使用) - `AUR_PACMAN_LOCAL_DIR` — pacman 本地数据库路径(默认:`/var/lib/pacman/local`) - `AUR_HELPER_CACHE_ROOTS` — AUR 助手的构建缓存根目录(设置后替换默认值) - `AUR_MAKEPKG_BUILD_DIRS` — 扫描 PKGBUILD 钩子的 makepkg/ABS 目录(默认:`~/abs`, `~/builds`, `~/aur`) - `AUR_PAMAC_BUILD_GLOBS` — pamac 构建目录的 glob 匹配模式(默认:从 pamac.conf 解析 `BuildDirectory` + `/var/tmp/pamac-build-*`) - `AUR_HISTORY_HELPERS` — 用于 shell 历史记录安全加固检查的 AUR CLI 助手名称正则表达式 - `AUR_ATOMIC_ARCH_LIST_FILE` — 内置的 Atomic Arch 列表(默认:`data/lists/atomic-arch-pkgs.txt`) - `AUR_LIST_MAX_AGE_DAYS` — `--local` 的列表过期警告阈值 - `AUR_LIST_URL_EXTRA` — 可选的第三个 Atomic Arch 列表 URL(在获取时合并) - `AUR_ENABLE_CHAOS_RAT` — 设为 `1` 以在 `run.fish` 中包含 Chaos RAT 扫描(默认关闭) - `AUR_ENABLE_SHAI_HULUD` — 设为 `1` 以在 `run.fish` 中包含 Mini Shai-Hulud 扫描(默认关闭) - `AUR_ENABLE_XEACTOR` — 设为 `1` 以在 `run.fish` 中包含 xeactor 扫描(默认关闭) - `AUR_CHAOS_RAT_URL_ARCH` — 官方 Arch aur-general 安全公告(HTML,获取时解析) - `A_CHAOS_RAT_URL_COMMUNITY` — 扩展的社区列表(纯文本) - `AUR_CHAOS_RAT_URL_EXTRA` — 可选的第三个 Chaos RAT 列表 URL - `AUR_CHAOS_RAT_LIST_FILE` — 合并列表的本地缓存路径(默认:`data/lists/chaos-rat-pkgs.txt`) - `AUR_SHAI_HULUD_LIST_FILE` — 内置的 Shai-Hulud 列表路径(默认:`data/lists/shai-hulud-pkgs.txt`) - `AUR_SHAI_HULUD_URL` — 当存在统一的上游列表时,可选的远程列表 URL(默认:仅使用内置列表) - `AUR_SHAI_HULUD_WINDOW_*` — 覆盖 2026 年 5 月 16-17 日的攻击窗口(日志正则表达式,安装日期正则表达式,标签) - `AUR_XEACTOR_LIST_FILE` — 内置的 xeactor 列表路径(默认:`data/lists/xeactor-pkgs.txt`) - `AUR_XEACTOR_URL` — 可选的远程列表 URL(默认:仅使用内置列表) - `AUR_XEACTOR_WINDOW_*` — 覆盖 2018 年 6 月 7 日-7 月 10 日的攻击窗口(日志正则表达式,标签) ### Chaos RAT 与 Atomic Arch 这些是**独立的 AUR 威胁攻击活动**,它们面临相同的用户群体(AUR + 开发者机器)。完整来源信息:[`data/docs/chaos-rat.md`](data/docs/chaos-rat.md)。 | | Atomic Arch(此工具包的主要焦点) | Chaos RAT(可选) | |---|-------------------------------------------|---------------------| | 攻击活动 | 孤立的 AUR 软件包中的 `atomic-lockfile` / `js-digest` npm 钩子 | 破解/修补过的浏览器和游戏软件包(`librewolf-fix-bin`, `minecraft-cracked` 等) | | 日期窗口 | 2026 年 6 月 9-14 日 安装/时间线相关性 | **2025 年 7 月 16-18 日** 安装/时间线相关性 | | 默认扫描 | 始终扫描(步骤 1-4) | 除非使用 `--chaos-rat` 或 `AUR_ENABLE_CHAOS_RAT=1`,否则关闭 | | 退出严重性 | `1` 入侵 | `2` 警告(除非被 `--fail-on` 抑制) | | 恢复 | 完整的操作手册:移除 → 审计 → 轮换凭证 | 仅移除软件包;无自动化凭证审计链 | | 时间线 | `scan/atomic-arch-timeline.fish`(步骤 3) | `scan/chaos-rat-timeline.fish`(步骤 3b,可选) | ``` # 在 Atomic Arch 检查的同时可选启用 Chaos RAT 扫描 fish run.fish --chaos-rat --local # 独立的 Chaos RAT 软件包检查 fish scripts/check/chaos-rat-pkgs.fish --chaos-rat --local # 移除 Chaos RAT 软件包(单独的列表) fish scripts/recovery/remove-packages.fish --list chaos-rat --dry-run ``` 参考资料和上游列表 URL:[`data/docs/chaos-rat.md`](data/docs/chaos-rat.md)。 ### Mini Shai-Hulud 与 Atomic Arch | | Atomic Arch | Mini Shai-Hulud(可选) | |---|-------------|--------------------------| | 攻击活动 | `atomic-lockfile` / `js-digest` npm 钩子 | 接管的 wallet/VPN 软件包中的 `crypto-javascript` npm 钩子 | | 日期窗口 | 2026 年 6 月 9-14 日 | **2026 年 5 月 16-17 日** | | 默认扫描 | 始终扫描(步骤 1-4) | 除非使用 `--shai-hulud` 或 `AUR_ENABLE_SHAI_HULUD=1`,否则关闭 | | 退出严重性 | `1` 入侵 | `2` 警告(除非被 `--fail-on` 抑制) | | 恢复 | 完整的操作手册 | 移除软件包;**在轮换 GitHub token 之前停止 `gh-token-monitor`** | | 时间线 | 步骤 3 | `scan/shai-hulud-timeline.fish`(步骤 3c,可选) | ``` # 在 Atomic Arch 检查的同时可选启用 Shai-Hulud 扫描 fish run.fish --shai-hulud --local fish scripts/check/shai-hulud-pkgs.fish --shai-hulud --local fish scripts/recovery/remove-packages.fish --list shai-hulud --dry-run ``` 参考资料:[`data/docs/shai-hulud.md`](data/docs/shai-hulud.md)。 ### xeactor 与 Atomic Arch | | Atomic Arch | xeactor(可选) | |---|-------------|------------------------| | 攻击活动 | `atomic-lockfile` / `js-digest` npm 钩子 | 孤立软件包接管;PKGBUILD 中的 `ptpb.pw` 渗出脚本 | | 日期窗口 | 2026 年 6 月 9-14 日 | **2018 年 6 月 7 日-7 月 10 日** | | 默认扫描 | 始终扫描(步骤 1-4) | 除非使用 `--xeactor` 或 `AUR_ENABLE_XEACTOR=1`,否则关闭 | | 退出严重性 | `1` 入侵 | `2` 警告(除非被 `--fail-on` 抑制) | | 恢复 | 完整的操作手册 | 仅移除软件包;独立的 2018 年事件 | | 时间线 | 步骤 3 | `scan/xeactor-timeline.fish`(步骤 3d,可选) | ``` # 在 Atomic Arch 检查的同时可选启用 xeactor 扫描 fish run.fish --xeactor --local fish scripts/check/xeactor-pkgs.fish --xeactor --local fish scripts/recovery/remove-packages.fish --list xeactor --dry-run ``` 参考资料:[`data/docs/xeactor.md`](data/docs/xeactor.md)。 ## 用法 ### 推荐命令 ``` # 标准扫描 —— 获取最新列表,打印结果 fish run.fish # 离线 / air-gapped —— 仅使用内置列表 fish run.fish --local # 始终运行凭据审计 + 轮换提示,即使系统是干净的 fish run.fish --audit # 在 reports/ 下保存带有时间戳的报告以及 JSON 摘要 fish run.fish --report --json # 用于 timers/CI 的静默模式 —— 极简 stdout,仍会写入报告/json fish run.fish --local --quiet --report --json --fail-on compromise --quick # 交互式恢复向导(移除 → 验证 → 轮换 → 清理所有 shells) fish run.fish --recover --report ``` ### 所有 `run.fish` 参数 | 参数 | 效果 | |------|--------| | `--local` | 跳过网络获取;使用 `data/lists/atomic-arch-pkgs.txt` | | `--audit` | 始终运行步骤 6-7(凭证审计 + 轮换提示) | | `--report` | 将统一日志写入 `reports/full-scan-*.log` | | `--json` | 在结束时将 JSON 摘要打印到标准输出(`reports/latest-summary.json`) | | `--quiet` | 抑制扫描输出(在请求时仍会写入 report/json) | | `--quick` | 更快的工件扫描(更窄的搜索路径) | | `--all-time` | 在已安装软件包和时间线检查中忽略 6 月 9-14 日的时间窗口 | | `--recover` | 发现入侵时的交互式恢复向导 | | `--if-compromised` | 仅在检测到入侵时凭证审计才失败(自动使用) | | `--fail-on MODE` | 退出策略:`all`(默认)、`compromise`、`chaos-rat`、`shai-hulud`、`xeactor`、`none` | | `--chaos-rat` | 同时运行 Chaos RAT 软件包扫描(仅警告;独立的威胁列表) | | `--shai-hulud` | 同时运行 Mini Shai-Hulud 软件包扫描(仅警告;独立的威胁列表) | | `--xeactor` | 同时运行 xeactor 软件包扫描(仅警告;独立的威胁列表) | | `--prune-days N` | 扫描后删除超过 N 天的报告文件 | | `--skip-pkg-check` | 跳过步骤 1(如果您已经移除了软件包,这很有用) | | `--version` | 打印工具包版本 | | `-h`, `--help` | 显示用法 | 独立脚本在相关情况下会接受 `--local`、`--report`、`--quiet` 和 `--help` 参数: ``` fish scripts/check/atomic-arch-pkgs.fish --local fish scripts/scan/malware-artifacts.fish fish scripts/scan/similar-heuristics.fish --local fish scripts/check/list-freshness.fish fish scripts/audit/stolen-credentials.fish --help ``` ## 如果发现了可疑项 请按此顺序操作。如果在入侵窗口期间安装了受感染的软件包,请勿跳过凭证轮换。 ``` # 1. 预览将要移除的内容 fish scripts/recovery/remove-packages.fish --dry-run # 2. 移除受感染的软件包(交互式确认) fish scripts/recovery/remove-packages.fish # 3. 验证移除 fish scripts/recovery/remove-packages.fish --verify # 4. 通过完整审计重新扫描并保存报告 fish run.fish --audit --report # 5. 应用加固建议(可选) fish scripts/recovery/apply-hardening.fish fish scripts/recovery/apply-hardening.fish --apply # 6. 轮换凭据 —— 遵循打印的提示 fish scripts/recovery/rotate-hints.fish # 6. 在轮换 secrets 后,将其从 shell history 中脱敏(所有 shells) fish scripts/recovery/scrub-history.fish --dry-run fish scripts/recovery/scrub-history.fish --all-shells ``` `recovery/remove-packages.fish` 参数: | 参数 | 效果 | |------|--------| | `--dry-run` | 显示软件包和 `pacman -Rns` 命令而不实际运行 | | `--force` | 跳过确认提示 | | `--verify` | 如果仍有任何匹配的软件包处于安装状态,则以非零状态码退出 | | `--list TYPE` | 要匹配的列表:`atomic-arch`(默认)、`chaos-rat`、`shai-hulud` 或 `xeactor` | | `pkg ...` | 移除特定的软件包,而不是从列表中自动检测 | ## 恶意软件窃取了什么 `deps` 窃密木马针对开发者凭证:SSH 密钥、浏览器 Cookie、GitHub/npm token、Docker 注册表认证、Discord/Slack/Teams 会话、Vault token、shell 历史记录、`.env` 文件等。有关完整的 IOC,请参阅 [ioctl.fail 分析](https://ioctl.fail/preliminary-analysis-of-aur-malware/)。 **如果在 2026 年 6 月 9 日至 14 日期间安装了任何受感染的软件包,请假定这些凭证已遭到泄露并对其进行轮换。** ## 自动化 ### 退出代码 | 代码 | 含义 | |:----:|---------| | `0` | 未检测到问题 | | `1` | 入侵指标(受感染的软件包、时间线命中记录、工件、严重的未知窗口软件包) | | `2` | 仅有警告(安全加固建议、时间窗口内良性的未知 AUR 软件包、可选的 Chaos RAT / Shai-Hulud / xeactor 命中记录) | | `3` | 数据不足(无法读取 pacman 日志) | | `4` | 无效的 CLI 参数 | 在定时任务中使用 `--fail-on compromise`,这样安全加固相关的警告就不会触发警报: ``` fish run.fish --local --json --fail-on compromise || notify-send "AUR incident: issues found" ``` `reports/latest-summary.json` 包含结构化的 `findings` 数组(软件包名称、工件路径、时间线行)以及 `severity`、工具包 `version` 和可选活动的计数器(`chaos_rat_*`, `shai_hulud_*`)。 ### 每周 systemd 定时器(可选) ``` mkdir -p ~/.config/systemd/user ln -sf ~/aur-response-toolkit/systemd/aur-response-scan.service ~/.config/systemd/user/ ln -sf ~/aur-response-toolkit/systemd/aur-response-scan.timer ~/.config/systemd/user/ systemctl --user daemon-reload systemctl --user enable --now aur-response-scan.timer ``` 该服务使用 `--fail-on compromise --quick` 参数,并遵循 unit 文件中的 `AUR_RESPONSE_DIR` 配置。如有必要,请调整符号链接中的克隆路径。 ## 开发 请参阅 [CONTRIBUTING.md](CONTRIBUTING.md) 和 [SECURITY.md](SECURITY.md)。 ``` # Lint 所有 Fish 脚本 fish lint.fish # 运行完整的 test suite fish tests/run-all.fish ``` ### 项目布局 ``` aur-response-toolkit/ ├── run.fish # Main entry point (orchestrator) ├── run.sh # Bash wrapper → run.fish ├── install.fish # User (~/.local/bin) or FHS (--system / --prefix) install ├── bin/aur-run.fish # Portable entry point (resolves clone path) ├── VERSION # Toolkit version (see file) ├── config.fish.example # Optional user config template ├── lint.fish # fishcheck linter for all scripts ├── lib/ │ ├── common.fish # Shared helpers (paths, pacman, lists) │ ├── findings.fish # Tab-delimited findings store │ ├── history.fish # Shell history helpers │ ├── ioc.fish # Malware IOC and persistence detection │ └── reports.fish # JSON summary and report retention ├── scripts/ # Role-based scripts (see subdirs) │ ├── _init.fish # Shared bootstrap for category scripts │ ├── check/ # Installed package list checks │ │ ├── atomic-arch-pkgs.fish │ │ ├── chaos-rat-pkgs.fish │ │ ├── shai-hulud-pkgs.fish │ │ ├── xeactor-pkgs.fish │ │ └── list-freshness.fish │ ├── scan/ # Timeline, window, IOC, hardening scans │ │ ├── aur-window.fish │ │ ├── atomic-arch-timeline.fish │ │ ├── chaos-rat-timeline.fish │ │ ├── shai-hulud-timeline.fish │ │ ├── xeactor-timeline.fish │ │ ├── malware-artifacts.fish │ │ ├── similar-heuristics.fish │ │ └── hardening.fish │ ├── audit/ │ │ └── stolen-credentials.fish │ └── recovery/ # Post-incident actions │ ├── remove-packages.fish │ ├── rotate-hints.fish │ ├── scrub-history.fish │ └── apply-hardening.fish ├── data/ │ ├── lists/ # Bundled and cached campaign package lists │ │ ├── atomic-arch-pkgs.txt │ │ ├── chaos-rat-pkgs.txt │ │ ├── shai-hulud-pkgs.txt │ │ └── xeactor-pkgs.txt │ └── docs/ # Provenance, IOC refs, attribution │ ├── sources.md # Index: all campaigns, code map, licenses │ ├── atomic-arch.md │ ├── chaos-rat.md │ ├── shai-hulud.md │ ├── xeactor.md │ └── third-party-notices.md ├── reports/ # Generated logs (gitignored) ├── tests/ │ ├── run-all.fish # Full test suite (auto-discovers suites) │ ├── support/test-utils.fish │ ├── unit/ # Pure function tests by role │ │ ├── check/ │ │ ├── scan/ │ │ ├── audit/ │ │ ├── recovery/ │ │ └── lib/ │ ├── integration/ # End-to-end script tests by role │ │ ├── cli/ │ │ ├── scan/ │ │ ├── recovery/ │ │ └── run/ │ └── fixtures/ # Test inputs by type │ ├── lists/ │ ├── logs/ │ ├── pkgbuilds/ │ ├── history/ │ ├── fetch/ │ ├── env/ │ └── misc/ ├── .github/workflows/ci.yml # CI: Ubuntu + Arch, lint + tests ├── .github/workflows/release.yml # GitHub Release on v* tags └── systemd/ ├── aur-response-scan.service # Weekly user timer unit ├── aur-response-scan.timer └── aur-response-notify@.service # Example notify-on-scan unit ``` ## 参考资料 上游链接、IOC 来源和许可证说明保存在源文档中(避免在此处重复 URL): | 攻击活动 | 文档 | |----------|----------| | 索引(所有攻击活动) | [`data/docs/sources.md`](data/docs/sources.md) | | Atomic Arch | [`data/docs/atomic-arch.md`](data/docs/atomic-arch.md) | | Chaos RAT | [`data/docs/chaos-rat.md`](data/docs/chaos-rat.md) | | Mini Shai-Hulud | [`data/docs/shai-hulud.md`](data/docs/shai-hulud.md) | | xeactor (2018) | [`data/docs/xeactor.md`](data/docs/xeactor.md) | | 第三方版权声明 | [`data/docs/third-party-notices.md`](data/docs/third-party-notices.md) | ## 许可证 [MIT](LICENSE)
标签:Fish Shell, PB级数据处理, StruQ, 安全运维, 库, 应急响应, 应用安全, 暗色界面, 网络信息收集, 网页分析工具