← Back to Posts

When One Operator Isn't Enough

This follows Will Any of This Fire?. That post introduced a method. Break a threat report into behaviors, then move from technique tag to predicate leaf to structural pivot. This post applies the method to six threat reports. It also covers kind:, with:, field:, correlation:, and excludes:.

Many thanks to the analysts at The DFIR Report for their work.


The field operator earns its keep

Atera RMM was installed as a service during the RansomHub intrusion. The field: operator anchors a value to a predicate field. This query searches for Atera as a ServiceName predicate using a contains match.

field:ServiceName value:atera kind:contains3 results |
T1543.003 Create or Modify System Process: Windows ServiceT1569.002 System Services: Service Execution
Detects service installation of different remote access tools software. These software are often abused by threat actors to perform
ServiceName match Atera
T1543.003 Create or Modify System Process: Windows ServiceT1569.002 System Services: Service Execution
Detects service installation of different remote access tools software. These software are often abused by threat actors to perform
ServiceName match Atera

The indicator:f=v shorthand is equivalent and more compact.

indicator:ServiceName=atera3 results |
T1543.003 Create or Modify System Process: Windows ServiceT1569.002 System Services: Service Execution
Detects service installation of different remote access tools software. These software are often abused by threat actors to perform
ServiceName match Atera
T1543.003 Create or Modify System Process: Windows ServiceT1569.002 System Services: Service Execution
Detects service installation of different remote access tools software. These software are often abused by threat actors to perform
ServiceName match Atera

EtherRat and KongTuke both used Cloudflare tunnels for C2. A plain value search covers command-line and other fields.

