Latest alertCVE-2018-11776 in Apache Struts Confirmed Exploited in the WildRead
Search all news in the platform

Detection rule

New User Created Via Net.EXE With Never Expire Option

HighTest-data validatedSigmaHQ (community)T1136.001

Overview

Detects creation of local users via the net.exe command with the option "never expire"

Rule id
b9f0e6f5-09b4-4358-bae4-08408705bd5c
ATT&CK techniques
T1136.001 Create Account: Local Account
Severity
High
Confidence
Low
Origin
SigmaHQ (community)
SigmaHQ status
test
Used in defense packs
The Gentlemen, qilin, Akira, nightspire

Validation

  1. ExperimentalSyntax checked only. Not yet tested on events.
  2. Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
  3. SIEM-validatedRun in a real SIEM, with a recorded result.

2 of 2 positive test events matched; 1 of 1 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.

Detection logic and queries

Queries are shown exactly as generated. Test them in your environment before you deploy them.

Sigma

Sigma (YAML) · b9f0e6f5-09b4-4358-bae4-08408705bd5c

Download
title: New User Created Via Net.EXE With Never Expire Option
id: b9f0e6f5-09b4-4358-bae4-08408705bd5c
related:
    - id: cd219ff3-fa99-45d4-8380-a7d15116c6dc
      type: derived
status: test
description: Detects creation of local users via the net.exe command with the option "never expire"
references:
    - https://thedfirreport.com/2022/07/11/select-xmrig-from-sqlserver/
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-07-12
modified: 2023-02-21
tags:
    - attack.persistence
    - attack.t1136.001
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith:
              - '\net.exe'
              - '\net1.exe'
        - OriginalFileName:
              - 'net.exe'
              - 'net1.exe'
    selection_cli:
        CommandLine|contains|all:
            - 'user'
            - 'add'
            - 'expires:never'
    condition: all of selection_*
falsepositives:
    - Unlikely
level: high

QRadar AQL

IBM QRadar AQL (hunting query)Hunting query

Hunting search for the Log Activity tab or the API. It is not a QRadar rule.

AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).

SELECT * FROM events WHERE devicetype=12 AND (((LOWER("Process Path") LIKE '%\net.exe' OR LOWER("Process Path") LIKE '%\net1.exe') OR (LOWER("Process Name") LIKE '%\net.exe' OR LOWER("Process Name") LIKE '%\net1.exe')) OR (Filename IN('net.exe', 'net1.exe'))) AND (LOWER(Command) LIKE '%user%' AND LOWER(Command) LIKE '%add%' AND LOWER(Command) LIKE '%expires:never%')

QRadar CRE

Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.

Rule name
OffSet7: New User Created Via Net.EXE With Never Expire Option
Rule type
Event rule (Local)
Log source types
Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1

Building blocks

  • BB:OffSet7:New User Created Via Net EXE With Never Expire O:selection_img (match)
    Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.
    • Process Path / Process Name ends with: \net.exe, \net1.exe
    • Filename is equal to (case-insensitive): net.exe, net1.exe
  • BB:OffSet7:New User Created Via Net EXE With Never Expire O:selection_cli (match)
    All test lines must match (AND).
    • Command contains: user, add, expires:never

Main rule, option A (building blocks)

  1. when the event(s) were detected by one or more of these log source types: Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1
  2. when an event matches the condition built from these building blocks: (ALL of [BB:OffSet7:New User Created Via Net EXE With Never Expire O:selection_img, BB:OffSet7:New User Created Via Net EXE With Never Expire O:selection_cli])

Main rule, option B (AQL filter test)

  1. when the event matches this AQL filter query: devicetype=12 AND (((LOWER("Process Path") LIKE '%\net.exe' OR LOWER("Process Path") LIKE '%\net1.exe') OR (LOWER("Process Name") LIKE '%\net.exe' OR LOWER("Process Name") LIKE '%\net1.exe')) OR (Filename IN('net.exe', 'net1.exe'))) AND (LOWER(Command) LIKE '%user%' AND LOWER(Command) LIKE '%add%' AND LOWER(Command) LIKE '%expires:never%')

Rule response

  • Severity 7, credibility 6, relevance 7
  • Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
  • Respond no more than once per 30 minutes per Log Source (tune per environment)

Limitations

  • QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.

Splunk

Splunk SPLSearch

Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.

(Image IN ("*\\net.exe", "*\\net1.exe") OR OriginalFileName IN ("net.exe", "net1.exe")) CommandLine="*user*" CommandLine="*add*" CommandLine="*expires:never*"

Splunk savedsearches.conf stanzaScheduled search template

Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.

[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now

[New User Created Via Net.EXE With Never Expire Option]
description = Detects creation of local users via the net.exe command with the option "never expire"
search = (Image IN ("*\\net.exe", "*\\net1.exe") OR OriginalFileName IN ("net.exe", "net1.exe")) CommandLine="*user*" CommandLine="*add*" CommandLine="*expires:never*"

Microsoft Sentinel

Microsoft Sentinel KQL (ASIM)Hunting query

Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.

imProcessCreate
| where ((TargetProcessName endswith "\\net.exe" or TargetProcessName endswith "\\net1.exe") or (TargetProcessFileOriginalName in~ ("net.exe", "net1.exe"))) and (TargetProcessCommandLine contains "user" and TargetProcessCommandLine contains "add" and TargetProcessCommandLine contains "expires:never")

Defender XDR

Microsoft Defender XDR KQLHunting query

Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.

DeviceProcessEvents
| where ((FolderPath endswith "\\net.exe" or FolderPath endswith "\\net1.exe") or (ProcessVersionInfoOriginalFileName in~ ("net.exe", "net1.exe"))) and (ProcessCommandLine contains "user" and ProcessCommandLine contains "add" and ProcessCommandLine contains "expires:never")

Elastic

Elastic Lucene (ECS)Hunting query

Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.

((process.executable:(*\\net.exe OR *\\net1.exe)) OR (process.pe.original_file_name:(net.exe OR net1.exe))) AND (process.command_line:*user* AND process.command_line:*add* AND process.command_line:*expires\:never*)

Elastic EQL (ECS)Hunting query

EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.

any where ((process.executable like~ ("*\\net.exe", "*\\net1.exe")) or (process.pe.original_file_name like~ ("net.exe", "net1.exe"))) and (process.command_line:"*user*" and process.command_line:"*add*" and process.command_line:"*expires:never*")

Elastic ES|QL (ECS)Hunting query

ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.

from * metadata _id, _index, _version | where (ends_with(process.executable, "\\net.exe") or ends_with(process.executable, "\\net1.exe") or process.pe.original_file_name in ("net.exe", "net1.exe")) and process.command_line like "*user*" and process.command_line like "*add*" and process.command_line like "*expires:never*"

Required telemetry

Log source
product: windows · category: process_creation
Fields used
CommandLine Image OriginalFileName

False positives

  • Unlikely

Investigation and response

No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.

References

Author and attribution

Author
Nasreddine Bencherchali (Nextron Systems)
Source
SigmaHQ · rules/windows/process_creation/proc_creation_win_net_user_add_never_expire.yml
Upstream commit
9688134317a2
Licence
Detection Rule License (DRL) 1.1

Version history

  1. Version 1Imported from SigmaHQ
  2. OffSet7 build · SigmaHQ 9688134317a2

Related rules