Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Windows.Detection.Registry.yaml to Registry.yaml #2876

Closed
wants to merge 4 commits into from
Closed
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
50 changes: 50 additions & 0 deletions artifacts/definitions/Windows/Events/Mutants.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Windows.Events.Mutants
description: |
This artifact detects creation of Mutants and triggers an alert.

author: Jos Clephas - @DfirJos

type: CLIENT_EVENT

precondition:
SELECT * FROM info() WHERE OS =~ "windows"

parameters:
- name: processRegex
description: A regex applied to process names.
default: .
type: regex
- name: Period
type: int
default: 120
- name: MutantNameRegex
default: EvillMutant
type: regex
- name: AlertName
default: "Suspicious mutex created"
- name: diff
default: added
- name: enrich
description: Enrich mutex with process information. Closely monitor the performance impact if you enable this.
type: bool
default: N

sources:
- query: |

LET processes = SELECT Pid AS ProcPid, Name AS ProcName, Exe FROM pslist()
WHERE ProcName =~ processRegex AND ProcPid > 0

LET query_mutant = SELECT * FROM winobj() WHERE Type = "Mutant" AND Name =~ MutantNameRegex

LET query_enriched = SELECT * FROM foreach(
row=processes,
query={
SELECT ProcPid, ProcName, Exe, Type, Name, Handle
FROM handles(pid=ProcPid, types="Mutant")
})
WHERE Type = "Mutant" AND Name =~ MutantNameRegex

LET query_diff = if(condition=enrich, then=query_enriched, else=query_mutant)

SELECT *, alert(name=AlertName, Name=Name, Type=Type, Exe=Exe) as AlertSent FROM diff(query=query_diff, period=Period, key="Name") WHERE Diff = diff