MCPcopy Create free account
hub / github.com/Noumena-Network/code / checkWmiProcessSpawn

Function checkWmiProcessSpawn

src/tools/PowerShellTool/powershellSecurity.ts:1016–1029  ·  view source on GitHub ↗
(
  parsed: ParsedPowerShellCommand,
)

Source from the content-addressed store, hash-verified

1014])
1015
1016function checkWmiProcessSpawn(
1017 parsed: ParsedPowerShellCommand,
1018): PowerShellSecurityResult {
1019 for (const cmd of getAllCommands(parsed)) {
1020 const lower = cmd.name.toLowerCase()
1021 if (WMI_SPAWN_CMDLETS.has(lower)) {
1022 return {
1023 behavior: 'ask',
1024 message: `${cmd.name} can spawn arbitrary processes via WMI/CIM (Win32_Process Create)`,
1025 }
1026 }
1027 }
1028 return { behavior: 'passthrough' }
1029}
1030
1031/**
1032 * Main entry point for PowerShell security validation.

Callers

nothing calls this directly

Calls 2

getAllCommandsFunction · 0.50
hasMethod · 0.45

Tested by

no test coverage detected