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

Detection rule

Suspicious Group And Account Reconnaissance Activity Using Net.EXE

MediumTest-data validatedSigmaHQ (community)T1087.001T1087.002

Overview

Detects suspicious reconnaissance command line activity on Windows systems using Net.EXE Check if the user that executed the commands is suspicious (e.g. service accounts, LOCAL_SYSTEM)

Rule id
d95de845-b83c-4a9a-8a6a-4fc802ebf6c0
ATT&CK techniques
T1087.001 Account Discovery: Local Account, T1087.002 Account Discovery: Domain Account
Severity
Medium
Confidence
Low
Origin
SigmaHQ (community)
SigmaHQ status
test
Used in defense packs
The Gentlemen, INC Ransom, Akira, safepay, Play

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; 3 of 3 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) · d95de845-b83c-4a9a-8a6a-4fc802ebf6c0

Download
title: Suspicious Group And Account Reconnaissance Activity Using Net.EXE
id: d95de845-b83c-4a9a-8a6a-4fc802ebf6c0
status: test
description: |
    Detects suspicious reconnaissance command line activity on Windows systems using Net.EXE
    Check if the user that executed the commands is suspicious (e.g. service accounts, LOCAL_SYSTEM)
references:
    - https://redcanary.com/blog/how-one-hospital-thwarted-a-ryuk-ransomware-outbreak/
    - https://thedfirreport.com/2020/10/18/ryuk-in-5-hours/
    - https://www.nccgroup.com/research/back-in-black-unlocking-a-lockbit-30-ransomware-attack/
author: Florian Roth (Nextron Systems), omkar72, @svch0st, Nasreddine Bencherchali (Nextron Systems)
date: 2019-01-16
modified: 2023-03-02
tags:
    - attack.discovery
    - attack.t1087.001
    - attack.t1087.002
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith:
              - '\net.exe'
              - '\net1.exe'
        - OriginalFileName:
              - 'net.exe'
              - 'net1.exe'
    # Covers group and localgroup flags
    selection_group_root:
        CommandLine|contains:
            - ' group '
            - ' localgroup '
    selection_group_flags:
        CommandLine|contains:
            # Add more groups for other languages
            - 'domain admins'
            - ' administrator' # Typo without an 'S' so we catch both
            - ' administrateur' # Typo without an 'S' so we catch both
            - 'enterprise admins'
            - 'Exchange Trusted Subsystem'
            - 'Remote Desktop Users'
            - 'Utilisateurs du Bureau à distance' # French for "Remote Desktop Users"
            - 'Usuarios de escritorio remoto' # Spanish for "Remote Desktop Users"
            - ' /do' # short for domain
    filter_group_add:
        # This filter is added to avoid the potential case where the point is not recon but addition
        CommandLine|contains: ' /add'
    # Covers 'accounts' flag
    selection_accounts_root:
        CommandLine|contains: ' accounts '
    selection_accounts_flags:
        CommandLine|contains: ' /do' # short for domain
    condition: selection_img and ((all of selection_group_* and not filter_group_add) or all of selection_accounts_*)
falsepositives:
    - Inventory tool runs
    - Administrative activity
level: medium
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_net_groups_and_accounts_recon/info.yml

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 '% group %' OR LOWER(Command) LIKE '% localgroup %') AND (LOWER(Command) LIKE '%domain admins%' OR LOWER(Command) LIKE '% administrator%' OR LOWER(Command) LIKE '% administrateur%' OR LOWER(Command) LIKE '%enterprise admins%' OR LOWER(Command) LIKE '%exchange trusted subsystem%' OR LOWER(Command) LIKE '%remote desktop users%' OR LOWER(Command) LIKE '%utilisateurs du bureau à distance%' OR LOWER(Command) LIKE '%usuarios de escritorio remoto%' OR LOWER(Command) LIKE '% /do%')) AND (NOT(LOWER(Command) LIKE '% /add%'))) OR (LOWER(Command) LIKE '% accounts %' AND LOWER(Command) LIKE '% /do%'))

QRadar CRE

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

Rule name
OffSet7: Suspicious Group And Account Reconnaissance Activity Using Net.EXE
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:Suspicious Group And Account Reconnaissance Acti: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:Suspicious Group And Account Reconnaissance Acti:selection_group_root (match)
    All test lines must match (AND).
    • Command contains: group, localgroup
  • BB:OffSet7:Suspicious Group And Account Reconnaissance Acti:selection_group_flags (match)
    All test lines must match (AND).
    • Command contains: domain admins, administrator, administrateur, enterprise admins, Exchange Trusted Subsystem, Remote Desktop Users, Utilisateurs du Bureau à distance, Usuarios de escritorio remoto, /do
  • BB:OffSet7:Suspicious Group And Account Reconnaissance Acti:filter_group_add (exclusion)
    All test lines must match (AND).
    • Command contains: /add
  • BB:OffSet7:Suspicious Group And Account Reconnaissance Acti:selection_accounts_root (match)
    All test lines must match (AND).
    • Command contains: accounts
  • BB:OffSet7:Suspicious Group And Account Reconnaissance Acti:selection_accounts_flags (match)
    All test lines must match (AND).
    • Command contains: /do

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: BB:OffSet7:Suspicious Group And Account Reconnaissance Acti:selection_img AND (((ALL of [BB:OffSet7:Suspicious Group And Account Reconnaissance Acti:selection_group_root, BB:OffSet7:Suspicious Group And Account Reconnaissance Acti:selection_group_flags]) AND NOT BB:OffSet7:Suspicious Group And Account Reconnaissance Acti:filter_group_add) OR (ALL of [])

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 '% group %' OR LOWER(Command) LIKE '% localgroup %') AND (LOWER(Command) LIKE '%domain admins%' OR LOWER(Command) LIKE '% administrator%' OR LOWER(Command) LIKE '% administrateur%' OR LOWER(Command) LIKE '%enterprise admins%' OR LOWER(Command) LIKE '%exchange trusted subsystem%' OR LOWER(Command) LIKE '%remote desktop users%' OR LOWER(Command) LIKE '%utilisateurs du bureau à distance%' OR LOWER(Command) LIKE '%usuarios de escritorio remoto%' OR LOWER(Command) LIKE '% /do%')) AND (NOT(LOWER(Command) LIKE '% /add%'))) OR (LOWER(Command) LIKE '% accounts %' AND LOWER(Command) LIKE '% /do%'))

