Skip to content

Commit 1e6b88c

Browse files
authored
Do not call the PowerShell artifact (Velocidex#1273)
Calling shell artifacts do not work well in the new release. Use execve() directly.
1 parent 1f076a5 commit 1e6b88c

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

content/exchange/artifacts/Generic.Client.Defender.Health.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ description: |
66
MDATP is Microsoft's EDR product for Windows, macOS and Linux. This
77
artifact retrieves all available agent status and configuration via the
88
platform-native interface: `mdatp health --output json` on Linux and
9-
macOS, `Get-MpComputerStatus` through
10-
[`Windows.System.PowerShell`](/artifact_references/pages/windows.system.powershell/)
11-
on Windows.
9+
macOS, `Get-MpComputerStatus` on Windows.
1210
1311
A single row is returned with a dict called `MDATPHealth` whose
1412
shape differs across platforms. Linux and macOS are nearly
@@ -88,8 +86,11 @@ sources:
8886
edrMachineId=read_file(
8987
accessor='reg',
9088
filename='''HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Advanced Threat Protection\senseId''')) AS MDATPHealth
91-
FROM Artifact.Windows.System.PowerShell(
92-
Command='Get-MpComputerStatus')
89+
FROM execve(argv=[
90+
'''C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe''',
91+
'-ExecutionPolicy', 'Unrestricted',
92+
'-encodedCommand', base64encode(string=utf16_encode(string='Get-MpComputerStatus'))
93+
])
9394
})))
9495
9596
notebook:

0 commit comments

Comments
 (0)