dsh-redteam-model
SeaOf0
基于dsh web实现的多种模式,目的是服务于redteam进行授权的安全研究,覆盖渗透测试、红队评估、代码审计等范围领域,请勿用于非法行为。(允许二开,赋予模块各位自己的业务逻辑,方法论只有自己熟练的才好用,好的方法论=好的生态)
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:wuxiaozp/dsh-netgate
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
NetGate for DeepSeek Harness: one switch that cuts the model off the internet — phone (dsh-go) and Windows (DSH Desktop) — and most local work keeps working.
| 平台 | 位置 | 说明 |
|---|---|---|
| 手机端(dsh-go) | 本仓库根目录 | 原生插件:移除联网工具 + 命令守卫 + 进程级断网(netguard.so);本地编辑照常,编译/装包等需要联网的步骤可能失败 |
| 电脑端(DeepSeek Harness) | windows/ |
Cordis 插件:输入框上方开关 + 命令守卫;Windows 没有 LD_PRELOAD,不做进程级断网 |
| 项目 | 手机端(dsh-go) | 电脑端(DeepSeek Harness) |
|---|---|---|
| 宿主 / 安装 | 安卓上的 dsh-go App | Windows 上的 DSH Desktop |
| 断网层次 | 工具移除 + 命令守卫 + 进程级(netguard.so 拦 connect()) |
工具移除 + 命令守卫(没有进程级) |
| 能否绕过 | 脚本里拼 URL 也没用,连接直接失败 | 字符串匹配可被动态拼接绕过;系统级要配合沙箱/审批 |
| 严格模式 | 停用 bash 与手机 shell;重启后保留 | 停用 bash / pwsh / terminal / run_code;重启后自动关闭 |
| 打开网页 | 拒绝模型用浏览器打开 http 链接 | 没有浏览器工具 |
| 操作方式 | 点状态条弹出面板 | 点开关;关掉后旁边出现「严格」按钮 |
| 当前版本 | 0.3.0 |
0.1.9 |
版本号为什么不同:两个包独立开发、独立发版,
0.3.0与0.1.9不能横向比较,各自以最新 Release 为准。 两个包也不能互相安装——包名、宿主、安装目标都不同。
给 DeepSeek Harness 加一个「联网总开关」,手机端(dsh-go)与电脑端(DSH Desktop)各有实现。 关掉后,模型不只是"没有联网搜索工具",而是真的连不出去;打开后一切恢复。
下面主要讲手机端;电脑端的实现与限制见 windows/docs/DETAIL.md。
DSH 里 web_search / web_fetch 挂在每个会话的 preset 上,没有开关。更麻烦的是:
只把这两个工具藏起来并不够——模型会改用 bash + curl / python urllib 自己抓。
这个插件把三层一起关掉:
| 层 | 关掉时发生什么 |
|---|---|
| 工具层 | web_search、web_fetch 从工具列表移除 |
| 守卫层 | 明显的联网命令(curl、wget、网址、python 联网、git clone、装包)执行前被拒,并回一句「联网已关闭」 |
| 进程层 | /usr/local/bin/bash 注入 netguard.so:bash 及其所有子进程的非回环连接直接 ECONNREFUSED——写进脚本也一样 |
同时,模型用浏览器打开网页也会被拒。本地读写文件、python3/node 本地计算通常照常;
但编译、装包、拉依赖等需要联网的步骤可能失败或变慢——这是开关的副作用,不是 bug,
要用时先点开联网。
还有一档严格模式:关闭联网之后可以一键连 bash 和手机 shell 一起停用,模型
完全没有执行命令的入口,适合"只让它说话、别动手"的时候。
bash 与手机 shell 一并停用;再点「关闭严格模式」或打开联网即恢复。python3 - <<'PY'
import socket
s = socket.socket(); s.settimeout(3)
try:
s.connect(("223.5.5.5", 443)); print("OPEN")
except Exception as e:
print("BLOCKED", e)
PY
关闭时应输出 BLOCKED ... Connection refused;打开后应输出 OPEN。
bash 包装器 ──锁文件存在──> LD_PRELOAD=netguard.so ──> connect()/sendto() 拒绝非回环
│ │
└── 未启动 preload 时原样 exec /usr/bin/bash └── 回环、Unix socket 放行
$DSH_HOME/dsh-go/netguard.lock 这个文件在不在。.so,不受拦截。LD_PRELOAD 绕过;守卫会拦下提到该变量的命令。netguard.so 是 arm64 + glibc 的预编译版本;其它架构执行 netguard/build.sh 重编。/usr/bin/bash(找不到时回退 /bin/bash)。npm/pnpm install、git clone、下载依赖等需要联网的步骤会失败或变慢;
本地编辑不受影响,但“写代码”里包含的联网环节会受影响。A switch for DeepSeek Harness on the phone (dsh-go). When it is off the model is not merely missing the web tools — it cannot reach the network at all. Turning it back on restores everything.
This section covers the phone build; the Windows build is under
windows/ with its own DETAIL.
DSH mounts web_search / web_fetch inside every session preset and offers no
toggle. Hiding those two tools is not enough: a model with bash will happily
curl a search engine or fetch pages from python3. NetGate closes three layers:
| Layer | While off |
|---|---|
| Tools | web_search and web_fetch leave the tool list |
| Guard | Obvious network commands (curl, wget, URLs, python networking, git clone, package installs) are refused before they run |
| Process | /usr/local/bin/bash loads netguard.so; every non-loopback connect() from the shell and its children returns ECONNREFUSED — including commands run from a script |
Model-initiated browser opens are refused too. Local file work and python3 / node
computation usually keep working; builds, installs and dependency downloads that need
the network may fail or slow down — turn the switch back on for those.
There is also a strict mode: once web access is off, one tap also removes
bash and the phone shell, so the model cannot run any command at all.
bash and the phone shell too. Turn strict off, or turn web access back on,
to restore everything.python3 - <<'PY'
import socket
s = socket.socket(); s.settimeout(3)
try:
s.connect(("223.5.5.5", 443)); print("OPEN")
except Exception as e:
print("BLOCKED", e)
PY
BLOCKED ... Connection refused while off, OPEN while on.
/usr/local/bin/bash is a wrapper. When $DSH_HOME/dsh-go/netguard.lock exists it
exports LD_PRELOAD=netguard.so, which refuses non-loopback connect() / sendto()
in the shell and everything it spawns. The engine's own model connection does not go
through that shell, so conversations keep working.
.so.LD_PRELOAD defeats it; the guard rejects commands that mention it.netguard.so is built for arm64 + glibc. Rebuild on other
architectures with netguard/build.sh (tcc or gcc)./usr/bin/bash (falls back to /bin/bash).你可以自由使用、修改和分发这个插件,包括用于商业项目,不需要署名,也不需要额外申请。
You are free to use, modify and distribute this plugin, including in commercial projects, without attribution or further permission.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: privacy。