Skip to content

Conversation

DrPwner
Copy link

@DrPwner DrPwner commented Apr 12, 2025

This artifact modifies ACLs on files in the specified directory using the icacls command to grant full control to SYSTEM and deny access to Users and Everyone. This artifact can be very crucial given the case that velociraptor is deployed on a critical network/infrastructure, consequently, reducing cyber risk.

Since Velociraptor Agent Operates as SYSTEM, modifying its permissions to only allow SYSTEM user to access velociraptor will not cause any issues or conflicts.

This artifact modifies ACLs on files in the specified directory using the icacls command to grant full control to SYSTEM and deny access to Users and Everyone. This artifact can be very crucial given the case that velociraptor is deployed on a critical network/infrastructure, consequently, reducing cyber risk.

Since Velociraptor Agent Operates as SYSTEM, modifying its permissions to only allow SYSTEM user to access velociraptor will not cause any issues or conflicts.
- query: |
// Check if path is specified
LET _ <= if(condition=NOT TargetPath,
then=throw(message="TargetPath must be specified"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw() is not valid VQL

then=throw(message="TargetPath must be specified"))

// Construct PowerShell command
LET ps_cmd <= "icacls '" + TargetPath + "*.*' /grant 'NT AUTHORITY\\SYSTEM:(F)' /deny 'Users:(F)' /deny 'Everyone:(F)' /inheritance:r"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will lead to shell injection - please use execve() properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants