rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:lovesion/dsh-plugin-sudo
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
给 DeepSeek Harness 用的 sudo_run 工具插件。
Agent 需要 root 权限时,在 DSH 的提问面板里向你要 sudo 密码——掩码输入,密码直接从面板进 sudo 的 stdin。它不会出现在工具参数、工具结果、会话记录或模型上下文里。
提问面板(掩码输入) ──▶ 插件进程内存 ──▶ sudo 的 stdin ──▶ child stdin
模型只能看到 command 和返回的 stdout / stderr。
插件只依赖 node:child_process,没有任何 npm 依赖,也不需要构建。
git clone https://github.com/lovesion/dsh-plugin-sudo.git \
"${DSH_HOME:-$HOME/.dsh}/profiles/dsh-tui/plugins/dsh-plugin-sudo"
然后在 profile 的 cordis.patch.yml 末尾加一条:
- insert:
- id: tool-sudo
name: "./plugins/dsh-plugin-sudo/index.mjs"
重启 DSH(或等 Cordis 热重载)后,sudo_run 就出现在工具列表里。
如果这个包发布到了 npm:
dsh plugin --profile dsh-tui add dsh-plugin-sudo
包内的 cordis.patch.yml(dsh.bundle.patch 指向它)会负责把插件插进 profile。这个包目前没有发布到 npm,所以这条路径暂时不可用。
在 DSH 0.19.0 / Node.js 26 / Arch Linux 上测试通过。插件只用到宿主提供的 tools 和 userQuestions 两个服务。
工具名 sudo_run:
| 参数 | 必填 | 说明 |
|---|---|---|
description |
是 | 命令的主动语态短描述,显示在密码提示里 |
command |
是 | 用 bash -lc 执行的命令 |
timeoutMs |
否 | 超时毫秒,默认 120000,上限 600000 |
返回 { exitCode, stdout, stderr }。非零退出码是正常结果,由 agent 自行判断;超时返回 124,取消返回 130。stdout / stderr 各自只保留末尾 32 KB。
sudo -n true。sudo 时间戳还有效时直接用缓存凭据,不打扰你。userQuestions 提一个 secret: true 的问题,头部是「sudo 密码」。sudo -S -p '' 的 stdin(不经过 argv,ps 看不到),随后用 Buffer.fill(0) 清零。130,不会静默失败。index.mjs 的 177 行里,可以直接读完。requiretty,stdin 管道会失败。yay / paru:它们内部会再调 sudo,拿不到 stdin,会报「读取密码需要一个终端」。用等效的 pacman 命令,或先在终端 sudo -v。•),说明当前宿主的 UI 忽略了 secret 字段;密码仍然不进模型上下文,只是输入时可见。sudo)。MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。