value:cloudflared.exe4 results |
T1090.002 Proxy: External ProxyT1572 Protocol Tunneling
Identifies the use of Cloudflare Tunnel (cloudflared) to expose a local service or create an outbound tunnel. Adversaries may abuse quick tunnels (e.g. tunnel --url http://127.0.0.1:80) or named tunnels to proxy C2 traffic or exfiltrate data through Cloudflare's edge while evading direct connection blocking.
process.name wildcard cloudflared.exeprocess.pe.original_file_name eq cloudflared.exe
T1090.001 Proxy: Internal Proxy
Detects the execution of the "cloudflared" binary from a non standard location.
Image ends_with \cloudflared.exe
T1090.001 Proxy: Internal Proxy
Detects creation of an ad-hoc Cloudflare Quick Tunnel, which can be used to tunnel local services such as HTTP, RDP, SSH and SMB. The free TryCloudflare Quick Tunnel will generate a random subdomain on trycloudflare[.]com, following a call to api[.]trycloudflare[.]com. The tool has been observed in use by threat groups including Akira ransomware.
Image ends_with \cloudflared.exe

Anchoring the value to a field narrows the search to the network destination leaf and surfaces different rules.

value:trycloudflare field:DestinationHostName5 results |
T1071.001 Application Layer Protocol: Web ProtocolsT1102 Web ServiceT1567.002 Exfiltration Over Web Service: Exfiltration to Cloud StorageT1567.003 Exfiltration Over Web Service: Exfiltration to Text Storage SitesT1567.004 Exfiltration Over Web Service: Exfiltration Over Webhook
This rule monitors for the unusual occurrence of outbound network connections to suspicious webservice domains.
destination.domain wildcard *.trycloudflare.com
T1105 Ingress Tool Transfer
Detects executables located in potentially suspicious directories initiating network connections towards file sharing domains.
DestinationHostname ends_with trycloudflare.com
T1567 Exfiltration Over Web ServiceT1572 Protocol Tunneling
Detects network connections to Cloudflared tunnels domains initiated by a process on the system. Attackers can abuse that feature to establish a reverse shell or persistence on a machine.
DestinationHostname ends_with trycloudflare.com
T1102.001 Web Service: Dead Drop Resolver
Detects an executable, which is not an internet browser or known application, initiating network connections to legit popular websites, which were seen to be used as dead drop resolvers in previous attacks. In this context attackers leverage known websites such as "facebook", "youtube", etc. In order to pass through undetected.
DestinationHostname ends_with trycloudflare.com

Hunt construction via event ID correlation

Lynx ransomware used SMB share access during lateral movement after RDP/SMB logons. The with: operator returns rules that span several event IDs. This query finds rules that join or correlate Security-Auditing Event ID 5145: A network share object was checked to see whether client can be granted desired access with Event ID 4624: An account was successfully logged on.

with:5145 with:46249 results |
T1187 Forced AuthenticationT1550 Use Alternate Authentication MaterialT1557.001 Adversary-in-the-Middle: Name Resolution Poisoning and SMB Relay
Detects potential relay attacks by identifying coercion attempts followed by authentication events using a target server's computer account, originating from a different host. This may indicate that an attacker has captured and relayed Kerberos authentication material for the server's computer account to execute code on behalf of the compromised system.
events: 4624, 4625, 5145
T1187 Forced AuthenticationT1557.001 Adversary-in-the-Middle: Name Resolution Poisoning and SMB Relay
Detects potential relay attacks by identifying coercion attempts followed by authentication events using a target server's computer account, originating from a different host. This may indicate that an attacker has captured and relayed the server's computer account hash to execute code on behalf of the compromised system.
events: 4624, 4625, 5145
T1210 Exploitation of Remote Services
This query detects instances where an attacker has gained the ability to execute code on an ADFS Server through SMB and Remote Service or Scheduled Task.
events: 4624, 4688, 4697, 4698, 4699, 4700, 4701, 4702, 5145
T1021 Remote Services
Detects scenarios where an attacker is using
events: 4624, 4625, 4768, 4769, 4770, 4771, 5140, 5145
T1003.006 OS Credential Dumping: DCSync
NetSync allows an attacker to take the NTLM hash of a Domain Controller (DC) machine account ("usually" identified by ending in "$") and using it to obtain the NTLM machine account hash of another machine account through impersonation (similar to, but different from, DCSync). Where DCSync can obtain user account passwords, NetSync is limited to machine accounts. The other main differentiator between DCSync and NetSync is that DCSync will make use of Microsoft's Directory Replication Service (DRS...
events: 4624, 5145
T1098 Account Manipulation
Detects scenarios where an attacker perform a password reset event. This does not require any knowledge of a user’s current password, but it does require to have the "Reset Password" right. Correlate the event ID 4724, 4624 and 5145 using the "SubjectLogonId" field to identify the source of the reset.
events: 4624, 4724, 5145
T1190 Exploit Public-Facing Application
Threat actors may scan for hosts with SMB ports exposed to the internet and attempt to access services. This rule detects external attempts to access SMB shares (Event IDs 5140 or 5145) following network logons (Event ID 4624, Logon Type 3) within a one minute period correlated by host and user, which may indicate a threat actor's initial access attempt via SMB.
events: 4624, 5140, 5145
T1003.002 OS Credential Dumping: Security Account Manager
SecretsDump.py Performs various techniques to dump hashes from the remote machine without executing any agent there
events: 4624, 4661, 5145
T1557.001 Adversary-in-the-Middle: Name Resolution Poisoning and SMB Relay
It is possible to trigger RPC call using SpoolService bug, commonly found in NTLM relay attacks
events: 4624, 5145

The Meterpreter GetSystem command creates a named pipe (\\.\pipe\kesknq) during privilege escalation in the LockBit intrusion. This generates Sysmon Event ID 17: PipeEvent (Pipe Created) and Event ID 18: PipeEvent (Pipe Connected). Combining uses: with with: finds rules that inspect PipeName and reference both events.

uses:PipeName with:17 with:1823 results, showing first 10 |
T1005 Data from Local System
Detects suspicious local connections via a named pipe to the AD FS configuration database (Windows Internal Database). Used to access information such as the AD FS configuration settings which contains sensitive information used to sign SAML tokens.
events: 17, 18uses: pipename
T1059.001 Command and Scripting Interpreter: PowerShell
Detects alternate PowerShell hosts potentially bypassing detections looking for powershell.exe
events: 17, 18uses: pipename
T1055 Process Injection
Detects the creation of a named pipe as used by CobaltStrike
events: 17, 18uses: pipename
T1055 Process Injection
Detects the creation of a named pipe matching a pattern used by CobaltStrike Malleable C2 profiles
events: 17, 18uses: pipename
T1055 Process Injection
Detects the creation of a named pipe with a pattern found in CobaltStrike malleable C2 profiles
events: 17, 18uses: pipename
T1055 Process Injection
Detects the pattern of a pipe name as used by the hack tool CoercedPotato
events: 17, 18uses: pipename
T1003.001 OS Credential Dumping: LSASS MemoryT1003.002 OS Credential Dumping: Security Account ManagerT1003.004 OS Credential Dumping: LSA SecretsT1003.005 OS Credential Dumping: Cached Domain Credentials
Detects well-known credential dumping tools execution via specific named pipe creation
events: 17, 18uses: pipename
Detects creation of default named pipe used by the DiagTrackEoP POC, a tool that abuses "SeImpersonate" privilege.
events: 17, 18uses: pipename
T1055 Process Injection
Detects the pattern of a pipe name as used by the hack tool EfsPotato
events: 17, 18uses: pipename
T1134.001 Access Token Manipulation: Token Impersonation/TheftT1528 Steal Application Access Token
Detects creation of default named pipes used by the Koh tool
events: 17, 18uses: pipename

See all 23 results in live search

The RansomHub intrusion included an RDP password spray. correlation:sequence limits results to multi-stage rules. Adding with:4625 filters to rules that include Security-Auditing Event ID 4625: An account failed to log on.

correlation:sequence with:46254 results |
T1110.001 Brute Force: Password GuessingT1110.003 Brute Force: Password Spraying
Identifies multiple logon failures followed by a successful one from the same source address. Adversaries will often brute force login attempts across multiple users with a common or known password, in an attempt to gain access to accounts.
2 stagessequencewindow: 5sevents: 4624, 4625
T1187 Forced AuthenticationT1550 Use Alternate Authentication MaterialT1557.001 Adversary-in-the-Middle: Name Resolution Poisoning and SMB Relay
Detects potential relay attacks by identifying coercion attempts followed by authentication events using a target server's computer account, originating from a different host. This may indicate that an attacker has captured and relayed Kerberos authentication material for the server's computer account to execute code on behalf of the compromised system.
2 stagessequencewindow: 5sevents: 4624, 4625, 5145
T1187 Forced AuthenticationT1557.001 Adversary-in-the-Middle: Name Resolution Poisoning and SMB Relay
Detects potential relay attacks by identifying coercion attempts followed by authentication events using a target server's computer account, originating from a different host. This may indicate that an attacker has captured and relayed the server's computer account hash to execute code on behalf of the compromised system.
2 stagessequencewindow: 5sevents: 4624, 4625, 5145
T1110 Brute Force
Identifies accounts who have failed to logon to the domain multiple times in a row, followed by a successful authentication within a short time frame. Multiple failed attempts followed by a success can be an indication of a brute force attempt or possible mis-configuration of a service account within an environment. The lookback is set to 2h and the authentication window and threshold are set to 1h and 5, meaning we need to see a minimum of 5 failures followed by a success for an account within ...
18 stagessequencewindow: 10mevents: 4624, 4625

Privilege escalation, credential access, C2

Lunar Spider performed a UAC bypass through a registry hijack of HKCU\Software\Classes\ms-settings\shell\open\command. The uses:TargetObject clause limits results to rules that inspect the registry path field.

value:ms-settings uses:TargetObject6 results |
T1548.002 Abuse Elevation Control Mechanism: Bypass User Account Control
Identifies attempts to bypass User Account Control (UAC) via ComputerDefaults execution hijack. Attackers bypass UAC to stealthily execute code with elevated permissions.
uses: targetobject
registry.key wildcard S-1-5-21-*Classes\ms-settings\shell\open\command
T1548.002 Abuse Elevation Control Mechanism: Bypass User Account Control
Identifies User Account Control (UAC) bypass via fodhelper.exe execution hijack. Attackers bypass UAC to stealthily execute code with elevated permissions.
uses: targetobject
registry.key wildcard *\ms-settings*
T1548.002 Abuse Elevation Control Mechanism: Bypass User Account Control
This detection looks for the steps required to conduct a UAC bypass using Fodhelper.exe. By default this detection looks for the setting of the required registry keys and the invoking of the process within 1 hour - this can be tweaked as required.
uses: targetobject
RegistryKey match Software\Classes\ms-settings\shell\open\command
T1548.002 Abuse Elevation Control Mechanism: Bypass User Account Control
This detection looks for the steps required to conduct a UAC bypass using Fodhelper.exe. By default this detection looks for the setting of the required registry keys and the invoking of the process within 1 hour - this can be tweaked as required.
uses: targetobject
RegistryKey match Software\Classes\ms-settings\shell\open\command
T1546.001 Event Triggered Execution: Change Default File AssociationT1548.002 Abuse Elevation Control Mechanism: Bypass User Account Control
Detects the shell open key manipulation (exefile and ms-settings) used for persistence and the pattern of UAC Bypass using fodhelper.exe, computerdefaults.exe, slui.exe via registry keys (e.g. UACMe 33 or 62)
uses: targetobject
TargetObject ends_with Classes\ms-settings\shell\open\command\(Default)TargetObject ends_with Classes\ms-settings\shell\open\command\DelegateExecuteTargetObject ends_with Classes\ms-settings\shell\open\command\SymbolicLinkValue

LSASS dumping through comsvcs.dll MiniDump appeared in EtherRat.

value:comsvcs19 results, showing first 10 |
T1003.001 OS Credential Dumping: LSASS Memory
Detects adversaries leveraging the MiniDump export function from comsvcs.dll via rundll32 to perform a memory dump from lsass
additional.fields["CallTrace"] contains comsvcs.dll
T1003.001 OS Credential Dumping: LSASS Memory
Detects a process memory dump via comsvcs.dll using rundll32, covering multiple different techniques
target.process.command_line contains comsvcs
T1003.001 OS Credential Dumping: LSASS MemoryT1003.003 OS Credential Dumping: NTDS
Identifies the execution of known Windows utilities often abused to dump LSASS memory or the Active Directory database (NTDS.dit) in preparation for credential access.
process.command_line wildcard *comsvcs*24*
T1003.001 OS Credential Dumping: LSASS MemoryT1036.003 Masquerading: Rename Legitimate UtilitiesT1218.011 System Binary Proxy Execution: Rundll32
Identifies suspicious renamed COMSVCS.DLL Image Load, which exports the MiniDump function that can be used to dump a process memory. This may indicate an attempt to dump LSASS memory while bypassing command-line based detection in preparation for credential access.
file.pe.original_file_name wildcard COMSVCS.DLL
T1003.001 OS Credential Dumping: LSASS MemoryT1003.003 OS Credential Dumping: NTDST1218.011 System Binary Proxy Execution: Rundll32
Identifies the execution of known Windows utilities often abused to dump LSASS memory or the Active Directory database (NTDS.dit) in preparation for credential access.
process.command_line wildcard *comsvcs*#*24*process.command_line wildcard *comsvcs*24* full*
T1036.001 Masquerading: Invalid Code SignatureT1036.005 Masquerading: Match Legitimate Resource Name or LocationT1553.002 Subvert Trust Controls: Code SigningT1554 Compromise Host Software BinaryT1574.001 Hijack Execution Flow: DLL
Identifies suspicious instances of default system32 DLLs either unsigned or signed with non-MS certificates. This can potentially indicate the attempt to masquerade as system DLLs, perform DLL Search Order Hijacking or backdoor and resign legitimate DLLs.
dll.name wildcard comsvcs.dll
T1003.001 OS Credential Dumping: LSASS Memory
Detects suspicious process patterns found in logs when CrackMapExec is used
CommandLine match do rundll32.exe C:\windows\System32\comsvcs.dll, MiniDump
T1003.001 OS Credential Dumping: LSASS MemoryT1036 Masquerading
Detects suspicious use of XORDump process memory dumping utility
CommandLine match -m comsvcs

See all 19 results in live search

DNS queries for the Tor .onion TLD offer another example. It anchors a domain suffix to the DNS query field.

field:QueryName value:.onion25 results, showing first 10 |

See all 25 results in live search

Rule tuning and false positive suppression

Run key persistence appeared in EtherRat, Lunar Spider, and KongTuke. The excludes: operator finds rules that suppress a field to reduce false positives. Here it finds rules anchored on the Run key path that also allowlist Image. Review those allowlists.

field:TargetObject value:*CurrentVersion\Run* excludes:Image32 results, showing first 10 |

See all 32 results in live search

References

The DFIR Report - Hide Your RDP: Password Spray Leads to RansomHub Deployment
The DFIR Report - Flash Alert: EtherRat and TukTuk C2 End in The Gentleman Ransomware
The DFIR Report - KongTuke FileFix Leads to New Interlock RAT Variant
The DFIR Report - Cat's Got Your Files: Lynx Ransomware
The DFIR Report - Apache ActiveMQ Exploit Leads to LockBit Ransomware
The DFIR Report - From a Single Click: How Lunar Spider Enabled a Near Two-Month Intrusion