Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions content/exchange/artifacts/Generic.Events.Processes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Generic.Events.Processes
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is basically what the process tracker does a lot better :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is the process tracker available for all supported operating systems? Ive only seen it for Windows.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

author: Herbert Bärschneider, SEC Consult
description: |
This artifact is meant for monitoring processes on clients. It is usable on every operating system supported by Velociraptor.
It periodically queries the existing processes and emits lines for differences (new processes and missing/removed ones).
Processes are tracked and compared based on the following elements: process ID, parent process ID, SID of the process owner, username, process name, executable associated with the process, commandline of the process

type: CLIENT_EVENT

parameters:
- name: Period
default: 2
type: int
description: how many seconds the artifact waits between checking processes for changes

sources:
- query: |
LET RunningProcesses = SELECT *, format(format="%v %v %v %v %v %v %v", args=[Pid, Ppid, OwnerSid, Username, Name, Exe, CommandLine]) AS DiffKey FROM pslist()

LET EventQuery = SELECT * FROM diff(query=RunningProcesses, period=Period, key="DiffKey")

SELECT * FROM EventQuery
15 changes: 15 additions & 0 deletions content/exchange/artifacts/Windows.Events.ETWProcesses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Windows.Events.ETWProcesses
author: Herbert Bärschneider, SEC Consult
description: |
This artifact is meant for monitoring processes on Windows clients.
It uses Kernel ETW providers to notice process creations and terminations.

Requirements:
- Velociraptor Client and Velociraptor Server need version v0.74 or newer (or else the feature is just not supported and won't work at all)

type: CLIENT_EVENT

sources:
- query: |
SELECT *, atoi(string=EventData.ProcessId) AS Pid, atoi(string=EventData.ParentId) AS Ppid
FROM watch_etw(guid='kernel', kernel_tracer_type=['process'])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Consider using the Microsoft-Windows-Kernel-Process provider instead - the kernel provider is very chatty and can result in higher CPU loads.

https://sigma.velocidex.com/docs/models/windows_etw_base/#etwwindowsprocess

Also this artifact is better used with the process tracker.

42 changes: 42 additions & 0 deletions content/exchange/artifacts/Windows.Events.HighPrivilegedLogon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Windows.Events.HighPrivilegedLogon
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This one is probably better implemented as a sigma rule

https://sigma.velocidex.com/docs/artifacts/windows.hayabusa.monitoring/

author: Herbert Bärschneider, SEC Consult
description: |
Artifact to detect logons that get special privileges assigned. The artifact monitors for security event id 4672.
This is useful to see where accounts with high privileges are being actively used.

Be aware, there is lots of noise from NT_AUTHORITY\SYSTEM and the machine account of a system. These are filtered out for you.

type: CLIENT_EVENT

parameters:
- name: eventLog
default: C:\Windows\system32\winevt\logs\Security.evtx
- name: PrivilegesRegex
type: regex
description: Regex for the privileges you care about

sources:
- precondition:
SELECT OS From info() where OS = 'windows'
query: |
LET files = SELECT * FROM glob(globs=eventLog)

SELECT timestamp(epoch=System.TimeCreated.SystemTime) As EventTime,
System.EventRecordID as EventRecordID,
System.EventID.Value as EventID,
System.Computer as SourceComputer,
EventData.SubjectUserName as SubjectUserName,
EventData.PrivilegeList as PrivilegeList,
System,
EventData,
Message
FROM foreach(
row=files,
async=TRUE,
query={
SELECT *
FROM watch_evtx(filename=OSPath)
WHERE System.EventID.Value = 4672
AND EventData.PrivilegeList =~ PrivilegesRegex
AND NOT ((EventData.SubjectUserName =~ "SYSTEM" AND EventData.SubjectDomainName =~ "NT AUTHORITY") OR EventData.SubjectUserName =~ "\$$")
})