@wrongstack/tools 0.308.0 → 0.308.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bash-kill-guard.d.ts +1 -0
- package/dist/bash.js +15 -1
- package/dist/builtin.js +612 -143
- package/dist/exec.js +34 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +644 -171
- package/dist/pack.js +611 -143
- package/dist/pwsh.d.ts +22 -0
- package/dist/tool-tier.js +612 -143
- package/package.json +5 -4
package/dist/exec.js
CHANGED
|
@@ -43,6 +43,40 @@ var RULES = [
|
|
|
43
43
|
},
|
|
44
44
|
reason: "Remove-Item with -Recurse -Force"
|
|
45
45
|
},
|
|
46
|
+
// ----- Windows PowerShell Disk & Volume destruction -----
|
|
47
|
+
{
|
|
48
|
+
id: "powershell-disk-volume-destroy",
|
|
49
|
+
level: "destructive",
|
|
50
|
+
test: (cmd, args) => {
|
|
51
|
+
if (cmd !== "powershell" && cmd !== "pwsh") return false;
|
|
52
|
+
return args.some(
|
|
53
|
+
(a) => /^(?:Format-Volume|Clear-Disk|Initialize-Disk|Remove-Partition|Clear-Volume)(?:\s|$)/i.test(a)
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
reason: "PowerShell disk/volume partition destruction"
|
|
57
|
+
},
|
|
58
|
+
// ----- Windows PowerShell System Restart / Shutdown -----
|
|
59
|
+
{
|
|
60
|
+
id: "powershell-stop-restart-computer",
|
|
61
|
+
level: "destructive",
|
|
62
|
+
test: (cmd, args) => {
|
|
63
|
+
if (cmd !== "powershell" && cmd !== "pwsh") return false;
|
|
64
|
+
return args.some((a) => /^(?:Stop-Computer|Restart-Computer)(?:\s|$)/i.test(a));
|
|
65
|
+
},
|
|
66
|
+
reason: "PowerShell system shutdown or restart"
|
|
67
|
+
},
|
|
68
|
+
// ----- Windows PowerShell ExecutionPolicy / Payload evasion -----
|
|
69
|
+
{
|
|
70
|
+
id: "powershell-execution-policy-bypass",
|
|
71
|
+
level: "caution",
|
|
72
|
+
test: (cmd, args) => {
|
|
73
|
+
if (cmd !== "powershell" && cmd !== "pwsh") return false;
|
|
74
|
+
return args.some(
|
|
75
|
+
(a) => /Set-ExecutionPolicy\s+(?:Bypass|Unrestricted)|-(?:EncodedCommand|enc)\b/i.test(a)
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
reason: "PowerShell execution policy bypass or encoded command"
|
|
79
|
+
},
|
|
46
80
|
// ----- find -exec / -ok / -execdir -----
|
|
47
81
|
{
|
|
48
82
|
id: "find-exec",
|
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export { getProcessGuardian, type ProcessGuardianConfig, startProcessGuardian, s
|
|
|
40
40
|
export { _resetProcessRegistry, type BreakerCountdown, getProcessRegistry, type KillOpts, type ProcessRegistryImpl, type RegistryStats, type TrackedProcess, } from './process-registry.js';
|
|
41
41
|
export { getPersistentProcessRegistry, type PersistentProcessEntry, type PersistentRegistryData, resetPersistentProcessRegistry, } from './process-registry-persistent.js';
|
|
42
42
|
export { createGlobalPsSlashCommand, formatGlobalStatus, formatInstanceList, formatInstanceSummary, type GlobalProcessStatus, getInstanceCount, type InstanceInfo, type InstanceListOptions, listInstances, } from './ps-slash.js';
|
|
43
|
+
export { pwshTool, PWSH_TOOL_DESCRIPTION, type PwshInput, type PwshOutput } from './pwsh.js';
|
|
43
44
|
export { readTool } from './read.js';
|
|
44
45
|
export { replaceTool } from './replace.js';
|
|
45
46
|
export { scaffoldTool } from './scaffold.js';
|