Detection rules › Kusto Query Language
Account Creation
User accounts may be created to achieve persistence on a machine. Read more here: https://attack.mitre.org/wiki/Technique/T1136. Tags: #CreateAccount. Query #1: Query for users being created using "net user" command. "net user" commands are noisy, so needs to be joined with another signal -. E.g. in this example we look for use of uncommon & undocumented commandline switches (e.g. /ad instead of /add).
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence | T1136 Create Account |
Event coverage
| Provider | Event ID | Title |
|---|---|---|
| Sysmon | 1 | Process creation |
| Security-Auditing | 4688 | A new process has been created. |
| Defender-DeviceProcessEvents | 9001000 | Process activity (any) |
Stages and Predicates
Stage 1: source
DeviceProcessEvents
Stage 2: where
FileName in ["net.exe", "net1.exe"]
Stage 3: parse
Stage 4: where
CreatedUser is_not_null
Stage 5: where
not
and
FileName eq "net1.exe"
InitiatingProcessFileName eq "net.exe"
macro "(replace(\"net\", \"net1\", InitiatingProcessCommandLine) =~ ProcessCommandLine)"
Stage 6: extend
Stage 7: where
or
and
not
ProcessCommandLine contains "/domain"
CreatedOnLocalMachine eq "0"
not
ProcessCommandLine contains "/add"
Stage 8: summarize
Stage 9: extend
Stage 10: extend
Exclusions
Top-level NOT(...) conjuncts — predicates this rule actively suppresses.
| Stage | Field | Kind | Excluded values |
|---|---|---|---|
| 1 | FileName | eq | net1.exe |
| 2 | InitiatingProcessFileName | eq | net.exe |
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
CreatedOnLocalMachine | eq |
|
FileName | in |
|