mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 10:20:22 +08:00
fix: 发布 1.1.57,应用后挂上提示词并让 Messages 使用当前系统提示
官方其余模式与标准一样清拦截。演练授权按本机目录保留,卸载成功后才清。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
54351cff82
commit
2c07aafead
12 files changed
+694
-271
No files matched your search
@@ -366,6 +366,8 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
|
||||
"patch.25": "去掉官方默认身份(功能提示词不动)",
|
||||
"patch.26": "minimal:去掉默认身份并打开 inject",
|
||||
"patch.28": "dsh-liangshen(梁神):phase-1 保留注入段",
|
||||
"patch.70": "极简模式终端不再禁止网络",
|
||||
"patch.71": "梁神去掉官方身份句",
|
||||
"patch.29": "dsh-tool-web:外部 untrusted 拦截→可执行",
|
||||
"patch.30": "dsh-hooks-claude-code:deny→allow",
|
||||
"patch.31": "dsh-hooks-codex:deny→allow",
|
||||
@@ -661,6 +663,8 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
|
||||
"patch.25": "Strip official default identity (keep feature prompts)",
|
||||
"patch.26": "minimal: strip identity, open inject",
|
||||
"patch.28": "dsh-liangshen: keep inject in phase-1",
|
||||
"patch.70": "Minimal shell drops the no-network line",
|
||||
"patch.71": "Liangshen drops the stock identity line",
|
||||
"patch.29": "dsh-tool-web: untrusted framing → usable data",
|
||||
"patch.30": "dsh-hooks-claude-code: deny→allow",
|
||||
"patch.31": "dsh-hooks-codex: deny→allow",
|
||||
@@ -1158,9 +1162,17 @@ body:not([data-ds-dark-theme]) .dshp-auth-ops button.primary{background:var(--ds
|
||||
const actionTicket = useRef(0);
|
||||
const overrideRef = useRef("");
|
||||
const defaultOverrideRef = useRef("");
|
||||
const promptAreaRef = useRef(null);
|
||||
overrideRef.current = override;
|
||||
defaultOverrideRef.current = defaultOverride;
|
||||
|
||||
const readPromptBox = () => {
|
||||
const node = promptAreaRef.current;
|
||||
const live = node && typeof node.value === "string" ? node.value : overrideRef.current;
|
||||
overrideRef.current = live || "";
|
||||
return overrideRef.current;
|
||||
};
|
||||
|
||||
const syncPicks = (d) => {
|
||||
const versions = (d && d.versions) || [];
|
||||
const ceiling = listedCeiling(versions, d && d.localVersion);
|
||||
@@ -1361,7 +1373,7 @@ body:not([data-ds-dark-theme]) .dshp-auth-ops button.primary{background:var(--ds
|
||||
setPatchBusy(true);
|
||||
setAskRestart(false);
|
||||
setNotice({ kind: "idle", text: "" });
|
||||
const applyContent = overrideRef.current || "";
|
||||
const applyContent = action === "apply" ? readPromptBox() : "";
|
||||
fetch("/dsh-purge/" + action, {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/json" },
|
||||
@@ -1458,10 +1470,11 @@ body:not([data-ds-dark-theme]) .dshp-auth-ops button.primary{background:var(--ds
|
||||
setPatchBusy(true);
|
||||
setAskRestart(false);
|
||||
setNotice({ kind: "idle", text: "" });
|
||||
const content = readPromptBox();
|
||||
fetch("/dsh-purge/override", {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/json" },
|
||||
body: JSON.stringify({ content: overrideRef.current }),
|
||||
body: JSON.stringify({ content: content }),
|
||||
})
|
||||
.then((r) => r.json())
|
||||
.then((d) => {
|
||||
@@ -1481,7 +1494,7 @@ body:not([data-ds-dark-theme]) .dshp-auth-ops button.primary{background:var(--ds
|
||||
if (ticket === actionTicket.current) setPatchBusy(false);
|
||||
});
|
||||
};
|
||||
bothInjectEmpty(overrideRef.current, defaultOverrideRef.current).then((empty) => {
|
||||
bothInjectEmpty(readPromptBox(), defaultOverrideRef.current).then((empty) => {
|
||||
if (ticket !== actionTicket.current) return;
|
||||
if (empty) {
|
||||
rejectNeedPrompt(tr);
|
||||
@@ -1672,7 +1685,7 @@ body:not([data-ds-dark-theme]) .dshp-auth-ops button.primary{background:var(--ds
|
||||
h("div", { className: "dshp-bar", "aria-hidden": "true" }, h("i", { style: { width: pct + "%" } })),
|
||||
h(PatchGroups, { state: s }),
|
||||
h("div", { className: "dshp-row", style: { marginTop: 14 } },
|
||||
h(Btn, { kind: "primary", disabled: patchBusy || uninstallBusy, onClick: () => doAction("apply", "action.apply") }, patchBusy ? t("btn.apply.busy") : t("btn.apply")),
|
||||
h(Btn, { kind: "primary", disabled: patchBusy || uninstallBusy || !overrideLoaded, onClick: () => doAction("apply", "action.apply") }, patchBusy ? t("btn.apply.busy") : t("btn.apply")),
|
||||
h(Btn, { kind: "danger", disabled: patchBusy || uninstallBusy, onClick: () => doAction("revert", "action.revert") }, t("btn.revert")),
|
||||
h(Btn, { kind: "solid-danger", disabled: patchBusy || uninstallBusy, onClick: () => setAskUninstall(true) }, uninstallBusy ? t("btn.uninstall.busy") : t("btn.uninstall")),
|
||||
noticeNode(notice),
|
||||
@@ -1738,6 +1751,7 @@ body:not([data-ds-dark-theme]) .dshp-auth-ops button.primary{background:var(--ds
|
||||
),
|
||||
h("textarea", {
|
||||
className: "dshp-area",
|
||||
ref: promptAreaRef,
|
||||
value: override,
|
||||
onChange: (e) => {
|
||||
overrideRef.current = e.target.value;
|
||||
@@ -7148,6 +7162,9 @@ body[data-ds-dark-theme] .dshp-rewind-item span{color:var(--dsw-alias-label-tert
|
||||
|
||||
const AUTH_KEY = "dsh-purge-drill-auth";
|
||||
const WELCOME_KEY = "dsh-purge-user-notice-v1";
|
||||
let drillGrantGen = 0;
|
||||
let drillGrantPosting = 0;
|
||||
let drillGrantState = { ready: false, granted: false };
|
||||
const AUTH_LEGAL_HTML = "<h3>严正法律免责与合规使用声明</h3>\r\n <p>本声明在进入演练台前必须全文阅读。本项目是非营利开源项目,遵守国家法律法规及所在平台的规范,仅供学习与研究、技术参考。严禁任何主体把本项目用于商业售卖、付费倒卖或黑灰产牟利。</p>\r\n <p>开发者坚决反对并严禁任何形式的违法犯罪,绝不支持、不鼓励、不协助未授权网络攻击、漏洞利用、数据窃取、非法侵入计算机信息系统,或生成违法违禁内容。任何将本项目用于违法犯罪的行为,均与开发者无关,由行为人依法独立承担全部法律责任。不得以科研、教学、测试、演示或内部学习为由规避下列条款。</p>\r\n <h3>1. 本仓库不含违法内容</h3>\r\n <p>dsh-purge 发布的代码、文档、补丁与默认提示词不是木马、后门、未授权渗透工具、勒索软件、撞库脚本,也不是针对公网或第三方系统的攻击载荷。项目不提供违法内容,也不教唆、组织、协助实施违法犯罪。</p>\r\n <h3>2. 本机操作不构成对外授权</h3>\r\n <p>应用补丁、写入、回滚、卸载,都在本机文件和本机进程内完成。这些操作不对任何公网主机或未授权系统进行扫描、探测、入侵或攻击发包,也不得把本机当作跳板。</p>\r\n <p>插件若开启检测更新,仅可能访问本插件自己的 GitHub 仓库以核对版本。该访问与对第三方系统的网络攻击无关,不能被解释为对外渗透的授权。</p>\r\n <h3>3. 允许使用的范围</h3>\r\n <p>只允许用在你能证明有权处理的环境:本人有权管理的本机官方 Harness;离线的本地合成靶标;所有者已经出具合法书面授权的网络安全演练靶场;合规实验室里的受控环境。书面授权要能对应具体目标、时间和范围。只填写一个单位名称,或只有口头说法,不构成授权。</p>\r\n <p>未经所有者合法书面授权的目标、公网在线系统、生产业务,以及能源、交通、水利、金融、公共服务、电子政务等关键信息基础设施,都不得作为演练对象。</p>\r\n <h3>4. 必须遵守的法律,按条、款</h3>\r\n <p>《中华人民共和国刑法》第二百八十五条第一款:禁止违反国家规定,侵入国家事务、国防建设、尖端科学技术领域的计算机信息系统。</p>\r\n <p>同条第二款:禁止侵入前款规定以外的计算机信息系统,或者用其他技术手段,获取该系统中存储、处理或者传输的数据,或者对该系统实施非法控制。</p>\r\n <p>同条第三款:禁止提供专门用于侵入、非法控制计算机信息系统的程序、工具;明知他人实施侵入、非法控制而为其提供程序、工具,同样禁止。</p>\r\n <p>第二百八十六条第一款:禁止对计算机信息系统功能进行删除、修改、增加、干扰,造成系统不能正常运行。</p>\r\n <p>同条第二款:禁止对系统中存储、处理或者传输的数据和应用程序进行删除、修改、增加。</p>\r\n <p>同条第三款:禁止故意制作、传播计算机病毒等破坏性程序,影响计算机系统正常运行。</p>\r\n <p>第二百八十七条:禁止利用计算机实施金融诈骗、盗窃、贪污、挪用公款、窃取国家秘密或者其他犯罪。</p>\r\n <p>第二百八十七条之一第一款第(一)项:禁止设立用于实施诈骗、传授犯罪方法、制作或者销售违禁物品、管制物品等违法犯罪活动的网站、通讯群组。</p>\r\n <p>同款第(二)项:禁止发布有关制作或者销售毒品、枪支、淫秽物品等违禁物品、管制物品或者其他违法犯罪的信息。</p>\r\n <p>同款第(三)项:禁止为实施诈骗等违法犯罪活动发布信息。</p>\r\n <p>第二百八十七条之二:禁止明知他人利用信息网络实施犯罪,仍为其提供技术支持,或者提供广告推广、支付结算等帮助。</p>\r\n <p>第二百五十三条之一第一款、第三款:禁止向他人出售或者提供公民个人信息;禁止窃取或者以其他方法非法获取公民个人信息。</p>\r\n <p>《中华人民共和国网络安全法》第十三条第二款:使用网络不得危害网络安全,不得利用网络从事危害国家安全、荣誉和利益,煽动颠覆国家政权、推翻社会主义制度,煽动分裂国家、破坏国家统一,宣扬恐怖主义、极端主义,宣扬民族仇恨、民族歧视,传播暴力、淫秽色情信息,编造、传播虚假信息扰乱经济秩序和社会秩序,以及侵害他人名誉、隐私、知识产权和其他合法权益等活动。</p>\r\n <p>第十四条:禁止利用网络从事危害未成年人身心健康的活动。</p>\r\n <Line truncated
|
||||
|
||||
function readWelcomeAck() {
|
||||
@@ -7158,13 +7175,55 @@ body[data-ds-dark-theme] .dshp-rewind-item span{color:var(--dsw-alias-label-tert
|
||||
}
|
||||
|
||||
function readDrillAuth() {
|
||||
if (drillGrantState.ready) return drillGrantState.granted;
|
||||
try { return window.localStorage.getItem(AUTH_KEY) === "1"; } catch { return false; }
|
||||
}
|
||||
function writeDrillAuth(ok) {
|
||||
function setDrillAuthLocal(ok) {
|
||||
try {
|
||||
if (ok) window.localStorage.setItem(AUTH_KEY, "1");
|
||||
else window.localStorage.removeItem(AUTH_KEY);
|
||||
} catch { /* ignore */ }
|
||||
drillGrantState = { ready: true, granted: !!ok };
|
||||
}
|
||||
function writeDrillAuth(ok) {
|
||||
drillGrantGen += 1;
|
||||
const gen = drillGrantGen;
|
||||
setDrillAuthLocal(ok);
|
||||
if (!ok) return;
|
||||
drillGrantPosting += 1;
|
||||
fetch("/dsh-purge/drill-grant", {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/json" },
|
||||
body: "{}",
|
||||
}).then((r) => r.json()).then((saved) => {
|
||||
if (gen !== drillGrantGen) return;
|
||||
setDrillAuthLocal(!!(saved && saved.granted));
|
||||
}).catch(() => { /* 页面先记住,下次同步再写入当前安装目录 */ })
|
||||
.finally(() => { drillGrantPosting = Math.max(0, drillGrantPosting - 1); });
|
||||
}
|
||||
function syncDrillGrant(attempt) {
|
||||
const n = attempt || 0;
|
||||
const gen = drillGrantGen;
|
||||
fetch("/dsh-purge/drill-grant", { method: "GET" })
|
||||
.then((r) => r.json())
|
||||
.then((r) => {
|
||||
if (gen !== drillGrantGen) return;
|
||||
if (!r || r.ok === false) throw new Error("grant");
|
||||
if (r.granted) {
|
||||
setDrillAuthLocal(true);
|
||||
if (dockBus.authOpen) setDock({ authOpen: false });
|
||||
return;
|
||||
}
|
||||
if (drillGrantPosting > 0) return;
|
||||
setDrillAuthLocal(false);
|
||||
if (dockBus.authOpen || dockBus.tab === "drill") {
|
||||
setDock({ open: true, tab: "drill", authOpen: true, pending: dockBus.pending || "tab" });
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
if (gen !== drillGrantGen) return;
|
||||
if (n < 5) window.setTimeout(() => syncDrillGrant(n + 1), 400);
|
||||
});
|
||||
}
|
||||
|
||||
let dockBus = { open: false, tab: "clean", authOpen: false, pending: "tab", listeners: new Set() };
|
||||
@@ -7216,6 +7275,7 @@ body[data-ds-dark-theme] .dshp-rewind-item span{color:var(--dsw-alias-label-tert
|
||||
if (dockBus.open) setDock({ open: false, authOpen: false, pending: "tab" });
|
||||
else openDockClean();
|
||||
}
|
||||
syncDrillGrant();
|
||||
|
||||
const DOCK_GEOM_KEY = "dsh-purge-dock-geom-v2";
|
||||
function defaultDockGeom() {
|
||||
|
||||
Reference in new issue
Block a user