mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 07:20:22 +08:00
fix: 全仓审计加固与死代码清理,版本 1.1.87
- 回滚/备份:空 bak 改名 .bad 跳过;升级刷新 bak 补上单数 marker 补丁;统一原子写 - 补丁命中:optional 命中不符记软失败;#42 插入型替换加探针防重复插入 - Windows:进程枚举改用 | 分隔 + UTF-8,修复中文路径换包不杀旧进程;换包失败拉起原版 - 安全:asar 解包防越界;红队路径校验 realpath 防空 symlink;更新仅 https;报告回放去换行注入 - 提示词钩子:停用后 rewriteFn 返回原装配文本并清理 assemble guard;缓存签名纳入红队/策略/override - 红队:listEngagements 默认不算统计;listVulns/报告支持 evidenceLimit - 子代理名额占位即时生效并回退;--apply 有失败项退出码 1 - 清理:删除 lib/mnemon-settings.js 及 13 处死代码/未使用 import;移除 test 目录与 test 脚本
This commit is contained in:
1 parent
71d3a55884
commit
f806b048ac
48 files changed
+890
-1652
No files matched your search
@@ -1,3 +1,49 @@
|
||||
# 1.1.87
|
||||
|
||||
## 中文
|
||||
|
||||
- 版本 **1.1.87**。
|
||||
- **回滚 / 备份加固**:
|
||||
- 0 字节的 `.dshpurge.bak` 不再被当成"原版"写回宿主:`revertAll` / `restoreFromBak` 遇到空备份会改名为 `.bad` 并跳过,下次启动顺手清掉残骸。
|
||||
- 宿主升级后刷新过期 bak 时补上单数 `marker` 的补丁(#6/#7/#8/#10),不再漏掉这些基线,避免旧 bak 覆盖新版文件导致新旧代码混合。
|
||||
- 备份、配置、状态、覆盖文件统一走原子写(临时文件 + fsync + rename),断电或进程被杀不会留下半截文件。
|
||||
- **补丁命中契约**:标记 `optional` 的补丁命中数不符时记为软失败,不再阻断整体应用;#42 的两处插入型替换加探针,重复应用不会二次插入。
|
||||
- **桌面 / 进程(Windows)**:
|
||||
- 进程枚举改用 `|` 分隔并强制 UTF-8 输出,修复中文安装路径下换包时旧进程杀不掉的问题。
|
||||
- helper 只有在确实拿到 exe 路径时才带 `killApp`;换包失败会把原版重新拉起并写日志,不再留空桌面。
|
||||
- **安全加固**:
|
||||
- asar 解包校验输出路径必须位于目标目录内,越界条目跳过并告警。
|
||||
- 红队文件读写路径校验对最近存在的祖先做 `realpath`,堵住 symlink 逃逸。
|
||||
- 更新检查只允许 `https`。
|
||||
- 报告回放生成的 curl / HTTP 报文对头部、Cookie、请求体去除换行,防注入。
|
||||
- **提示词 / 运行钩子**:插件停用后 `rewriteFn` 直接返回宿主原始装配文本,不再残留注入;停用时清理 assemble guard;运行时缓存签名纳入红队设置、策略与 override 版本,状态变化立即生效。
|
||||
- **红队演练台**:`listEngagements` 默认不再逐条统计;漏洞列表与报告支持 `evidenceLimit`,大证据不再拖慢面板。
|
||||
- **子代理**:名额占位改为立即占用(`n+1`),append 失败时回退,避免并发派出超限。
|
||||
- **CLI**:`--apply` 存在失败项时以退出码 1 结束,脚本调用能感知失败。
|
||||
- **清理**:删除无引用的 `lib/mnemon-settings.js` 及 13 处死代码 / 未使用的 import;移除 `test/` 目录与 `test` 脚本,发布 CI 只做语法检查。
|
||||
|
||||
## English
|
||||
|
||||
- **1.1.87**.
|
||||
- **Rollback / backup hardening**:
|
||||
- A zero-byte `.dshpurge.bak` is no longer treated as the original and written back to the host: `revertAll` / `restoreFromBak` rename it to `.bad` and skip it; leftovers are swept on the next start.
|
||||
- When refreshing stale backups after a host upgrade, patches that use the singular `marker` form (#6/#7/#8/#10) are now included, so their baseline is not missed and an old backup can no longer overwrite the new file.
|
||||
- Backups, config, state and override files are written atomically (temp file + fsync + rename), so a crash never leaves a half-written file.
|
||||
- **Patch hit contract**: `optional` patches that miss their expected hit count are recorded as soft failures instead of blocking the whole apply; the two insert-type replacements in #42 gained probes so re-applying does not insert twice.
|
||||
- **Desktop / processes (Windows)**:
|
||||
- Process enumeration now uses `|` separators and forces UTF-8 output, fixing the case where the old process survived an asar swap under a Chinese install path.
|
||||
- The helper passes `killApp` only when an exe path is known; a failed swap relaunches the original app and writes a log instead of leaving an empty desktop.
|
||||
- **Security hardening**:
|
||||
- Asar extraction verifies each output path stays inside the destination directory; entries outside are skipped with a warning.
|
||||
- Red-team path validation resolves `realpath` for the nearest existing ancestor, closing the symlink escape.
|
||||
- Update checks accept `https` only.
|
||||
- Curl / HTTP replay text strips newlines from headers, cookies and body to prevent injection.
|
||||
- **Prompt / runtime hooks**: after the plugin is disabled, `rewriteFn` returns the host's assembled prompt unchanged and the assemble guard is cleared; the runtime cache signature now includes red-team settings, policy and override revision so changes take effect immediately.
|
||||
- **Red-team console**: `listEngagements` no longer computes per-row stats by default; vuln lists and reports accept `evidenceLimit` so large evidence no longer slows the panel.
|
||||
- **Subagents**: slot reservation now takes effect immediately (`n+1`) and rolls back if the append fails, preventing over-limit dispatch under concurrency.
|
||||
- **CLI**: `--apply` exits with code 1 when any item failed, so scripts can detect the failure.
|
||||
- **Cleanup**: removed the unreferenced `lib/mnemon-settings.js` plus 13 dead functions / unused imports; dropped the `test/` directory and `test` script — release CI now runs syntax checks only.
|
||||
|
||||
# 1.1.86
|
||||
|
||||
## 中文
|
||||
|
||||
Reference in new issue
Block a user