Detection rules › Splunk

ISO File in Temp Folder (Windows Event Log)

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

Threat actors may rely upon a user opening a malicious file in order to gain execution. Users may be subjected to social engineering to get them to open a file that will lead to code execution. This use case detects file events involving AppData Temp folder locations involving zip and ISO files, as observed with Qakbot from end of July 2022. Event 4656 and/or 4663 are required for detection. To specifically audit file creations, enable object access auditing and configure auditing on the directories \AppData\Local\Temp and AppData\Local\Microsoft\Windows\INetCache\Content.Outlook'

MITRE ATT&CK coverage

References

Telemetry coverage

Rule body

id: '23357.42539'
title: ISO File in Temp Folder
description: Threat actors may rely upon a user opening a malicious file in order
  to gain execution. Users may be subjected to social engineering to get them to open
  a file that will lead to code execution. This use case detects file events involving
  AppData Temp folder locations involving zip and ISO files, as observed with Qakbot
  from end of July 2022. Event 4656 and/or 4663 are required for detection. To specifically
  audit file creations, enable object access auditing and configure auditing on the
  directories \AppData\Local\Temp and AppData\Local\Microsoft\Windows\INetCache\Content.Outlook\'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4656) OR
  "<EventID>4656<" OR TERM(EventCode=4663) OR "<EventID>4663<") ("\\AppData\\Local\\Temp"
  OR "\\AppData\\Local\\Microsoft\\Windows\\INetCache\\Content\\Outlook") ".zip" ".iso"
  | where match(process_path, "(?i)(\x5cAppData\x5cLocal\x5cMicrosoft\x5cWindows\x5cINetCache\x5cContent\.Outlook|\x5cAppData\x5cLocal\x5cTemp).*\.zip\x5c")
  and match(ObjectName, "(?i)\.iso($|\")") | table _time, host, user, signature_id,
  process, process_*, parent_* | bin span=1s | stats values(*) as * by _time, host '
techniques:
- execution:user execution:malicious file
technique_id:
- T1204.002
data_category:
- Windows event logs
references:
- https://www.microsoft.com/en-us/security/blog/2021/12/09/a-closer-look-at-qakbots-latest-building-blocks-and-how-to-knock-them-down/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4656) OR "<EventID>4656<" OR TERM(EventCode=4663) OR "<EventID>4663<") ("\\AppData\\Local\\Temp" OR "\\AppData\\Local\\Microsoft\\Windows\\INetCache\\Content\\Outlook") ".zip" ".iso"

Stage 2: where

| where match(process_path, "(?i)(\x5cAppData\x5cLocal\x5cMicrosoft\x5cWindows\x5cINetCache\x5cContent\.Outlook|\x5cAppData\x5cLocal\x5cTemp).*\.zip\x5c") and match(ObjectName, "(?i)\.iso($|\")")

Stage 3: table

| table _time, host, user, signature_id, process, process_*, parent_*

Stage 4: bucket

| bin span=1s

Stage 5: stats

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

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4656 corpus 19 (splunk 15, kusto 4)
  • 4663 corpus 35 (splunk 30, kusto 5)
field:"EventID" kind:eq
ObjectNameregex_match
  • "(?i).iso($|\")"
field:"ObjectName" kind:regex_match
process_pathregex_match
  • "(?i)(\x5cAppData\x5cLocal\x5cMicrosoft\x5cWindows\x5cINetCache\x5cContent.Outlook|\x5cAppData\x5cLocal\x5cTemp).*.zip\x5c"
field:"process_name" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4656<"
1"<EventID>4663<"
1"\\AppData\\Local\\Temp"
1"\\AppData\\Local\\Microsoft\\Windows\\INetCache\\Content\\Outlook"
1".zip"
1".iso"