Skip to content

Commit

Permalink
add groupname parameter to LocalAdmins artifact (Velocidex#1823)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucebac authored May 30, 2022
1 parent a0e69ef commit 2568377
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion artifacts/definitions/Windows/System/LocalAdmins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ reference:

type: CLIENT

parameters:
- name: groupname
default: Administrators
description: "The name of the administrators group. Must match the language of the target system(s)."

sources:
- precondition:
SELECT OS From info() where OS = 'windows'

query: |
LET script <= 'Get-LocalGroupMember -Group "Administrators" | SELECT -ExpandProperty SID -Property Name, PrincipalSource | select Name, Value, PrincipalSource | convertto-json'
LET script <= 'Get-LocalGroupMember -Group "' + groupname + '" | SELECT -ExpandProperty SID -Property Name, PrincipalSource | select Name, Value, PrincipalSource | convertto-json'
LET out = SELECT parse_json_array(data=Stdout) AS Output
FROM execve(argv=["powershell",
Expand Down

0 comments on commit 2568377

Please sign in to comment.