Detection rules › Splunk

Permissions Replaced by icacls - Windows (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

icacls is a command-line utility in Windows that allows for viewing and modifying Discretionary Access Control Lists (DACLs) and file permissions. Threat actors may abuse this tool to alter file permissions, potentially gaining unauthorized access or control over sensitive files and directories, as observed by DFIR report (see references). This use case detects icacls executions with switches to replace permissions

MITRE ATT&CK coverage

References

Telemetry coverage

Rule body

id: '24625.45523'
title: Permissions Replaced by icacls - Windows
description: 'icacls is a command-line utility in Windows that allows for viewing
  and modifying Discretionary Access Control Lists (DACLs) and file permissions. Threat
  actors may abuse this tool to alter file permissions, potentially gaining unauthorized
  access or control over sensitive files and directories, as observed by DFIR report
  (see references). This use case detects icacls executions with switches to replace
  permissions. -- Threat Actor Association: FIN7 (aka. Carbon Spider, Sangria Tempest)'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) "icacls" ("/grant:" OR "/deny:" OR "/remove:"
  OR "/setintegritylevel:" OR "/inheritance:") | rex field=_raw "(?<=icacls\.exe\"\s)(?<file_path>[^\s]+)"|
  rex field=_raw "/(grant|deny|remove|setintegritylevel|inheritance):\S\s(?<permission_user>[^\:]+):F"|
  table _time, host, user, process, process_*, parent_process, parent_process_*, user,
  file_path, permission_user | bin span=1s | stats values(*) as * by _time, host '
techniques:
- defense-evasion:file and directory permissions modification
- defense-evasion:file and directory permissions modification:windows file and directory
  permissions modification
technique_id:
- T1222
- T1222.001
data_category:
- Process command-line parameters
- Windows event logs
references:
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/icacls
- https://thedfirreport.com/2023/10/30/netsupport-intrusion-results-in-domain-compromise/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) "icacls" ("/grant:" OR "/deny:" OR "/remove:" OR "/setintegritylevel:" OR "/inheritance:")

Stage 2: rex

| rex field=_raw "(?<=icacls\.exe\"\s)(?<file_path>[^\s]+)"

Stage 3: rex

| rex field=_raw "/(grant|deny|remove|setintegritylevel|inheritance):\S\s(?<permission_user>[^\:]+):F"

Stage 4: table

| table _time, host, user, process, process_*, parent_process, parent_process_*, user, file_path, permission_user

Stage 5: bucket

| bin span=1s

Stage 6: stats

| stats values(*) as * by _time, host

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq value:"4688"

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4688<"
1"icacls"
1"/grant:"
1"/deny:"
1"/remove:"
1"/setintegritylevel:"
1"/inheritance:"