← Back to Posts

When One Operator Isn't Enough

This is a follow-up to Will Any of This Fire?. That post introduced the method: decompose a threat report into behaviors, run each behavior up the ladder from technique tag to predicate leaf to structural pivot. This post runs the same method in rapid succession across six threat reports as a drill, covering multi-operator queries and operators not covered in the first post: 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 specific 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.exeoriginalfilename 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 specific field narrows to the network destination leaf, which surfaces different rules:

value:trycloudflare field:DestinationHostName4 results |
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 following RDP/SMB logons. The with: operator returns rules that span multiple 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, seen 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:1825 results, showing first 10 |
T1105 Ingress Tool Transfer
Detects the creation of a named pipe used by known APT malware. Reference - https://docs.microsoft.com/openspecs/windows_protocols/ms-wpo/4de75e21-36fd-440a-859b-75accc74487c
events: 17, 18, 9007006uses: pipename
T1055 Process InjectionT1559 Inter-Process Communication
This query looks for Named Pipe events that either contain one of the known IOCs or make use of patterns that can be linked to CobaltStrike usage.
events: 17, 18, 9007006uses: pipename
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

See all 25 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 those 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 via 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 specifically:

value:ms-settings uses:TargetObject4 results |
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
targetobject 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
targetobject 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 via comsvcs.dll MiniDump, seen in EtherRat:

value:comsvcs18 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
commandline contains comsvcs
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.
originalfilename 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.
commandline wildcard *comsvcs*#*24*
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
T1053 Scheduled Task/JobT1546 Event Triggered Execution
Detects activity observed by different researchers to be HAFNIUM group activity (or related) on Exchange servers
commandline match \comsvcs.dll

See all 18 results in live search

DNS queries for the Tor .onion TLD. This is not an IOC from any of the referenced reports, but illustrates anchoring a domain suffix to the DNS query field:

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

See all 23 results in live search

Rule tuning and false positive suppression

Run key persistence appeared in EtherRat, Lunar Spider, and KongTuke. The excludes: operator filters to rules that suppress a specific field to reduce false positives. Here it returns rules anchored on the Run key path that also allowlist on Image, which may contain allowlists worth reviewing:

field:TargetObject value:*CurrentVersion\Run* excludes:Image11 results, showing first 10 |
T1112 Modify RegistryT1547.001 Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder
Identifies run key or startup key registry modifications. In order to survive reboots and other system interrupts, attackers will modify run keys within the registry or leverage startup folder items as a form of persistence.
excludes: image
targetobject wildcard HKEY_USERS\*\Software\Microsoft\Windows\CurrentVersion\RunOnceEx\*targetobject wildcard HKEY_USERS\*\Software\Microsoft\Windows\CurrentVersion\RunOnce\*targetobject wildcard HKEY_USERS\*\Software\Microsoft\Windows\CurrentVersion\Run\*+3 more matching
T1037 Boot or Logon Initialization ScriptsT1112 Modify RegistryT1176 Software ExtensionsT1546.002 Event Triggered Execution: ScreensaverT1546.012 Event Triggered Execution: Image File Execution Options Injection+2 more
Detects changes to registry persistence keys that are not commonly used or modified by legitimate programs. This could be an indication of an adversary's attempt to persist in a stealthy manner.
excludes: image
targetobject wildcard HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\Install\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\*targetobject wildcard HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\Install\SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce\*

See all 11 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