Rule response

  • Severity 5, 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 IN ("* group *", "* localgroup *")) (CommandLine IN ("*domain admins*", "* administrator*", "* administrateur*", "*enterprise admins*", "*Exchange Trusted Subsystem*", "*Remote Desktop Users*", "*Utilisateurs du Bureau à distance*", "*Usuarios de escritorio remoto*", "* /do*")) NOT CommandLine="* /add*") OR (CommandLine="* accounts *" CommandLine="* /do*"))

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

[Suspicious Group And Account Reconnaissance Activity Using Net.EXE]
description = Detects suspicious reconnaissance command line activity on Windows systems using Net.EXECheck if the user that executed the commands is suspicious (e.g. service accounts, LOCAL_SYSTEM)
search = (Image IN ("*\\net.exe", "*\\net1.exe") OR OriginalFileName IN ("net.exe", "net1.exe")) (((CommandLine IN ("* group *", "* localgroup *")) (CommandLine IN ("*domain admins*", "* administrator*", "* administrateur*", "*enterprise admins*", "*Exchange Trusted Subsystem*", "*Remote Desktop Users*", "*Utilisateurs du Bureau à distance*", "*Usuarios de escritorio remoto*", "* /do*")) NOT CommandLine="* /add*") OR (CommandLine="* accounts *" CommandLine="* /do*"))

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 " group " or TargetProcessCommandLine contains " localgroup ") and (TargetProcessCommandLine contains "domain admins" or TargetProcessCommandLine contains " administrator" or TargetProcessCommandLine contains " administrateur" or TargetProcessCommandLine contains "enterprise admins" or TargetProcessCommandLine contains "Exchange Trusted Subsystem" or TargetProcessCommandLine contains "Remote Desktop Users" or TargetProcessCommandLine contains "Utilisateurs du Bureau à distance" or TargetProcessCommandLine contains "Usuarios de escritorio remoto" or TargetProcessCommandLine contains " /do")) and (not(TargetProcessCommandLine contains " /add"))) or (TargetProcessCommandLine contains " accounts " and TargetProcessCommandLine contains " /do"))

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 " group " or ProcessCommandLine contains " localgroup ") and (ProcessCommandLine contains "domain admins" or ProcessCommandLine contains " administrator" or ProcessCommandLine contains " administrateur" or ProcessCommandLine contains "enterprise admins" or ProcessCommandLine contains "Exchange Trusted Subsystem" or ProcessCommandLine contains "Remote Desktop Users" or ProcessCommandLine contains "Utilisateurs du Bureau à distance" or ProcessCommandLine contains "Usuarios de escritorio remoto" or ProcessCommandLine contains " /do")) and (not(ProcessCommandLine contains " /add"))) or (ProcessCommandLine contains " accounts " and ProcessCommandLine contains " /do"))

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:(*\ group\ * OR *\ localgroup\ *)) AND (process.command_line:(*domain\ admins* OR *\ administrator* OR *\ administrateur* OR *enterprise\ admins* OR *Exchange\ Trusted\ Subsystem* OR *Remote\ Desktop\ Users* OR *Utilisateurs\ du\ Bureau\ à\ distance* OR *Usuarios\ de\ escritorio\ remoto* OR *\ \/do*))) AND (NOT process.command_line:*\ \/add*)) OR (process.command_line:*\ accounts\ * AND process.command_line:*\ \/do*))

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 like~ ("* group *", "* localgroup *")) and (process.command_line like~ ("*domain admins*", "* administrator*", "* administrateur*", "*enterprise admins*", "*Exchange Trusted Subsystem*", "*Remote Desktop Users*", "*Utilisateurs du Bureau à distance*", "*Usuarios de escritorio remoto*", "* /do*"))) and (not process.command_line:"* /add*")) or (process.command_line:"* accounts *" and process.command_line:"* /do*"))

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 "* group *" or process.command_line like "* localgroup *") and (process.command_line like "*domain admins*" or process.command_line like "* administrator*" or process.command_line like "* administrateur*" or process.command_line like "*enterprise admins*" or process.command_line like "*Exchange Trusted Subsystem*" or process.command_line like "*Remote Desktop Users*" or process.command_line like "*Utilisateurs du Bureau à distance*" or process.command_line like "*Usuarios de escritorio remoto*" or process.command_line like "* /do*") and not process.command_line like "* /add*" or process.command_line like "* accounts *" and process.command_line like "* /do*")

Required telemetry

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

False positives

  • Inventory tool runs
  • Administrative activity

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
Florian Roth (Nextron Systems), omkar72, @svch0st, Nasreddine Bencherchali (Nextron Systems)
Source
SigmaHQ · rules/windows/process_creation/proc_creation_win_net_groups_and_accounts_recon.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