Detection rules › Elastic
Elastic rules: 2x
Azure AD Graph Access with Suspicious User-Agent
#Identifies Azure AD Graph (graph.windows.net) requests originating from user-agent strings associated with offensive tooling, scripting libraries, or generic HTTP clients. First-party Microsoft components calling AAD Graph identify with specific user agents such as "Microsoft Azure Graph Client Library", "Microsoft ADO.NET Data Services", or "Microsoft.OData.Client". Anything outside that recognised set is either a developer prototyping against the legacy API or an enumeration tool walking the directory.
Known False Positives
- Developer activity prototyping against AAD Graph from a workstation may match. Validate via the calling `azure.aadgraphactivitylogs.properties.app_id` and the signed-in user; legitimate developer use is rare in production tenants since Microsoft has been steering callers off AAD Graph for years.
- Authorized red team or penetration test activity using ROADrecon, ROADtools, AADInternalsor similar tooling can match. Add exceptions on the source IP, signed-in user, or app ID after validation.
MITRE ATT&CK Coverage
Rule Body
[metadata]
creation_date = "2026/05/20"
integration = ["azure"]
maturity = "production"
updated_date = "2026/07/08"
[rule]
author = ["Elastic"]
description = """
Identifies Azure AD Graph (graph.windows.net) requests originating from user-agent strings associated with offensive
tooling, scripting libraries, or generic HTTP clients. First-party Microsoft components calling AAD Graph identify with
specific user agents such as "Microsoft Azure Graph Client Library", "Microsoft ADO.NET Data Services", or
"Microsoft.OData.Client". Anything outside that recognised set is either a developer prototyping against the legacy API
or an enumeration tool walking the directory.
"""
false_positives = [
"""
Developer activity prototyping against AAD Graph from a workstation may match. Validate via the calling
`azure.aadgraphactivitylogs.properties.app_id` and the signed-in user; legitimate developer use is rare in
production tenants since Microsoft has been steering callers off AAD Graph for years.
""",
"""
Authorized red team or penetration test activity using ROADrecon, ROADtools, AADInternalsor similar tooling can match. Add
exceptions on the source IP, signed-in user, or app ID after validation.
""",
]
from = "now-10m"
interval = "9m"
language = "esql"
license = "Elastic License v2"
name = "Azure AD Graph Access with Suspicious User-Agent"
note = """## Triage and analysis
### Investigating Azure AD Graph Access with Suspicious User-Agent
Azure AD Graph (graph.windows.net) is the legacy directory REST API that Microsoft has been retiring for years.
Legitimate first-party traffic against it is dominated by a small set of recognisable user agents (`Microsoft.OData.Client`,
`Microsoft Azure Graph Client Library`, `Microsoft ADO.NET Data Services`, the Azure portal with a Chrome user agent,
and an empty-UA tail from first-party AppIds). Traffic identifying as Python, aiohttp, curl, Go-http-client, or any
of the `*hound` enumeration families is almost always either a developer prototype or adversary tooling. This rule
flags any such request even at a single event, because tooling samples for AAD Graph are inherently low-volume in
normal tenants.
### Possible investigation steps
- Confirm the matching user agent.
- `user_agent.original` (e.g., `aiohttp`, `AADInternals`, `curl`, `bav2ropc`).
- Identify the caller and the calling client.
- `user.id` for the caller, `azure.aadgraphactivitylogs.properties.app_id` for the OAuth client.
- Review which directory object types were touched.
- `url.path` (e.g., `/users`, `/policies`, `/servicePrincipals`).
- Check the success / failure pattern.
- `http.response.status_code`. Many 4xx responses suggest permission probing.
- Cross-reference with the API version.
- `azure.aadgraphactivitylogs.properties.api_version`. A non-Microsoft UA combined with `1.6-internal` or `1.61-internal` is a stronger signal of offensive tooling.
- Pivot to sign-in logs (`logs-azure.signinlogs-*`) for the same user / source IP to understand how the token was obtained.
- Confirm the activity is not attributable to authorized testing (red team engagement, penetration test, internal tooling validation) before treating as malicious.
### Response and remediation
- Revoke refresh tokens and active sessions for the calling user.
- `POST /v1.0/users/{id}/revokeSignInSessions`.
- Temporarily disable the user if the alert is high-confidence or you need to halt further activity while investigation continues.
- `PATCH /v1.0/users/{id}` with body `{"accountEnabled": false}`.
- Check for device registrations created by the user during or around the burst window and remove rogue devices.
- `GET /v1.0/users/{id}/registeredDevices` and `GET /v1.0/users/{id}/ownedDevices`, then `DELETE /v1.0/devices/{deviceObjectId}`.
- Do this BEFORE session revocation: device-bound PRTs survive `revokeSignInSessions`.
- If the calling application has no legitimate AAD Graph dependency, block further use by that app.
- `PATCH /beta/applications/{id}` with body `{"authenticationBehaviors": {"blockAzureADGraphAccess": true}}`.
- This property lives on the Graph beta endpoint, not v1.0.
- Apply Conditional Access targeting the AAD Graph audience for the affected user population.
"""
references = [
"https://learn.microsoft.com/en-us/graph/migrate-azure-ad-graph-overview",
"https://github.com/dirkjanm/ROADtools",
"https://www.sophos.com/en-us/research/tampering-with-conditional-access-policies-using-azure-ad-graph-api",
"https://github.com/gerenios/aadinternals",
]
risk_score = 73
rule_id = "3aec394d-ed2a-4f3e-8ed3-4a2adea39f05"
setup = """#### Azure AD Graph Activity Logs
Requires Azure AD Graph Activity Logs ingested into `logs-azure.aadgraphactivitylogs-*` via the Elastic Azure
integration (Azure Event Hub). Enable the `AzureADGraphActivityLogs` diagnostic-settings category on Entra ID.
"""
severity = "high"
tags = [
"Domain: Cloud",
"Data Source: Azure",
"Data Source: Azure AD Graph",
"Data Source: Azure AD Graph Activity Logs",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-azure.aadgraphactivitylogs-* metadata _id, _version, _index
| where data_stream.dataset == "azure.aadgraphactivitylogs"
and azure.aadgraphactivitylogs.properties.actor_type == "User"
and user_agent.original is not null
| eval Esql.ua_lower = to_lower(user_agent.original)
| where Esql.ua_lower like "*fasthttp*"
or Esql.ua_lower like "*aiohttp*"
or Esql.ua_lower like "*hound*"
or Esql.ua_lower like "*aadinternals*"
or Esql.ua_lower like "*go-http-client*"
or Esql.ua_lower like "python*"
or Esql.ua_lower like "*curl/*"
or Esql.ua_lower like "*okhttp*"
or Esql.ua_lower like "*axios*"
or Esql.ua_lower like "*node-fetch*"
or Esql.ua_lower like "*go-resty*"
or Esql.ua_lower like "*bav2ropc*"
or Esql.ua_lower like "*undici*"
| keep
_id,
_version,
_index,
@timestamp,
user.id,
source.ip,
source.as.organization.name,
user_agent.original,
azure.aadgraphactivitylogs.properties.app_id,
azure.aadgraphactivitylogs.properties.api_version,
url.path,
http.response.status_code,
azure.tenant_id,
Esql.ua_lower
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1069"
name = "Permission Groups Discovery"
reference = "https://attack.mitre.org/techniques/T1069/"
[[rule.threat.technique.subtechnique]]
id = "T1069.003"
name = "Cloud Groups"
reference = "https://attack.mitre.org/techniques/T1069/003/"
[[rule.threat.technique]]
id = "T1087"
name = "Account Discovery"
reference = "https://attack.mitre.org/techniques/T1087/"
[[rule.threat.technique.subtechnique]]
id = "T1087.004"
name = "Cloud Account"
reference = "https://attack.mitre.org/techniques/T1087/004/"
[[rule.threat.technique]]
id = "T1526"
name = "Cloud Service Discovery"
reference = "https://attack.mitre.org/techniques/T1526/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[rule.investigation_fields]
field_names = [
"user.id",
"source.ip",
"source.as.organization.name",
"user_agent.original",
"azure.aadgraphactivitylogs.properties.app_id",
"azure.aadgraphactivitylogs.properties.api_version",
"url.path",
"http.response.status_code",
"azure.tenant_id",
]
Stages and Predicates
Stage 1: from
from logs-azure.aadgraphactivitylogs-* metadata _id, _version, _index
Stage 2: where
| where data_stream.dataset == "azure.aadgraphactivitylogs"
and azure.aadgraphactivitylogs.properties.actor_type == "User"
and user_agent.original is not null
Stage 3: eval
| eval Esql.ua_lower = to_lower(user_agent.original)
Stage 4: where
| where Esql.ua_lower like "*fasthttp*"
or Esql.ua_lower like "*aiohttp*"
or Esql.ua_lower like "*hound*"
or Esql.ua_lower like "*aadinternals*"
or Esql.ua_lower like "*go-http-client*"
or Esql.ua_lower like "python*"
or Esql.ua_lower like "*curl/*"
or Esql.ua_lower like "*okhttp*"
or Esql.ua_lower like "*axios*"
or Esql.ua_lower like "*node-fetch*"
or Esql.ua_lower like "*go-resty*"
or Esql.ua_lower like "*bav2ropc*"
or Esql.ua_lower like "*undici*"
Stage 5: keep
| keep
_id,
_version,
_index,
@timestamp,
user.id,
source.ip,
source.as.organization.name,
user_agent.original,
azure.aadgraphactivitylogs.properties.app_id,
azure.aadgraphactivitylogs.properties.api_version,
url.path,
http.response.status_code,
azure.tenant_id,
Esql.ua_lower
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
Esql.ua_lower | wildcard |
| field:"Esql.ua_lower" kind:wildcard |
azure.aadgraphactivitylogs.properties.actor_type | eq |
| field:"azure.aadgraphactivitylogs.properties.actor_type" kind:eq value:"User" |
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"azure.aadgraphactivitylogs" |
user_agent.original | is_not_null | field:"aws::userAgent" kind:is_not_null |
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
_id | KEEP _id |
_version | KEEP _version |
_index | KEEP _index |
@timestamp | KEEP @timestamp |
user.id | KEEP user.id |
source.ip | KEEP source.ip |
source.as.organization.name | KEEP source.as.organization.name |
user_agent.original | KEEP user_agent.original |
azure.aadgraphactivitylogs.properties.app_id | KEEP azure.aadgraphactivitylogs.properties.app_id |
azure.aadgraphactivitylogs.properties.api_version | KEEP azure.aadgraphactivitylogs.properties.api_version |
url.path | KEEP url.path |
http.response.status_code | KEEP http.response.status_code |
azure.tenant_id | KEEP azure.tenant_id |
Esql.ua_lower | KEEP Esql.ua_lower |
Binary Masquerading via Untrusted Path
#Identifies binaries that have been identically named to Windows built-in programs and being run from untrusted or commonly abused paths. Adversaries may attempt to manipulate the name of a task or service to make it appear legitimate or benign.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies binaries that have been identically named to Windows built-in programs and being run from untrusted or
commonly abused paths. Adversaries may attempt to manipulate the name of a task or service to make it appear legitimate
or benign.
"""
id = "35dedf0c-8db6-4d70-b2dc-a133b808211f"
license = "Elastic License v2"
name = "Binary Masquerading via Untrusted Path"
os_list = ["windows"]
reference = [
"https://www.elastic.co/security-labs/invisible-miners-unveiling-ghostengine",
"https://www.elastic.co/security-labs/siestagraph-new-implant-uncovered-in-asean-member-foreign-ministry",
]
version = "1.0.56"
query = '''
process where event.action == "start" and
(
process.name : (
"at.exe",
"atbroker.exe",
"bcdedit.exe",
"cmstp.exe",
"conhost.exe",
"control.exe",
"cscript.exe",
"csrss.exe",
"dsget.exe",
"dfsvc.exe",
"dllhost.exe",
"eventvwr.exe",
"ieexec.exe",
"ipconfig.exe",
"lsass.exe",
"Microsoft.Workflow.Compiler.exe",
"mmc.exe",
"msdt.exe",
"mshta.exe",
"msiexec.exe",
"net1.exe",
"netsh.exe",
"netstat.exe",
"odbcconf.exe",
"ping.exe",
"powershell.exe",
"qprocess.exe",
"quser.exe",
"qwinsta.exe",
"regsvcs.exe",
"rundll32.exe",
"schtasks.exe",
"sdclt.exe",
"services.exe",
"spoolsv.exe",
"svchost.exe",
"taskhost.exe",
"taskhostw.exe",
"userinit.exe",
"vaultcmd.exe",
"vssadmin.exe",
"wininit.exe",
"winlogon.exe",
"wmic.exe",
"wevtutil.exe",
"wscript.exe",
"gprslt.exe",
"nbtstat.exe",
"systeminfo.exe",
"VsJITDebugger.exe",
"extexport.exe",
"extexport.exe",
"fltmc.exe",
"stordiag.exe",
"manage-bde.exe") or
(process.pe.original_file_name == "bsdtar" and process.name : "tar.exe" and process.code_signature.subject_name == "Microsoft Windows") or
(process.pe.original_file_name : "WerFaultSecure.exe" or process.name : "WerFaultSecure.exe") or
(process.pe.original_file_name : "WerFault.exe" or process.name : "WerFault.exe") or
(process.pe.original_file_name : "wermgr.exe" or process.name : "wermgr.exe") or
(process.pe.original_file_name : "IE4UINIT.EXE" or process.name : "ie4uinit.exe") or
(process.pe.original_file_name == "curl.exe" and process.code_signature.subject_name : "Microsoft *" and process.executable : "C:\\Users\\*")
)
and
not process.executable : (
"?:\\Windows\\System32\\*.exe",
"?:\\Windows\\SysWOW64\\*.exe",
"?:\\Windows\\Microsoft.NET\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Program Files\\*.exe",
"?:\\Windows\\WinSxS\\*.exe",
"C:\\$WINDOWS.~BT\\NewOS\\Windows\\WinSxS\\wow64_microsoft-windows-*\\mmc.exe",
"C:\\Windows\\SoftwareDistribution\\Download\\*.exe",
/* Issue # 295 */
"?:\\Users\\*\\AppData\\Local\\Programs\\Git\\usr\\bin\\hostname.exe",
"?:\\*\\usr\\bin\\hostname.exe",
"?:\\ProgramData\\West Wind Technologies\\Uninstall\\*\\regsvr32.exe",
"?:\\ProgramData\\chocolatey\\*.exe",
"?:\\cygwin*\\bin\\*.exe",
/* PR #685 */
"\\Device\\HarddiskVolume*\\Windows\\System32\\*.exe",
"\\Device\\HarddiskVolume*\\Windows\\SysWOW64\\*.exe",
"\\Device\\HarddiskVolume*\\Windows\\Microsoft.NET\\*.exe",
"\\Device\\HarddiskVolume*\\Program Files (x86)\\*.exe",
"\\Device\\HarddiskVolume*\\Program Files\\*.exe",
/* VHD */
"\\Device\\VhdHardDisk*\\Windows\\System32\\*.exe",
"\\Device\\VhdHardDisk*\\Windows\\SysWOW64\\*.exe",
"\\Device\\VhdHardDisk*\\Windows\\Microsoft.NET\\*.exe",
"\\Device\\VhdHardDisk*\\Program Files (x86)\\*.exe",
"\\Device\\VhdHardDisk*\\Program Files\\*.exe",
"\\\\?\\Volume{*}\\Windows\\System32\\*.exe",
"\\\\?\\Volume{*}\\Windows\\SysWOW64\\*.exe",
"\\\\?\\Volume{*}\\Windows\\Microsoft.NET\\*.exe",
"\\\\?\\Volume{*}\\Program Files (x86)\\*.exe",
"\\\\?\\Volume{*}\\Program Files\\*.exe",
"\\\\?\\Volume{*}\\Windows\\WinSxS\\*.exe"
) and
not (process.executable : "?:\\ProgramData\\Lenovo\\ImController\\Plugins\\*.exe" and process.code_signature.subject_name : "Lenovo") and
not (process.pe.original_file_name == "RegAsm.exe" and
process.executable : "?:\\ProgramData\\Lenovo\\ImController\\Plugins\\LenovoBatteryGaugePackage\\*\\RegAsm.exe") and
not (process.name : "regsvr32.exe" and process.parent.executable : ("?:\\ERPU\\Browser\\AutoUpgrade.exe", "?:\\ERPU\\Browser\\NeoWeb.exe")) and
not (process.executable : "?:\\Campus\\System\\DLL\\CADability\\RegAsm.exe" and process.parent.executable : "?:\\Campus\\System\\DLL\\CADability\\RegCADability.exe") and
not (process.name : "services.exe" and process.args : "-i*" and process.parent.name : "monitor.exe") and
not (process.name : "RegAsm.exe" and process.args : ("directdeposit.vb.tlb", "?:\\Program Files (x86)\\*.dll", "?:\\Program Files\\*.dll")) and
not process.executable : "D:\\Reform V*\\Reform_PDC_Server_v*\\Plugins\\Monitoring\\CScript.exe" and
not (process.name : "rundll32.exe" and process.code_signature.subject_name : ("Teramind Inc.", "STAKHANOVETS LIMITED LIABILITY COMPANY") and process.code_signature.trusted == true) and
not (process.name : "regsvr32.exe" and
process.args : ("?:\\Sage\\Sage300 Programs\\GL69A\\FRCOM690.DLL",
"?:\\Program Files (x86)\\*.dll",
"?:\\Program Files\\*.dll",
"?:\\WINDOWS\\system32\\*.dll")) and
not process.executable : ("?:\\Microsoft Visual Studio\\*\\Msbuild.exe", "?:\\adv\\app\\RegAsm.exe", "?:\\Windows\\WinSxS\\wow64_microsoft-windows*management-console_*\\mmc.exe") and
not (process.executable : "?:\\Engeman\\RegAsm.exe" and process.parent.executable : "?:\\Engeman\\Engeman.exe") and
not (process.name : "regsvr32.exe" and process.code_signature.subject_name == "Tarma Software Research Ltd" and process.code_signature.trusted == true) and
not (process.parent.executable : "?:\\Gb\\GBsoftware.exe" and process.executable : "?:\\Gb\\Lib\\regsvr32.exe") and
not (process.executable : "?:\\OfficeMate\\REGSVR32.EXE" and process.parent.args : "?:\\OfficeMate\\~Reg*DLLs.bat" and process.parent.name : "cmd.exe") and
not (process.name : "powershell.exe" and process.executable : "?:\\Windows\\WinSxS\\amd64_microsoft-windows-powershell-exe_*\\powershell.exe") and
not process.executable : "?:\\ProgramData\\Lenovo\\ImController\\Plugins\\LenovoBatteryGaugePackage\\x64\\RegAsm.exe" and
not (process.name : "regasm.exe" and process.parent.executable : "?:\\Program Files (x86)\\Common Files\\InstallShield\\Driver\\*\\IDriver.exe") and
not process.executable : "?:\\Windows\\WinSxS\\amd64_microsoft-windows-powershell-exe_*\\powershell.exe" and
not (process.executable : ("?:\\Gb\\Lib\\regsvr32.exe", "?:\\E20-II\\ENVIRO\\regasm.exe") and
process.parent.executable : ("?:\\Gb\\GBsoftware.exe", "?:\\E20-II\\PCN33\\CODE\\SilentPCBEngTools128.exe")) and
not (process.parent.executable : "?:\\apps\\sage300\\Programs\\runtime\\a4wcontainerXP.exe" and process.name : "regsvr32.exe") and
not process.executable : "\\Device\\Mup\\*" and
not process.executable : ("?:\\*Visual*Studio\\*\\MSBuild.exe",
"?:\\CAMS\\Enterprise\\CAMSServices\\ServiceBroker\\RegAsm.exe",
"?:\\Witron\\wms\\rt\\axl\\runtime\\bin\\system\\tools\\RegAsm.exe",
"?:\\SpearTrayApplication\\Tray\\regsvr32.exe",
"?:\\ProgramData\\Lenovo\\Vantage\\Addins\\LenovoBatteryGaugeAddin\\*\\RegAsm.exe",
"*\\Visual Studio\\*\\Bin\\MSBuild.exe",
"C:\\Sage\\Sage300\\Online\\Worker\\InstallUtil.exe",
"C:\\AssessPro\\Programs\\RegAsm.exe",
"C:\\ProgramData\\Lenovo\\Vantage\\Addins\\LenovoBatteryGaugeAddin\\*\\RegAsm.exe") and
not (process.name : "regsvr32.exe" and process.parent.name : "rundll32.exe" and
process.parent.command_line : "*zzzzInvokeManagedCustomActionOutOfProc*") and
not (process.executable : "C:\\ProgramData\\baramundi\\bma\\Downloads\\Temp\\netsh.exe" and
process.args : "exec" and process.args : "\\\\*.txt") and
not (process.name : "bcdedit.exe" and process.args : "/enum") and
not (process.executable : "?:\\Windows\\LFSAgent\\services.exe" and
process.code_signature.trusted == true and
process.code_signature.subject_name : "LEPIDE SOFTWARE PRIVATE LIMITED") and
not (process.name : "ping.exe" and process.executable : "?:\\Windows\\Temp\\pdk-SYSTEM-*\\ping.exe") and
not (process.code_signature.subject_name : ("JetBrains s.r.o.", "LG Electronics Inc.", "Timothy Hugh Perry", "Code Systems Corporation", "Douyin Vision Co., Ltd.", "Hangzhou Hikvision Digital Tech.Co.,Ltd") and process.code_signature.trusted == true) and
not process.hash.sha256 :
("7c621ec91b71d14494beddaae8edb67ed26baa257d750546772aa90653ad6016",
"195bebdefeb704158633b7f3d943e1d792fcb9b81f36530fad5b04a1622a0c58",
"dc84f15625f115faa757dee79b285a5af65298074827c917f0dfcacc5b308855",
"3f73452d3a5c39c8abc9e2b37c5e5f6ef210a4edb17ac180f425b05f320e5720",
"10fe2a16356afcb0f0d3ae77dc1320acdc7244a4115e3eabff6220fdd8d1347f",
"77e67a63a69c545a193998e3c17f6e4b15538f40aaaec3a1d4713b05ab3a4ede",
"87a4a3a8fb5df2e79e512f8a5043725dde70811afb39110cd8b4904dd15046f2",
"637c3c0e4441998130d0166e95d0449e22d82107be8daeb234126ca6392b25b7",
"2425e9a2b5f19483e234eb220bd4db97cecc5dbef5fd1a19940f823c7997fc26",
"facb69c35c1d63aeca9d9e55525660b728445acd0df1b6a23e52acf329baf94c",
"879f58323b0ee3313a0e43d507373a6ac9bc5b3cfbd6eac6411c252af261b60e",
"c7b895a4a21b597a5a7dc3c1a2d4c5e9823649688da9b57dd0c1bcea28c739ba",
"186546f3a23be3069550c185363034e686e87a3eccc9f5c7f3a5a92f15a0b1cb") and
not (process.parent.code_signature.subject_name == "Data Spotlite Inc." and process.parent.code_signature.trusted == true and
process.executable : "C:\\CYRISMA_Agent\\App\\powershell.exe") and
not (process.executable : "?:\\CYRISMA_Agent\\App\\powershell.exe" and process.pe.original_file_name == "PowerShell.EXE" and
process.command_line == ".\\App\\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -File -")
'''
min_endpoint_version = "8.10.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[threat.technique.subtechnique]]
id = "T1036.004"
name = "Masquerade Task or Service"
reference = "https://attack.mitre.org/techniques/T1036/004/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
(
process.name : (
"at.exe",
"atbroker.exe",
"bcdedit.exe",
"cmstp.exe",
"conhost.exe",
"control.exe",
"cscript.exe",
"csrss.exe",
"dsget.exe",
"dfsvc.exe",
"dllhost.exe",
"eventvwr.exe",
"ieexec.exe",
"ipconfig.exe",
"lsass.exe",
"Microsoft.Workflow.Compiler.exe",
"mmc.exe",
"msdt.exe",
"mshta.exe",
"msiexec.exe",
"net1.exe",
"netsh.exe",
"netstat.exe",
"odbcconf.exe",
"ping.exe",
"powershell.exe",
"qprocess.exe",
"quser.exe",
"qwinsta.exe",
"regsvcs.exe",
"rundll32.exe",
"schtasks.exe",
"sdclt.exe",
"services.exe",
"spoolsv.exe",
"svchost.exe",
"taskhost.exe",
"taskhostw.exe",
"userinit.exe",
"vaultcmd.exe",
"vssadmin.exe",
"wininit.exe",
"winlogon.exe",
"wmic.exe",
"wevtutil.exe",
"wscript.exe",
"gprslt.exe",
"nbtstat.exe",
"systeminfo.exe",
"VsJITDebugger.exe",
"extexport.exe",
"extexport.exe",
"fltmc.exe",
"stordiag.exe",
"manage-bde.exe") or
(process.pe.original_file_name == "bsdtar" and process.name : "tar.exe" and process.code_signature.subject_name == "Microsoft Windows") or
(process.pe.original_file_name : "WerFaultSecure.exe" or process.name : "WerFaultSecure.exe") or
(process.pe.original_file_name : "WerFault.exe" or process.name : "WerFault.exe") or
(process.pe.original_file_name : "wermgr.exe" or process.name : "wermgr.exe") or
(process.pe.original_file_name : "IE4UINIT.EXE" or process.name : "ie4uinit.exe") or
(process.pe.original_file_name == "curl.exe" and process.code_signature.subject_name : "Microsoft *" and process.executable : "C:\\Users\\*")
)
and
not process.executable : (
"?:\\Windows\\System32\\*.exe",
"?:\\Windows\\SysWOW64\\*.exe",
"?:\\Windows\\Microsoft.NET\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Program Files\\*.exe",
"?:\\Windows\\WinSxS\\*.exe",
"C:\\$WINDOWS.~BT\\NewOS\\Windows\\WinSxS\\wow64_microsoft-windows-*\\mmc.exe",
"C:\\Windows\\SoftwareDistribution\\Download\\*.exe",
"?:\\Users\\*\\AppData\\Local\\Programs\\Git\\usr\\bin\\hostname.exe",
"?:\\*\\usr\\bin\\hostname.exe",
"?:\\ProgramData\\West Wind Technologies\\Uninstall\\*\\regsvr32.exe",
"?:\\ProgramData\\chocolatey\\*.exe",
"?:\\cygwin*\\bin\\*.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\*.exe",
"\\Device\\HarddiskVolume*\\Windows\\SysWOW64\\*.exe",
"\\Device\\HarddiskVolume*\\Windows\\Microsoft.NET\\*.exe",
"\\Device\\HarddiskVolume*\\Program Files (x86)\\*.exe",
"\\Device\\HarddiskVolume*\\Program Files\\*.exe",
"\\Device\\VhdHardDisk*\\Windows\\System32\\*.exe",
"\\Device\\VhdHardDisk*\\Windows\\SysWOW64\\*.exe",
"\\Device\\VhdHardDisk*\\Windows\\Microsoft.NET\\*.exe",
"\\Device\\VhdHardDisk*\\Program Files (x86)\\*.exe",
"\\Device\\VhdHardDisk*\\Program Files\\*.exe",
"\\\\?\\Volume{*}\\Windows\\System32\\*.exe",
"\\\\?\\Volume{*}\\Windows\\SysWOW64\\*.exe",
"\\\\?\\Volume{*}\\Windows\\Microsoft.NET\\*.exe",
"\\\\?\\Volume{*}\\Program Files (x86)\\*.exe",
"\\\\?\\Volume{*}\\Program Files\\*.exe",
"\\\\?\\Volume{*}\\Windows\\WinSxS\\*.exe"
) and
not (process.executable : "?:\\ProgramData\\Lenovo\\ImController\\Plugins\\*.exe" and process.code_signature.subject_name : "Lenovo") and
not (process.pe.original_file_name == "RegAsm.exe" and
process.executable : "?:\\ProgramData\\Lenovo\\ImController\\Plugins\\LenovoBatteryGaugePackage\\*\\RegAsm.exe") and
not (process.name : "regsvr32.exe" and process.parent.executable : ("?:\\ERPU\\Browser\\AutoUpgrade.exe", "?:\\ERPU\\Browser\\NeoWeb.exe")) and
not (process.executable : "?:\\Campus\\System\\DLL\\CADability\\RegAsm.exe" and process.parent.executable : "?:\\Campus\\System\\DLL\\CADability\\RegCADability.exe") and
not (process.name : "services.exe" and process.args : "-i*" and process.parent.name : "monitor.exe") and
not (process.name : "RegAsm.exe" and process.args : ("directdeposit.vb.tlb", "?:\\Program Files (x86)\\*.dll", "?:\\Program Files\\*.dll")) and
not process.executable : "D:\\Reform V*\\Reform_PDC_Server_v*\\Plugins\\Monitoring\\CScript.exe" and
not (process.name : "rundll32.exe" and process.code_signature.subject_name : ("Teramind Inc.", "STAKHANOVETS LIMITED LIABILITY COMPANY") and process.code_signature.trusted == true) and
not (process.name : "regsvr32.exe" and
process.args : ("?:\\Sage\\Sage300 Programs\\GL69A\\FRCOM690.DLL",
"?:\\Program Files (x86)\\*.dll",
"?:\\Program Files\\*.dll",
"?:\\WINDOWS\\system32\\*.dll")) and
not process.executable : ("?:\\Microsoft Visual Studio\\*\\Msbuild.exe", "?:\\adv\\app\\RegAsm.exe", "?:\\Windows\\WinSxS\\wow64_microsoft-windows*management-console_*\\mmc.exe") and
not (process.executable : "?:\\Engeman\\RegAsm.exe" and process.parent.executable : "?:\\Engeman\\Engeman.exe") and
not (process.name : "regsvr32.exe" and process.code_signature.subject_name == "Tarma Software Research Ltd" and process.code_signature.trusted == true) and
not (process.parent.executable : "?:\\Gb\\GBsoftware.exe" and process.executable : "?:\\Gb\\Lib\\regsvr32.exe") and
not (process.executable : "?:\\OfficeMate\\REGSVR32.EXE" and process.parent.args : "?:\\OfficeMate\\~Reg*DLLs.bat" and process.parent.name : "cmd.exe") and
not (process.name : "powershell.exe" and process.executable : "?:\\Windows\\WinSxS\\amd64_microsoft-windows-powershell-exe_*\\powershell.exe") and
not process.executable : "?:\\ProgramData\\Lenovo\\ImController\\Plugins\\LenovoBatteryGaugePackage\\x64\\RegAsm.exe" and
not (process.name : "regasm.exe" and process.parent.executable : "?:\\Program Files (x86)\\Common Files\\InstallShield\\Driver\\*\\IDriver.exe") and
not process.executable : "?:\\Windows\\WinSxS\\amd64_microsoft-windows-powershell-exe_*\\powershell.exe" and
not (process.executable : ("?:\\Gb\\Lib\\regsvr32.exe", "?:\\E20-II\\ENVIRO\\regasm.exe") and
process.parent.executable : ("?:\\Gb\\GBsoftware.exe", "?:\\E20-II\\PCN33\\CODE\\SilentPCBEngTools128.exe")) and
not (process.parent.executable : "?:\\apps\\sage300\\Programs\\runtime\\a4wcontainerXP.exe" and process.name : "regsvr32.exe") and
not process.executable : "\\Device\\Mup\\*" and
not process.executable : ("?:\\*Visual*Studio\\*\\MSBuild.exe",
"?:\\CAMS\\Enterprise\\CAMSServices\\ServiceBroker\\RegAsm.exe",
"?:\\Witron\\wms\\rt\\axl\\runtime\\bin\\system\\tools\\RegAsm.exe",
"?:\\SpearTrayApplication\\Tray\\regsvr32.exe",
"?:\\ProgramData\\Lenovo\\Vantage\\Addins\\LenovoBatteryGaugeAddin\\*\\RegAsm.exe",
"*\\Visual Studio\\*\\Bin\\MSBuild.exe",
"C:\\Sage\\Sage300\\Online\\Worker\\InstallUtil.exe",
"C:\\AssessPro\\Programs\\RegAsm.exe",
"C:\\ProgramData\\Lenovo\\Vantage\\Addins\\LenovoBatteryGaugeAddin\\*\\RegAsm.exe") and
not (process.name : "regsvr32.exe" and process.parent.name : "rundll32.exe" and
process.parent.command_line : "*zzzzInvokeManagedCustomActionOutOfProc*") and
not (process.executable : "C:\\ProgramData\\baramundi\\bma\\Downloads\\Temp\\netsh.exe" and
process.args : "exec" and process.args : "\\\\*.txt") and
not (process.name : "bcdedit.exe" and process.args : "/enum") and
not (process.executable : "?:\\Windows\\LFSAgent\\services.exe" and
process.code_signature.trusted == true and
process.code_signature.subject_name : "LEPIDE SOFTWARE PRIVATE LIMITED") and
not (process.name : "ping.exe" and process.executable : "?:\\Windows\\Temp\\pdk-SYSTEM-*\\ping.exe") and
not (process.code_signature.subject_name : ("JetBrains s.r.o.", "LG Electronics Inc.", "Timothy Hugh Perry", "Code Systems Corporation", "Douyin Vision Co., Ltd.", "Hangzhou Hikvision Digital Tech.Co.,Ltd") and process.code_signature.trusted == true) and
not process.hash.sha256 :
("7c621ec91b71d14494beddaae8edb67ed26baa257d750546772aa90653ad6016",
"195bebdefeb704158633b7f3d943e1d792fcb9b81f36530fad5b04a1622a0c58",
"dc84f15625f115faa757dee79b285a5af65298074827c917f0dfcacc5b308855",
"3f73452d3a5c39c8abc9e2b37c5e5f6ef210a4edb17ac180f425b05f320e5720",
"10fe2a16356afcb0f0d3ae77dc1320acdc7244a4115e3eabff6220fdd8d1347f",
"77e67a63a69c545a193998e3c17f6e4b15538f40aaaec3a1d4713b05ab3a4ede",
"87a4a3a8fb5df2e79e512f8a5043725dde70811afb39110cd8b4904dd15046f2",
"637c3c0e4441998130d0166e95d0449e22d82107be8daeb234126ca6392b25b7",
"2425e9a2b5f19483e234eb220bd4db97cecc5dbef5fd1a19940f823c7997fc26",
"facb69c35c1d63aeca9d9e55525660b728445acd0df1b6a23e52acf329baf94c",
"879f58323b0ee3313a0e43d507373a6ac9bc5b3cfbd6eac6411c252af261b60e",
"c7b895a4a21b597a5a7dc3c1a2d4c5e9823649688da9b57dd0c1bcea28c739ba",
"186546f3a23be3069550c185363034e686e87a3eccc9f5c7f3a5a92f15a0b1cb") and
not (process.parent.code_signature.subject_name == "Data Spotlite Inc." and process.parent.code_signature.trusted == true and
process.executable : "C:\\CYRISMA_Agent\\App\\powershell.exe") and
not (process.executable : "?:\\CYRISMA_Agent\\App\\powershell.exe" and process.pe.original_file_name == "PowerShell.EXE" and
process.command_line == ".\\App\\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -File -")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.code_signature.subject_name | eq |
| field:"Signature" kind:eq value:"Microsoft Windows" |
process.code_signature.subject_name | wildcard |
| field:"Signature" kind:wildcard value:"Microsoft *" |
process.executable | wildcard |
| field:"Image" kind:wildcard value:"C:\Users\*" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq |
process.pe.original_file_name | wildcard |
| field:"OriginalFileName" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | /enum | excludes:process.args field:"process.args" value:"/enum" |
process.name | eq | bcdedit.exe | excludes:process.name field:"process.name" value:"bcdedit.exe" |
process.args | eq | exec | excludes:process.args field:"process.args" value:"exec" |
process.args | wildcard | \\*.txt | excludes:process.args field:"process.args" value:"\\*.txt" |
process.executable | eq | C:\ProgramData\baramundi\bma\Downloads\Temp\netsh.exe | excludes:process.executable field:"process.executable" value:"C:\ProgramData\baramundi\bma\Downloads\Temp\netsh.exe" |
process.args | starts_with | -i | excludes:process.args field:"process.args" value:"-i" |
process.name | eq | services.exe | excludes:process.name field:"process.name" value:"services.exe" |
process.parent.name | eq | monitor.exe | excludes:process.parent.name field:"process.parent.name" value:"monitor.exe" |
process.args | wildcard | ?:\Sage\Sage300 Programs\GL69A\FRCOM690.DLL, ?:\Program Files (x86)\*.dll, ?:\Program Files\*.dll, ?:\WINDOWS\system32\*.dll | excludes:process.args |
process.name | eq | regsvr32.exe | excludes:process.name field:"process.name" value:"regsvr32.exe" |
process.args | wildcard | directdeposit.vb.tlb, ?:\Program Files (x86)\*.dll, ?:\Program Files\*.dll | excludes:process.args field:"process.args" value:"directdeposit.vb.tlb" field:"process.args" value:"?:\Program Files (x86)\*.dll" field:"process.args" value:"?:\Program Files\*.dll" |
process.name | eq | RegAsm.exe | excludes:process.name field:"process.name" value:"RegAsm.exe" |
process.code_signature.subject_name | eq | Tarma Software Research Ltd | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Tarma Software Research Ltd" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.code_signature.subject_name | eq | JetBrains s.r.o., LG Electronics Inc., Timothy Hugh Perry, Code Systems Corporation, Douyin Vision Co., Ltd., Hangzhou Hikvision Digital Tech.Co.,Ltd | excludes:process.code_signature.subject_name |
process.code_signature.subject_name | eq | LEPIDE SOFTWARE PRIVATE LIMITED | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"LEPIDE SOFTWARE PRIVATE LIMITED" |
process.executable | eq | ?:\Windows\LFSAgent\services.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\LFSAgent\services.exe" |
process.code_signature.subject_name | eq | Lenovo | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Lenovo" |
process.executable | wildcard | ?:\ProgramData\Lenovo\ImController\Plugins\*.exe | excludes:process.executable field:"process.executable" value:"?:\ProgramData\Lenovo\ImController\Plugins\*.exe" |
process.code_signature.subject_name | eq | Teramind Inc., STAKHANOVETS LIMITED LIABILITY COMPANY | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Teramind Inc." field:"process.code_signature.subject_name" value:"STAKHANOVETS LIMITED LIABILITY COMPANY" |
process.name | eq | rundll32.exe | excludes:process.name field:"process.name" value:"rundll32.exe" |
process.command_line | eq | .\App\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -File - | excludes:process.command_line field:"process.command_line" value:".\App\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -File -" |
process.executable | eq | ?:\CYRISMA_Agent\App\powershell.exe | excludes:process.executable field:"process.executable" value:"?:\CYRISMA_Agent\App\powershell.exe" |
process.pe.original_file_name | eq | PowerShell.EXE | excludes:process.pe.original_file_name field:"process.pe.original_file_name" value:"PowerShell.EXE" |
process.executable | eq | ?:\Campus\System\DLL\CADability\RegAsm.exe | excludes:process.executable field:"process.executable" value:"?:\Campus\System\DLL\CADability\RegAsm.exe" |
process.parent.executable | eq | ?:\Campus\System\DLL\CADability\RegCADability.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Campus\System\DLL\CADability\RegCADability.exe" |
process.executable | eq | ?:\Engeman\RegAsm.exe | excludes:process.executable field:"process.executable" value:"?:\Engeman\RegAsm.exe" |
process.parent.executable | eq | ?:\Engeman\Engeman.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Engeman\Engeman.exe" |
process.executable | eq | ?:\Gb\Lib\regsvr32.exe, ?:\E20-II\ENVIRO\regasm.exe | excludes:process.executable field:"process.executable" value:"?:\Gb\Lib\regsvr32.exe" field:"process.executable" value:"?:\E20-II\ENVIRO\regasm.exe" |
process.parent.executable | eq | ?:\Gb\GBsoftware.exe, ?:\E20-II\PCN33\CODE\SilentPCBEngTools128.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Gb\GBsoftware.exe" field:"process.parent.executable" value:"?:\E20-II\PCN33\CODE\SilentPCBEngTools128.exe" |
process.executable | eq | ?:\Gb\Lib\regsvr32.exe | excludes:process.executable field:"process.executable" value:"?:\Gb\Lib\regsvr32.exe" |
process.parent.executable | eq | ?:\Gb\GBsoftware.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Gb\GBsoftware.exe" |
process.executable | eq | ?:\OfficeMate\REGSVR32.EXE | excludes:process.executable field:"process.executable" value:"?:\OfficeMate\REGSVR32.EXE" |
process.parent.args | wildcard | ?:\OfficeMate\~Reg*DLLs.bat | excludes:process.parent.args field:"process.parent.args" value:"?:\OfficeMate\~Reg*DLLs.bat" |
process.parent.name | eq | cmd.exe | excludes:process.parent.name field:"process.parent.name" value:"cmd.exe" |
process.executable | eq | C:\CYRISMA_Agent\App\powershell.exe | excludes:process.executable field:"process.executable" value:"C:\CYRISMA_Agent\App\powershell.exe" |
process.parent.code_signature.subject_name | eq | Data Spotlite Inc. | excludes:process.parent.code_signature.subject_name field:"process.parent.code_signature.subject_name" value:"Data Spotlite Inc." |
process.parent.code_signature.trusted | eq | true | excludes:process.parent.code_signature.trusted field:"process.parent.code_signature.trusted" value:"true" |
process.executable | wildcard | ?:\ProgramData\Lenovo\ImController\Plugins\LenovoBatteryGaugePackage\*\RegAsm.exe | excludes:process.executable field:"process.executable" value:"?:\ProgramData\Lenovo\ImController\Plugins\LenovoBatteryGaugePackage\*\RegAsm.exe" |
process.pe.original_file_name | eq | RegAsm.exe | excludes:process.pe.original_file_name field:"process.pe.original_file_name" value:"RegAsm.exe" |
process.executable | wildcard | ?:\Windows\Temp\pdk-SYSTEM-*\ping.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\Temp\pdk-SYSTEM-*\ping.exe" |
process.name | eq | ping.exe | excludes:process.name field:"process.name" value:"ping.exe" |
process.executable | wildcard | ?:\Windows\WinSxS\amd64_microsoft-windows-powershell-exe_*\powershell.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\WinSxS\amd64_microsoft-windows-powershell-exe_*\powershell.exe" |
process.name | eq | powershell.exe | excludes:process.name field:"process.name" value:"powershell.exe" |
process.name | eq | regasm.exe | excludes:process.name field:"process.name" value:"regasm.exe" |
process.parent.executable | wildcard | ?:\Program Files (x86)\Common Files\InstallShield\Driver\*\IDriver.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Common Files\InstallShield\Driver\*\IDriver.exe" |
process.parent.command_line | match | zzzzInvokeManagedCustomActionOutOfProc | excludes:process.parent.command_line field:"process.parent.command_line" value:"zzzzInvokeManagedCustomActionOutOfProc" |
process.parent.name | eq | rundll32.exe | excludes:process.parent.name field:"process.parent.name" value:"rundll32.exe" |
process.parent.executable | eq | ?:\ERPU\Browser\AutoUpgrade.exe, ?:\ERPU\Browser\NeoWeb.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\ERPU\Browser\AutoUpgrade.exe" field:"process.parent.executable" value:"?:\ERPU\Browser\NeoWeb.exe" |
process.parent.executable | eq | ?:\apps\sage300\Programs\runtime\a4wcontainerXP.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\apps\sage300\Programs\runtime\a4wcontainerXP.exe" |
process.executable | eq | ?:\ProgramData\Lenovo\ImController\Plugins\LenovoBatteryGaugePackage\x64\RegAsm.exe | excludes:process.executable field:"process.executable" value:"?:\ProgramData\Lenovo\ImController\Plugins\LenovoBatteryGaugePackage\x64\RegAsm.exe" |
process.executable | starts_with | \Device\Mup\ | excludes:process.executable field:"process.executable" value:"\Device\Mup\" |
process.executable | wildcard | ?:\*Visual*Studio\*\MSBuild.exe, ?:\CAMS\Enterprise\CAMSServices\ServiceBroker\RegAsm.exe, ?:\Witron\wms\rt\axl\runtime\bin\system\tools\RegAsm.exe, ?:\SpearTrayApplication\Tray\regsvr32.exe, ?:\ProgramData\Lenovo\Vantage\Addins\LenovoBatteryGaugeAddin\*\RegAsm.exe, *\Visual Studio\*\Bin\MSBuild.exe, C:\Sage\Sage300\Online\Worker\InstallUtil.exe, C:\AssessPro\Programs\RegAsm.exe, C:\ProgramData\Lenovo\Vantage\Addins\LenovoBatteryGaugeAddin\*\RegAsm.exe | excludes:process.executable |
process.executable | wildcard | ?:\Microsoft Visual Studio\*\Msbuild.exe, ?:\adv\app\RegAsm.exe, ?:\Windows\WinSxS\wow64_microsoft-windows*management-console_*\mmc.exe | excludes:process.executable field:"process.executable" value:"?:\Microsoft Visual Studio\*\Msbuild.exe" field:"process.executable" value:"?:\adv\app\RegAsm.exe" field:"process.executable" value:"?:\Windows\WinSxS\wow64_microsoft-windows*management-console_*\mmc.exe" |
process.executable | wildcard | ?:\Windows\System32\*.exe, ?:\Windows\SysWOW64\*.exe, ?:\Windows\Microsoft.NET\*.exe, ?:\Program Files (x86)\*.exe, ?:\Program Files\*.exe, ?:\Windows\WinSxS\*.exe, C:\$WINDOWS.~BT\NewOS\Windows\WinSxS\wow64_microsoft-windows-*\mmc.exe, C:\Windows\SoftwareDistribution\Download\*.exe, ?:\Users\*\AppData\Local\Programs\Git\usr\bin\hostname.exe, ?:\*\usr\bin\hostname.exe, ?:\ProgramData\West Wind Technologies\Uninstall\*\regsvr32.exe, ?:\ProgramData\chocolatey\*.exe, ?:\cygwin*\bin\*.exe, \Device\HarddiskVolume*\Windows\System32\*.exe, \Device\HarddiskVolume*\Windows\SysWOW64\*.exe, \Device\HarddiskVolume*\Windows\Microsoft.NET\*.exe, \Device\HarddiskVolume*\Program Files (x86)\*.exe, \Device\HarddiskVolume*\Program Files\*.exe, \Device\VhdHardDisk*\Windows\System32\*.exe, \Device\VhdHardDisk*\Windows\SysWOW64\*.exe, \Device\VhdHardDisk*\Windows\Microsoft.NET\*.exe, \Device\VhdHardDisk*\Program Files (x86)\*.exe, \Device\VhdHardDisk*\Program Files\*.exe, \\?\Volume{*}\Windows\System32\*.exe, \\?\Volume{*}\Windows\SysWOW64\*.exe, \\?\Volume{*}\Windows\Microsoft.NET\*.exe, \\?\Volume{*}\Program Files (x86)\*.exe, \\?\Volume{*}\Program Files\*.exe, \\?\Volume{*}\Windows\WinSxS\*.exe | excludes:process.executable |
process.executable | wildcard | D:\Reform V*\Reform_PDC_Server_v*\Plugins\Monitoring\CScript.exe | excludes:process.executable field:"process.executable" value:"D:\Reform V*\Reform_PDC_Server_v*\Plugins\Monitoring\CScript.exe" |
process.hash.sha256 | eq | 7c621ec91b71d14494beddaae8edb67ed26baa257d750546772aa90653ad6016, 195bebdefeb704158633b7f3d943e1d792fcb9b81f36530fad5b04a1622a0c58, dc84f15625f115faa757dee79b285a5af65298074827c917f0dfcacc5b308855, 3f73452d3a5c39c8abc9e2b37c5e5f6ef210a4edb17ac180f425b05f320e5720, 10fe2a16356afcb0f0d3ae77dc1320acdc7244a4115e3eabff6220fdd8d1347f, 77e67a63a69c545a193998e3c17f6e4b15538f40aaaec3a1d4713b05ab3a4ede, 87a4a3a8fb5df2e79e512f8a5043725dde70811afb39110cd8b4904dd15046f2, 637c3c0e4441998130d0166e95d0449e22d82107be8daeb234126ca6392b25b7, 2425e9a2b5f19483e234eb220bd4db97cecc5dbef5fd1a19940f823c7997fc26, facb69c35c1d63aeca9d9e55525660b728445acd0df1b6a23e52acf329baf94c, 879f58323b0ee3313a0e43d507373a6ac9bc5b3cfbd6eac6411c252af261b60e, c7b895a4a21b597a5a7dc3c1a2d4c5e9823649688da9b57dd0c1bcea28c739ba, 186546f3a23be3069550c185363034e686e87a3eccc9f5c7f3a5a92f15a0b1cb | excludes:process.hash.sha256 |
Creation or Modification of a new GPO Scheduled Task or Service
#Detects the creation or modification of a new Group Policy based scheduled task or service. These methods are used for legitimate system administration, but can also be abused by an attacker with domain admin permissions to execute a malicious payload remotely on all or a subset of the domain joined machines.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation |
Rule Body
[metadata]
creation_date = "2020/08/13"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Detects the creation or modification of a new Group Policy based scheduled task or service. These methods are used for
legitimate system administration, but can also be abused by an attacker with domain admin permissions to execute a
malicious payload remotely on all or a subset of the domain joined machines.
"""
from = "now-9m"
index = [
"winlogbeat-*",
"logs-endpoint.events.file-*",
"logs-windows.sysmon_operational-*",
"endgame-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Creation or Modification of a new GPO Scheduled Task or Service"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Creation or Modification of a new GPO Scheduled Task or Service
Group Policy Objects (GPOs) are crucial for centralized management in Windows environments, allowing administrators to configure settings across domain-joined machines. Adversaries with domain admin rights can exploit GPOs to create or modify scheduled tasks or services, deploying malicious payloads network-wide. The detection rule identifies such activities by monitoring specific file changes in GPO paths, excluding legitimate system processes, thus highlighting potential abuse for privilege escalation or persistence.
### Possible investigation steps
- Review the file path and name to confirm if the changes were made to "ScheduledTasks.xml" or "Services.xml" within the specified GPO paths, as these are indicative of potential unauthorized modifications.
- Check the process that initiated the file change, ensuring it is not "C:\\\\Windows\\\\System32\\\\dfsrs.exe", which is excluded as a legitimate system process.
- Investigate the user account associated with the file modification event to determine if it has domain admin rights and assess if the activity aligns with their typical behavior or role.
- Examine recent changes in the GPO settings to identify any new or altered scheduled tasks or services that could be used for malicious purposes.
- Correlate the event with other security logs or alerts from data sources like Elastic Endgame, Sysmon, or Microsoft Defender XDR to identify any related suspicious activities or patterns.
- Assess the impact by identifying which domain-joined machines are affected by the GPO changes and determine if any unauthorized tasks or services have been executed.
### False positive analysis
- Legitimate administrative changes to GPOs can trigger alerts. Regularly review and document scheduled administrative tasks to differentiate between expected and unexpected changes.
- Automated system management tools may modify GPO scheduled tasks or services as part of routine operations. Identify these tools and create exceptions for their processes to reduce noise.
- Updates or patches from Microsoft or other trusted vendors might alter GPO settings. Monitor update schedules and correlate changes with known update activities to verify legitimacy.
- Internal IT scripts or processes that manage GPOs for configuration consistency can cause false positives. Ensure these scripts are well-documented and consider excluding their specific actions from monitoring.
- Temporary changes made by IT staff for troubleshooting or testing purposes can be mistaken for malicious activity. Implement a change management process to log and approve such activities, allowing for easy exclusion from alerts.
### Response and remediation
- Immediately isolate affected systems from the network to prevent further spread of any malicious payloads deployed via the modified GPO scheduled tasks or services.
- Revoke domain admin privileges from any accounts that are suspected of being compromised to prevent further unauthorized modifications to GPOs.
- Conduct a thorough review of the modified ScheduledTasks.xml and Services.xml files to identify any unauthorized or malicious entries, and revert them to their previous legitimate state.
- Utilize endpoint detection and response (EDR) tools to scan for and remove any malicious payloads that may have been executed on domain-joined machines as a result of the GPO modifications.
- Notify the security operations center (SOC) and escalate the incident to the incident response team for further investigation and to determine the scope of the compromise.
- Implement additional monitoring on GPO paths and domain admin activities to detect any further unauthorized changes or suspicious behavior.
- Review and strengthen access controls and auditing policies for GPO management to prevent unauthorized modifications in the future."""
risk_score = 21
rule_id = "c0429aa8-9974-42da-bfb6-53a0a515a145"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Privilege Escalation",
"Tactic: Persistence",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: Microsoft Defender XDR",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "windows" and event.type != "deletion" and event.action != "open" and
file.name : ("ScheduledTasks.xml", "Services.xml") and
file.path : (
"?:\\Windows\\SYSVOL\\domain\\Policies\\*\\MACHINE\\Preferences\\ScheduledTasks\\ScheduledTasks.xml",
"?:\\Windows\\SYSVOL\\domain\\Policies\\*\\MACHINE\\Preferences\\Services\\Services.xml"
) and
not process.executable : "C:\\Windows\\System32\\dfsrs.exe"
'''
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 11 - File Create](https://ela.st/sysmon-event-11-setup)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1484"
name = "Domain or Tenant Policy Modification"
reference = "https://attack.mitre.org/techniques/T1484/"
[[rule.threat.technique.subtechnique]]
id = "T1484.001"
name = "Group Policy Modification"
reference = "https://attack.mitre.org/techniques/T1484/001/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[rule.threat.technique.subtechnique]]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"
[[rule.threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[rule.threat.technique.subtechnique]]
id = "T1543.003"
name = "Windows Service"
reference = "https://attack.mitre.org/techniques/T1543/003/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
Stages and Predicates
Stage 1: file
file where host.os.type == "windows" and event.type != "deletion" and event.action != "open" and
file.name : ("ScheduledTasks.xml", "Services.xml") and
file.path : (
"?:\\Windows\\SYSVOL\\domain\\Policies\\*\\MACHINE\\Preferences\\ScheduledTasks\\ScheduledTasks.xml",
"?:\\Windows\\SYSVOL\\domain\\Policies\\*\\MACHINE\\Preferences\\Services\\Services.xml"
) and
not process.executable : "C:\\Windows\\System32\\dfsrs.exe"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | ne |
| field:"EventType" kind:ne value:"open" |
event.type | ne |
| field:"event.type" kind:ne value:"deletion" |
file.name | wildcard |
| field:"file.name" kind:wildcard |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | eq | C:\Windows\System32\dfsrs.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\System32\dfsrs.exe" |
Curl Local File Read or Write via Osascript
#Detects when Curl is executed via Osascript and reads or writes to a local file. Threat actors will often use Curl to download or upload files to a local file path on the system. The use of Curl via Osascript elevates the suspiciousness of the activity as osascript is a scripting language that can be used to execute AppleScript commands. The combination of these two activities is indicative of a threat actor attempting to download or upload a file on the system.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects when Curl is executed via Osascript and reads or writes to a local file. Threat actors will often use Curl to
download or upload files to a local file path on the system. The use of Curl via Osascript elevates the suspiciousness
of the activity as osascript is a scripting language that can be used to execute AppleScript commands. The combination
of these two activities is indicative of a threat actor attempting to download or upload a file on the system.
"""
id = "9abe2b65-10a9-4d7e-908b-d841d6c4b360"
license = "Elastic License v2"
name = "Curl Local File Read or Write via Osascript"
os_list = ["macos"]
reference = ["https://x.com/MsftSecIntel/status/1891410993265123662"]
version = "1.0.3"
query = '''
process where event.type == "start" and event.action == "exec" and process.name in ("curl", "nscurl") and
process.command_line : "*file://*" and process.parent.name == "osascript"
'''
min_endpoint_version = "8.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1105"
name = "Ingress Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1105/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "8.16.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.name in ("curl", "nscurl") and
process.command_line : "*file://*" and process.parent.name == "osascript"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:"*file://*" |
process.name | in |
| field:"process_basename" kind:in |
process.parent.name | eq |
| field:"parent_process_basename" kind:eq value:"osascript" |
Entra ID MFA Disabled for User
#Identifies when multi-factor authentication (MFA) is disabled for an Entra ID user account. An adversary may disable MFA for a user account in order to weaken the authentication requirements for the account.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Credential Access |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Azure | Disable Strong Authentication |
| Azure | User deleted security info |
Rules Detecting the Same Action
These rules filter on the same operation.
- [Entra ID] Authentication Method Changed for Privileged Account (Kusto)
- Account Created and Deleted in Short Timeframe (Kusto)
- Account Created And Deleted Within A Close Time Frame (Sigma)
- Account created from non-approved sources (Kusto)
- Account created or deleted by non-approved user (Kusto)
- Addition of a Temporary Access Pass to a Privileged Account (Kusto)
- Authentication Method Changed for Privileged Account (Kusto)
- Authentication Methods Changed for Privileged Account (Kusto)
Rule Body
[metadata]
creation_date = "2020/08/20"
integration = ["azure"]
maturity = "production"
updated_date = "2026/04/10"
[rule]
author = ["Elastic"]
description = """
Identifies when multi-factor authentication (MFA) is disabled for an Entra ID user account. An adversary may disable MFA
for a user account in order to weaken the authentication requirements for the account.
"""
from = "now-9m"
index = ["logs-azure.auditlogs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Entra ID MFA Disabled for User"
note = """## Triage and analysis
### Investigating Entra ID MFA Disabled for User
Multi-factor authentication is a process in which users are prompted during the sign-in process for an additional form of identification, such as a code on their cellphone or a fingerprint scan.
If you only use a password to authenticate a user, it leaves an insecure vector for attack. If the password is weak or has been exposed elsewhere, an attacker could be using it to gain access. When you require a second form of authentication, security is increased because this additional factor isn't something that's easy for an attacker to obtain or duplicate.
For more information about using MFA in Microsoft Entra ID, access the [official documentation](https://docs.microsoft.com/en-us/azure/active-directory/authentication/concept-mfa-howitworks#how-to-enable-and-use-azure-ad-multi-factor-authentication).
This rule identifies the deactivation of MFA for an Entra ID user account. This modification weakens account security and can lead to the compromise of accounts and other assets.
#### Possible investigation steps
- Identify the user account that performed the action and whether it should perform this kind of action.
- Investigate other alerts associated with the user account during the past 48 hours.
- Contact the account and resource owners and confirm whether they are aware of this activity.
- Correlate with Entra ID Sign-In Logs to identify anomalous sign-in attempts following MFA disablement.
- This rule does not identify if the user was removed from a conditional access policy (CAP) with MFA requirements.
- Instead the rule identifies both legacy and modern MFA disablement through user settings.
- Check if this operation was approved and performed according to the organization's change management policy.
- If you suspect the account has been compromised, scope potentially compromised assets by tracking servers, services, and data accessed by the account in the last 24 hours.
### False positive analysis
- While this activity can be done by administrators, all users must use MFA. The security team should address any potential benign true positive (B-TP), as this configuration can risk the user and domain.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Disable or limit the account during the investigation and response.
- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
- Identify the account role in the cloud environment.
- Assess the criticality of affected services and servers.
- Work with your IT team to identify and minimize the impact on users.
- Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
- Identify any regulatory or legal ramifications related to this activity.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords or delete API keys as needed to revoke the attacker's access to the environment. Work with your IT teams to minimize the impact on business operations during these actions.
- Reactivate multi-factor authentication for the user.
- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
- Implement security defaults [provided by Microsoft](https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/concept-fundamentals-security-defaults).
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
risk_score = 47
rule_id = "dafa3235-76dc-40e2-9f71-1773b96d24cf"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: Identity",
"Data Source: Azure",
"Data Source: Microsoft Entra ID",
"Data Source: Microsoft Entra ID Audit Logs",
"Use Case: Identity and Access Audit",
"Resources: Investigation Guide",
"Tactic: Persistence",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset: "azure.auditlogs" and
(azure.auditlogs.operation_name: "Disable Strong Authentication" or
(
azure.auditlogs.operation_name: "User deleted security info" and
azure.auditlogs.properties.additional_details.key: "AuthenticationMethod"
)) and event.outcome: (Success or success)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"
[[rule.threat.technique.subtechnique]]
id = "T1556.006"
name = "Multi-Factor Authentication"
reference = "https://attack.mitre.org/techniques/T1556/006/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"
[[rule.threat.technique.subtechnique]]
id = "T1556.006"
name = "Multi-Factor Authentication"
reference = "https://attack.mitre.org/techniques/T1556/006/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"
[[rule.threat.technique.subtechnique]]
id = "T1556.006"
name = "Multi-Factor Authentication"
reference = "https://attack.mitre.org/techniques/T1556/006/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: query
data_stream.dataset: "azure.auditlogs" and
(azure.auditlogs.operation_name: "Disable Strong Authentication" or
(
azure.auditlogs.operation_name: "User deleted security info" and
azure.auditlogs.properties.additional_details.key: "AuthenticationMethod"
)) and event.outcome: (Success or success)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
azure.auditlogs.operation_name | eq |
| field:"azure_ad::activity_display_name" kind:eq |
azure.auditlogs.properties.additional_details.key | eq |
| field:"azure.auditlogs.properties.additional_details.key" kind:eq value:"AuthenticationMethod" |
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"azure.auditlogs" |
event.outcome | in |
| field:"event.outcome" kind:in |
Excessive AWS S3 Object Encryption with SSE-C
#Identifies a high-volume of AWS S3 objects stored in a bucket using using Server-Side Encryption with Customer-Provided Keys (SSE-C). Adversaries with compromised AWS credentials can encrypt objects in an S3 bucket using their own encryption keys, rendering the objects unreadable or recoverable without the key. This can be used as a form of ransomware to extort the bucket owner for the decryption key. This is a Threshold rule that triggers when this behavior is observed multiple times for a specific bucket in a short time-window.
Known False Positives
- Legitimate use of Server-Side Encryption with Customer-Provided Keys (SSE-C) to encrypt objects in an S3 bucket.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Impact |
Telemetry Coverage
Rules Detecting the Same Action
These rules filter on the same operation.
- AWS S3 Copy Object with Client-Side Encryption (Panther)
- AWS S3 Object Encryption Using External KMS Key (Elastic)
- AWS S3 Static Site JavaScript File Uploaded (Elastic)
- AWS S3 Unauthenticated Bucket Access by Rare Source (Elastic)
- Potential AWS S3 Bucket Ransomware Note Uploaded (Elastic)
- Unusual AWS S3 Object Encryption with SSE-C (Elastic)
Rule Body
[metadata]
creation_date = "2025/01/15"
integration = ["aws"]
maturity = "production"
updated_date = "2026/07/14"
[rule]
author = ["Elastic"]
description = """
Identifies a high-volume of AWS S3 objects stored in a bucket using using Server-Side Encryption with Customer-Provided Keys (SSE-C). Adversaries with compromised AWS credentials can encrypt objects in an S3 bucket using their own encryption keys, rendering the objects unreadable or recoverable without the key. This can be used as a form of ransomware to extort the bucket owner for the decryption key. This is a Threshold rule that triggers when this behavior is observed multiple times for a specific bucket in a short time-window.
"""
false_positives = [
"""
Legitimate use of Server-Side Encryption with Customer-Provided Keys (SSE-C) to encrypt objects in an S3 bucket.
""",
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "kuery"
license = "Elastic License v2"
name = "Excessive AWS S3 Object Encryption with SSE-C"
note = """## Triage and analysis
### Investigating Excessive AWS S3 Object Encryption with SSE-C
This rule identifies a high volume of objects being encrypted using Server-Side Encryption with Customer-Provided Keys (SSE-C) in AWS S3. This could indicate malicious activity, such as ransomware encrypting objects, rendering them inaccessible without the corresponding encryption keys.
### Possible investigation steps
**Identify the user and source**:
- Review the `aws.cloudtrail.user_identity.arn` to identify the IAM user or role performing the operation.
- Cross-check the `source.ip` and `user_agent.original` fields for unusual IPs or user agents that could indicate unauthorized access.
- Review the `aws.cloudtrail.user_identity.access_key_id` to identify the access key used. This could be a compromised key.
**Examine the targeted resources**:
- Check `aws.cloudtrail.request_parameters` to identify the bucket involved.
- Analyze the object key from `aws.cloudtrail.request_parameters`.
**Evaluate encryption behavior**:
- Confirm the encryption details in `aws.cloudtrail.request_parameters` and `aws.cloudtrail.additional_eventdata`.
- Note if `SSEApplied` is `SSE-C`, which confirms encryption using a customer-provided key.
**Correlate with recent events**:
- Look for any suspicious activity in proximity to the encryption event, such as new access key creation, policy changes, or unusual access patterns from the same user or IP.
- Identify `ListBucket` or `GetObject` operations on the same bucket to determine all affected objects.
- For `PutObject` events, identify any other unusual objects uploaded such as a ransom note.
- For `CopyObject` events, the adversary may be performing in-place re-encryption by copying objects to themselves using SSE-C keys they control, rendering the originals unrecoverable without the key.
**Validate access permissions**:
- Check the IAM policies and roles associated with the user to verify if they had legitimate access to encrypt objects.
**Assess impact**:
- Identify the number of encrypted objects in the bucket by examining other similar events.
- Determine if this encryption aligns with standard business practices or constitutes a deviation.
### False positive analysis
- Confirm if SSE-C encryption is part of regular operations for compliance or data protection.
- Cross-reference known processes or users authorized for SSE-C encryption in the affected bucket.
### Response and remediation
**Immediate actions**:
- Disable access keys or permissions for the user if unauthorized behavior is confirmed.
- Rotate the bucket's encryption configuration to mitigate further misuse.
**Data recovery**:
- Attempt to identify and contact the party holding the SSE-C encryption keys if recovery is necessary.
**Enhance monitoring**:
- Enable alerts for future SSE-C encryption attempts in critical buckets.
- Review and tighten IAM policies for roles and users accessing S3.
**Post-Incident review**:
- Audit logs for additional activities by the same user or IP.
- Document findings and apply lessons learned to improve preventive measures.
"""
references = [
"https://www.halcyon.ai/blog/abusing-aws-native-services-ransomware-encrypting-s3-buckets-with-sse-c",
"https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html",
]
risk_score = 73
rule_id = "909bf7c8-d371-11ef-bcc3-f661ea17fbcd"
setup = "AWS S3 data event types need to be enabled in the CloudTrail trail configuration."
severity = "high"
tags = [
"Domain: Cloud",
"Data Source: AWS",
"Data Source: Amazon Web Services",
"Data Source: AWS S3",
"Resources: Investigation Guide",
"Use Case: Threat Detection",
"Tactic: Impact",
]
timestamp_override = "event.ingested"
type = "threshold"
query = '''
data_stream.dataset: "aws.cloudtrail"
and event.provider: "s3.amazonaws.com"
and event.action: ("PutObject" or "CopyObject")
and event.outcome: "success"
and aws.cloudtrail.flattened.request_parameters.x-amz-server-side-encryption-customer-algorithm: "AES256"
'''
[rule.investigation_fields]
field_names = [
"@timestamp",
"user.name",
"user_agent.original",
"source.ip",
"aws.cloudtrail.user_identity.arn",
"aws.cloudtrail.user_identity.type",
"aws.cloudtrail.user_identity.access_key_id",
"event.action",
"event.outcome",
"tls.client.server_name",
"cloud.account.id",
"cloud.region",
"aws.cloudtrail.request_parameters"
]
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1486"
name = "Data Encrypted for Impact"
reference = "https://attack.mitre.org/techniques/T1486/"
[rule.threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"
[rule.threshold]
field = ["tls.client.server_name"]
value = 20
Stages and Predicates
Stage 1: query
data_stream.dataset: "aws.cloudtrail"
and event.provider: "s3.amazonaws.com"
and event.action: ("PutObject" or "CopyObject")
and event.outcome: "success"
and aws.cloudtrail.flattened.request_parameters.x-amz-server-side-encryption-customer-algorithm: "AES256"
Indicators
These rows show field, operator, and value matches.
Execution via Windows Command Debugging Utility
#An adversary can use the Windows command line debugging utility cdb.exe to execute commands or shellcode. This rule looks for those instances and where the cdb.exe binary is outside of the normal WindowsKit installation paths.
MITRE ATT&CK Coverage
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2024/07/24"
integration = ["endpoint", "windows", "system", "sentinel_one_cloud_funnel", "m365_defender", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
An adversary can use the Windows command line debugging utility cdb.exe to execute commands or shellcode. This rule
looks for those instances and where the cdb.exe binary is outside of the normal WindowsKit installation paths.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-system.security*",
"logs-windows.sysmon_operational-*",
]
language = "eql"
license = "Elastic License v2"
name = "Execution via Windows Command Debugging Utility"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Execution via Windows Command Debugging Utility
The Windows command line debugging utility, cdb.exe, is a legitimate tool used for debugging applications. However, adversaries can exploit it to execute unauthorized commands or shellcode, bypassing security measures. The detection rule identifies suspicious use of cdb.exe by monitoring its execution outside standard installation paths and specific command-line arguments, indicating potential misuse for defense evasion.
### Possible investigation steps
- Review the process execution details to confirm the presence of cdb.exe running from non-standard paths, as specified in the query.
- Examine the command-line arguments used with cdb.exe, particularly looking for "-cf", "-c", or "-pd", to understand the potential actions or scripts being executed.
- Investigate the parent process of cdb.exe to determine how it was launched and identify any associated suspicious activity or processes.
- Check the user account associated with the cdb.exe execution to assess if it aligns with expected behavior or if it indicates potential compromise.
- Analyze recent system logs and security alerts for any related or preceding suspicious activities that might correlate with the execution of cdb.exe.
- Review network activity from the host to identify any unusual outbound connections that could suggest data exfiltration or command-and-control communication.
### False positive analysis
- Legitimate debugging activities by developers or IT staff using cdb.exe outside standard paths can trigger alerts. To manage this, create exceptions for known user accounts or specific machines frequently used for development.
- Automated testing environments may execute cdb.exe with command-line arguments for legitimate purposes. Identify these environments and exclude their processes from triggering alerts.
- Software installations or updates might temporarily use cdb.exe in non-standard paths. Monitor installation logs and exclude these specific instances if they are verified as part of legitimate software deployment.
- Security tools or scripts that leverage cdb.exe for monitoring or analysis can be mistaken for malicious activity. Document these tools and add them to the exclusion list to prevent false positives.
### Response and remediation
- Isolate the affected system from the network to prevent further unauthorized access or execution of malicious commands.
- Terminate any suspicious instances of cdb.exe running outside the standard installation paths to halt potential malicious activity.
- Conduct a forensic analysis of the affected system to identify any unauthorized changes or additional malicious payloads that may have been executed.
- Restore the system from a known good backup if any unauthorized changes or malware are detected, ensuring that the backup is clean and uncompromised.
- Update and patch the system to the latest security standards to close any vulnerabilities that may have been exploited.
- Implement application whitelisting to prevent unauthorized execution of cdb.exe from non-standard paths.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if the threat is part of a larger attack campaign."""
references = ["https://lolbas-project.github.io/lolbas/OtherMSBinaries/Cdb/"]
risk_score = 47
rule_id = "bdfaddc4-4438-48b4-bc43-9f5cf8151c46"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Data Source: Microsoft Defender XDR",
"Data Source: Crowdstrike",
"Data Source: Windows Security Event Logs",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
(?process.pe.original_file_name == "CDB.Exe" or process.name : "cdb.exe") and
process.args : ("-cf", "-c", "-pd") and
not process.executable : (
"?:\\Program Files (x86)\\*\\cdb.exe",
"?:\\Program Files\\*\\cdb.exe",
/* Crowdstrike specific exclusion as it uses NT Object paths */
"\\Device\\HarddiskVolume*\\Program Files (x86)\\*\\cdb.exe",
"\\Device\\HarddiskVolume*\\Program Files\\*\\cdb.exe"
)
'''
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[rule.threat.technique.subtechnique]]
id = "T1036.005"
name = "Match Legitimate Resource Name or Location"
reference = "https://attack.mitre.org/techniques/T1036/005/"
[[rule.threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
(?process.pe.original_file_name == "CDB.Exe" or process.name : "cdb.exe") and
process.args : ("-cf", "-c", "-pd") and
not process.executable : (
"?:\\Program Files (x86)\\*\\cdb.exe",
"?:\\Program Files\\*\\cdb.exe",
"\\Device\\HarddiskVolume*\\Program Files (x86)\\*\\cdb.exe",
"\\Device\\HarddiskVolume*\\Program Files\\*\\cdb.exe"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"cdb.exe" |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq value:"CDB.Exe" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\Program Files (x86)\*\cdb.exe, ?:\Program Files\*\cdb.exe, \Device\HarddiskVolume*\Program Files (x86)\*\cdb.exe, \Device\HarddiskVolume*\Program Files\*\cdb.exe | excludes:process.executable |
File Download Piped to Script Interpreter
#Detects when curl or wget is utilized to download a payload and pipe it to a script interpreter for immediate execution. This activity occurs when a file is downloaded and passed to a interpreter via a shell.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects when curl or wget is utilized to download a payload and pipe it to a script interpreter for immediate execution.
This activity occurs when a file is downloaded and passed to a interpreter via a shell.
"""
id = "2b616880-0a1b-42ef-a916-dea5864cd9b9"
license = "Elastic License v2"
name = "File Download Piped to Script Interpreter"
os_list = ["macos"]
version = "1.0.19"
query = '''
sequence with maxspan=2m
[process where event.type == "start" and event.action == "exec" and
process.name in ("curl", "nscurl") and
process.args in ("-o", "--output", "-O", "-o-", "O", "-dl", "--download", "-ld", "--large-download") and
process.command_line : ("/Users/Shared/*", "/tmp/*", "/private/tmp/*", "/var/tmp/*", "/private/var/tmp/*")] by process.Ext.effective_parent.entity_id
[file where event.action == "modification" and process.name in ("curl", "nscurl") and file.extension in ("sh", "scpt")] by Effective_process.entity_id
[process where event.type == "start" and event.action == "exec" and
process.name like~ ("python*", "perl*", "ruby*", "sh", "bash", "zsh", "osascript") and
process.parent.name in ("sh", "bash", "zsh", "osascript") and
((process.args like~ ("python*", "perl*", "ruby*", "bash", "sh", "zsh", "osascript") and process.args_count == 1) or
(process.args in ("bash", "sh", "zsh") and process.args == "-s" and process.args_count <= 2))] by process.Ext.effective_parent.entity_id
'''
min_endpoint_version = "8.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 2
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 2
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "8.16.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 2m, correlated by Effective_process.entity_id, process.Ext.effective_parent.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "exec" and
process.name in ("curl", "nscurl") and
process.args in ("-o", "--output", "-O", "-o-", "O", "-dl", "--download", "-ld", "--large-download") and
process.command_line : ("/Users/Shared/*", "/tmp/*", "/private/tmp/*", "/var/tmp/*", "/private/var/tmp/*")] by process.Ext.effective_parent.entity_id
Stage 2: file
[file where event.action == "modification" and process.name in ("curl", "nscurl") and file.extension in ("sh", "scpt")] by Effective_process.entity_id
Stage 3: process
[process where event.type == "start" and event.action == "exec" and
process.name like~ ("python*", "perl*", "ruby*", "sh", "bash", "zsh", "osascript") and
process.parent.name in ("sh", "bash", "zsh", "osascript") and
((process.args like~ ("python*", "perl*", "ruby*", "bash", "sh", "zsh", "osascript") and process.args_count == 1) or
(process.args in ("bash", "sh", "zsh") and process.args == "-s" and process.args_count <= 2))] by process.Ext.effective_parent.entity_id
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
file.extension | in |
| field:"file.extension" kind:in |
process.args | eq |
| field:"process.args" kind:eq value:"-s" |
process.args | in |
| field:"process.args" kind:in |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"1" |
process.args_count | le |
| field:"process.args_count" kind:le value:"2" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | in |
| field:"process_basename" kind:in |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
GitHub Authentication Token Access via Node.js
#This rule detects when the Node.js runtime spawns a shell to execute the GitHub CLI (gh) command to retrieve a GitHub authentication token. The GitHub CLI is a command-line tool that allows users to interact with GitHub from the terminal. The "gh auth token" command is used to retrieve an authentication token for GitHub, which can be used to authenticate API requests and perform actions on behalf of the user. Adversaries may use this technique to access GitHub repositories and potentially exfiltrate sensitive information or perform malicious actions. This activity was observed in the wild as part of the Shai-Hulud worm.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Credential Access | |
| Discovery |
Rule Body
[metadata]
creation_date = "2025/09/18"
integration = ["endpoint", "crowdstrike"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
This rule detects when the Node.js runtime spawns a shell to execute the GitHub CLI (gh) command to retrieve
a GitHub authentication token. The GitHub CLI is a command-line tool that allows users to interact with
GitHub from the terminal. The "gh auth token" command is used to retrieve an authentication token for
GitHub, which can be used to authenticate API requests and perform actions on behalf of the user. Adversaries
may use this technique to access GitHub repositories and potentially exfiltrate sensitive information or
perform malicious actions. This activity was observed in the wild as part of the Shai-Hulud worm.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*", "logs-crowdstrike.fdr*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "GitHub Authentication Token Access via Node.js"
references = ["https://www.elastic.co/blog/shai-hulud-worm-npm-supply-chain-compromise"]
risk_score = 47
rule_id = "e5d69377-f8cf-4e8f-8328-690822cd012a"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Tactic: Discovery",
"Data Source: Elastic Defend",
"Data Source: Elastic Endgame",
"Data Source: Crowdstrike",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "ProcessRollup2", "exec_event") and process.parent.name == "node" and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and process.args == "gh auth token"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1528"
name = "Steal Application Access Token"
reference = "https://attack.mitre.org/techniques/T1528/"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1613"
name = "Container and Resource Discovery"
reference = "https://attack.mitre.org/techniques/T1613/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "ProcessRollup2", "exec_event") and process.parent.name == "node" and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and process.args == "gh auth token"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"gh auth token" |
process.name | in |
| field:"process_basename" kind:in |
process.parent.name | eq |
| field:"parent_process_basename" kind:eq value:"node" |
Google Workspace Role Modified
#Detects when a custom admin role or its privileges are modified in Google Workspace. Adversaries may add or expand privileges on an existing role to elevate access for assigned users or groups without creating a new role or directly assigning a well-known admin role. Because privilege changes take effect for all principals assigned the role, modifying role permissions can silently expand access across multiple accounts.
Known False Positives
- Google Workspace admin roles may be modified by system administrators. Verify that the configuration change was expected. Exceptions can be added to this rule to filter expected behavior.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation |
Telemetry Coverage
| Platform | Record / event type |
|---|---|
| Google Workspace | ADD_PRIVILEGE: Add Privilege |
| Google Workspace | UPDATE_ROLE: Update Role |
Rule Body
[metadata]
creation_date = "2020/11/17"
integration = ["google_workspace"]
maturity = "production"
updated_date = "2026/07/08"
[rule]
author = ["Elastic"]
description = """
Detects when a custom admin role or its privileges are modified in Google Workspace. Adversaries may add or expand
privileges on an existing role to elevate access for assigned users or groups without creating a new role or directly
assigning a well-known admin role. Because privilege changes take effect for all principals assigned the role, modifying
role permissions can silently expand access across multiple accounts.
"""
false_positives = [
"""
Google Workspace admin roles may be modified by system administrators. Verify that the configuration change was
expected. Exceptions can be added to this rule to filter expected behavior.
""",
]
from = "now-130m"
index = ["filebeat-*", "logs-google_workspace*"]
interval = "10m"
language = "kuery"
license = "Elastic License v2"
name = "Google Workspace Role Modified"
note = """## Triage and analysis
### Investigating Google Workspace Role Modified
Google Workspace allows administrators to modify custom admin roles by adding, removing, or updating privileges across
services such as Users, Groups, Gmail, Drive, and Security. Threat actors may expand privileges on an existing role to
establish persistence or escalate access for accounts already assigned that role, without triggering role assignment
alerts. Selecting a privilege category in the Admin console (for example, Organization Units) can add multiple related
privilege groups in a single action, each logged as a separate `ADD_PRIVILEGE` event.
This rule identifies when a Google Workspace role is modified via `ADD_PRIVILEGE` or `UPDATE_ROLE` events. Alert
suppression groups alerts by `user.email`, `google_workspace.admin.role.name`, and `source.ip` within a 130-minute window
(matching the rule lookback) so analysts receive one alert per role modification session instead of one alert per privilege.
### Possible investigation steps
- Identify the initiating (actor) account that modified the role by reviewing `user.email` or `user.name`, and note the `source.ip` and `event.ingested` timestamps.
- Identify the role modified by reviewing `google_workspace.admin.role.name`.
- Identify the privilege changed by reviewing `google_workspace.admin.privilege.name`. Because suppression may group multiple events, search for all related changes in the same session (see Kibana steps below).
- Determine whether the modification is expected and authorized:
- Validate there is an approved change request/ticket and that the actor account is authorized to modify admin roles.
- If the actor account or source IP is unusual, treat the alert as higher priority until proven benign.
- Review role permissions in the Google Admin console:
- Navigate to Account > Admin roles.
- Locate the role name from `google_workspace.admin.role.name` and select it to open the role details.
- Review the Privileges tab to confirm which permissions were added or removed and whether they align with the organization's delegation model.
- Review the Admins tab to identify which users or groups currently hold the role and will inherit the modified privileges.
- Search Kibana for all privileges changed in the session:
- In Discover (or the alert investigation workflow), search Google Workspace admin logs with a time range centered on the alert timestamp (±5 minutes).
- Use the following KQL example, replacing `<ROLE_NAME>` with the value from `google_workspace.admin.role.name`:
```
data_stream.dataset: "google_workspace.admin" and event.action: ("ADD_PRIVILEGE" or "UPDATE_ROLE") and google_workspace.admin.role.name: "<ROLE_NAME>"
```
- Optionally filter on the actor with `user.email` to isolate changes from the same administrator.
- Review all `google_workspace.admin.privilege.name` values returned to understand the full scope of the modification.
- Search Kibana for principals recently assigned the role to determine blast radius:
- Use the following KQL example:
```
data_stream.dataset: "google_workspace.admin" and event.action: "ASSIGN_ROLE" and google_workspace.admin.role.name: "<ROLE_NAME>"
```
- Review `user.target.email` and `user.target.name` for user/group assignments.
- Scope for related activity by searching for the same `user.email` (actor) performing other IAM or security actions such as `ASSIGN_ROLE`, `CREATE_ROLE`, `CREATE_USER`, or security policy changes within the last 48 hours.
- Evaluate whether principals assigned the modified role performed suspicious activity after the change:
- Review admin/audit events for security control changes, user or group changes, and Gmail configuration changes.
### False positive analysis
- Verify the role modification aligns with approved administrative duties, an authorized change window, and the organization's access governance process.
- Confirm the initiating admin account is legitimate and not modifying roles from unusual IPs, devices, or locations.
- Selecting a privilege category in the Admin console can add multiple related privileges in one action; alert suppression should consolidate these into a single alert.
- Compare the modified role's privileges against the stated business need; overly broad privileges warrant closer review even if the change was authorized.
### Response and remediation
- Initiate the incident response process based on triage findings.
- If the modification is not clearly authorized, revert the role privileges to their prior state and/or remove the role assignment from affected users or groups while the investigation proceeds.
- For suspected compromise of the initiating admin account:
- Reset credentials, revoke active sessions, enforce MFA re-enrollment, and review delegation/OAuth grants for persistence.
- Validate recovery email/phone settings and account security posture.
- Review whether principals assigned the modified role require the new privileges, and replace broad custom roles with narrower delegated roles where feasible.
- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
## Setup
The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
### Important Information Regarding Google Workspace Event Lag Times
- As per Google's documentation, Google Workspace administrators may observe lag times ranging from minutes up to 3 days between the time of an event's occurrence and the event being visible in the Google Workspace admin/audit logs.
- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
- To reduce the risk of false negatives, consider reducing the interval that the Google Workspace (formerly G Suite) Filebeat module polls Google's reporting API for new events.
- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
- See the following references for further information:
- https://support.google.com/a/answer/7061566
- https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
references = [
"https://support.google.com/a/answer/2406043?hl=en",
"https://www.elastic.co/security-labs/google-workspace-attack-surface-part-one",
"https://www.elastic.co/security-labs/google-workspace-attack-surface-part-two"
]
risk_score = 73
rule_id = "6f435062-b7fc-4af9-acea-5b1ead65c5a5"
severity = "high"
tags = [
"Domain: Cloud",
"Data Source: Google Workspace",
"Use Case: Identity and Access Audit",
"Resources: Investigation Guide",
"Tactic: Persistence",
"Tactic: Privilege Escalation",
]
timestamp_override = "event.ingested"
type = "query"
query = '''
data_stream.dataset:google_workspace.admin and event.provider:admin and event.category:iam and event.action:(ADD_PRIVILEGE or UPDATE_ROLE)
'''
[rule.alert_suppression]
group_by = ["user.email", "google_workspace.admin.role.name", "source.ip"]
duration = {value = 130, unit = "m"} # match lookback window
missing_fields_strategy = "suppress"
[rule.investigation_fields]
field_names = [
"source.ip",
"user.name",
"user.email",
"event.action",
"google_workspace.admin.role.name",
"google_workspace.admin.privilege.name",
]
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
Stages and Predicates
Stage 1: query
data_stream.dataset:google_workspace.admin and event.provider:admin and event.category:iam and event.action:(ADD_PRIVILEGE or UPDATE_ROLE)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
data_stream.dataset | eq |
| field:"data_stream.dataset" kind:eq value:"google_workspace.admin" |
event.action | in |
| field:"EventType" kind:in |
event.category | eq |
| field:"event.category" kind:eq value:"iam" |
event.provider | eq |
| field:"Provider_Name" kind:eq value:"admin" |
Image Load via Transactional NTFS
#Identifies attempts to load a transacted file. This is a technique that exploits Transactional NTFS to execute arbitrary code in the address space of a running process, without committing the code to disk.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies attempts to load a transacted file. This is a technique that exploits Transactional NTFS to execute arbitrary
code in the address space of a running process, without committing the code to disk.
"""
id = "eb40ab54-8642-488a-8e7b-ee00599079fc"
license = "Elastic License v2"
name = "Image Load via Transactional NTFS"
os_list = ["windows"]
version = "1.0.2"
query = '''
sequence with maxspan=1m
[file where event.action == "overwrite" and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "*!CreateFileTransacted*")] by file.name
[library where event.action == "load" and process.pid != 4 and dll.Ext.defense_evasions : "Process Tampering*"] by dll.name
'''
min_endpoint_version = "8.10.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by dll.name, file.name.
Stage 1: file
[file where event.action == "overwrite" and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "*!CreateFileTransacted*")] by file.name
Stage 2: library
[library where event.action == "load" and process.pid != 4 and dll.Ext.defense_evasions : "Process Tampering*"] by dll.name
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dll.Ext.defense_evasions | wildcard |
| field:"dll.Ext.defense_evasions" kind:wildcard value:"Process Tampering*" |
event.action | eq |
| field:"EventType" kind:eq |
process.pid | ne |
| field:"process_id" kind:ne value:"4" |
Interactive Logon by an Unusual Process
#Identifies interactive logon attempt with alternate credentials and by an unusual process. Adversaries may create a new token to escalate privileges and bypass access controls.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule Body
[metadata]
creation_date = "2023/12/04"
integration = ["system", "windows"]
maturity = "production"
updated_date = "2026/05/03"
[rule]
author = ["Elastic"]
description = """
Identifies interactive logon attempt with alternate credentials and by an unusual process. Adversaries may create a new
token to escalate privileges and bypass access controls.
"""
from = "now-9m"
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
language = "eql"
license = "Elastic License v2"
name = "Interactive Logon by an Unusual Process"
references = ["https://attack.mitre.org/techniques/T1134/002/"]
risk_score = 73
rule_id = "61766ef9-48a5-4247-ad74-3349de7eb2ad"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Privilege Escalation",
"Data Source: Windows Security Event Logs",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
authentication where
host.os.type : "windows" and winlog.event_data.LogonProcessName : "Advapi*" and
winlog.logon.type == "Interactive" and winlog.event_data.SubjectUserSid : ("S-1-5-21*", "S-1-12-*") and
winlog.event_data.TargetUserSid : ("S-1-5-21*", "S-1-12-*") and process.executable : "C:\\*" and
not startswith~(winlog.event_data.SubjectUserSid, winlog.event_data.TargetUserSid) and
not process.executable :
("?:\\Windows\\System32\\winlogon.exe",
"?:\\Windows\\System32\\wininit.exe",
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe",
"?:\\Windows\\System32\\inetsrv\\w3wp.exe",
"?:\\Windows\\SysWOW64\\msiexec.exe")
'''
note = """## Triage and analysis
### Investigating Interactive Logon by an Unusual Process
#### Possible investigation steps
- Did Advapi create an interactive logon for a different target identity?
- Focus: `winlog.logon.type`, `winlog.event_data.LogonProcessName`, `winlog.event_data.SubjectUserSid`, `winlog.event_data.TargetUserSid`, and `host.id`.
- Implication: escalate when Advapi creates a different Target session without recognized credential-switch use; lower suspicion only for bounded runas or helper use on this host. Subject initiated the action; Target received the session or token.
- Which process requested the alternate-credential session?
- Focus: `process.executable`, `process.name`, `process.pid`, `winlog.event_data.SubjectUserName`, and `winlog.event_data.SubjectDomainName`.
- Implication: escalate when the requester is user-writable, temporary, renamed, or unrelated to credential switching; lower suspicion only for System32 runas.exe or a recognized helper tied to the same Subject. Process identity alone does not clear token creation.
- Did the Target session create privileged or linked-token access?
- Focus: `winlog.event_data.TargetUserSid`, `winlog.event_data.TargetLogonId`, `winlog.event_data.TargetLinkedLogonId`, `winlog.event_data.ElevatedToken`, and `winlog.event_data.ImpersonationLevel`.
- Implication: escalate on a privileged or unusual Target account, elevated token, linked session, or impersonation-capable token. Keep unresolved when the Target cannot be tied to the requesting Subject and process; a recognized requester does not clear elevated Target token state.
- Did explicit-credential records show who supplied Target credentials?
- Focus: same-host 4648 records using `winlog.event_data.SubjectLogonId`; read `winlog.event_data.TargetUserName`, `winlog.event_data.TargetDomainName`, `winlog.event_data.TargetServerName`, and `source.ip`.
- Hint: make-token tooling may leave only Advapi, different Subject/Target SIDs, and Target session fields; do not require endpoint command-line evidence before escalation. $investigate_0
- Implication: escalate when 4648 shows the same Subject session presenting Target credentials to an unexpected server or non-local origin. Local or absent `source.ip` can occur in make-token cases and must be weighed with requester, identity pair, and token state; missing Security telemetry is unresolved, not benign.
- Did the created Target session show follow-on success or authentication-method signals?
- Focus: same-host 4624 and 4634 records using `winlog.event_data.TargetLogonId`; read `winlog.event_data.TargetUserSid`, `winlog.event_data.AuthenticationPackageName`, and `source.ip`.
- Implication: escalate on unexpected authentication package use, repeated successful session activity, or a non-local origin that contradicts local workflow; absent or local source details should be weighed with Target-token evidence. Missing 4624/4634 telemetry is unresolved, not benign.
- $investigate_1
- $investigate_2
- What activity is tied to the created Target logon session?
- Focus: same-host events carrying `winlog.event_data.TargetLogonId`, especially process, privilege, or authentication records tied to the Target identity. $investigate_3
- Implication: escalate when the Target session performs privileged operations, starts unexpected processes, or chains authentication; no follow-on telemetry narrows activity only when the requester, identity pair, and token state are otherwise explained.
- If local evidence remains suspicious or unresolved, do related alerts change scope?
- Focus: recent alerts for the same `host.id`, Subject SID, and Target SID.
- $investigate_4
- $investigate_5
- $investigate_6
- Implication: broaden scope when related alerts show credential access, privilege escalation, persistence, or lateral movement tied to the host or either identity; quiet alert history cannot close unresolved token/session evidence.
- Escalate on unauthorized Subject-to-Target token creation; close only when the identity pair, requester, Target token, and Security records all bind to one recognized workflow; if mixed, preserve records and use related alerts plus recent session activity to scope the case.
### False positive analysis
- Recognized runas, enterprise PAM or credential-broker helpers, and authorized assessment can trigger this rule from monitored admin hosts. Confirm `process.executable`, Subject and Target identities, `host.id`, and explicit-credential or session records bind to the same workflow or validation scope; contradictory Target token details block benign closure.
- Build exceptions only from the minimum confirmed pattern, such as `process.executable` plus `winlog.event_data.SubjectUserSid`, `winlog.event_data.TargetUserSid`, and a bounded `host.id` or host group. Avoid exceptions on `process.name`, `user.name`, or the Target account alone.
### Response and remediation
- If confirmed benign, document the evidence categories, reverse temporary containment, and create only the narrow exception described above.
- If suspicious but unconfirmed, export the alert and surrounding Windows Security records, preserve the requesting process image and Subject-to-Target session context, and collect the referenced executable before containment.
- Apply reversible containment first: restrict the affected account or host session, increase monitoring on the involved `host.id` and identities, and weigh host criticality before isolation.
- If confirmed malicious, preserve the executable referenced by `process.executable`, session records, and Subject/Target identifiers, then contain involved hosts or accounts and invalidate active sessions.
- Reset or rotate Target credentials only when compromise or unauthorized use is supported; treat Subject as the operator or requesting context before disabling it.
- Eradicate only confirmed token-abuse tooling or credential material, review local privilege assignments that allowed the session, and retain Windows Security events needed to reconstruct Subject-to-Target token creation."""
setup = """## Setup
Audit Logon must be enabled to generate the events used by this rule.
Setup instructions: https://ela.st/audit-logon
"""
[rule.investigation_fields]
field_names = [
"@timestamp",
"host.id",
"process.name",
"process.executable",
"process.pid",
"winlog.logon.type",
"winlog.event_data.LogonProcessName",
"winlog.event_data.ImpersonationLevel",
"winlog.event_data.ElevatedToken",
"winlog.event_data.SubjectUserSid",
"winlog.event_data.SubjectUserName",
"winlog.event_data.SubjectLogonId",
"winlog.event_data.TargetUserSid",
"winlog.event_data.TargetLogonId",
"winlog.event_data.TargetLinkedLogonId",
]
[transform]
[[transform.investigate]]
label = "Explicit-credential events from the subject session"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "event.code", queryType = "phrase", value = "4648", valueType = "string" },
{ excluded = false, field = "winlog.event_data.SubjectLogonId", queryType = "phrase", value = "{{winlog.event_data.SubjectLogonId}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Target logon records for the created session"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "event.code", queryType = "phrase", value = "4624", valueType = "string" },
{ excluded = false, field = "winlog.event_data.TargetLogonId", queryType = "phrase", value = "{{winlog.event_data.TargetLogonId}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Target logoff records for the created session"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "event.code", queryType = "phrase", value = "4634", valueType = "string" },
{ excluded = false, field = "winlog.event_data.TargetLogonId", queryType = "phrase", value = "{{winlog.event_data.TargetLogonId}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Events for the created target logon session"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "winlog.event_data.TargetLogonId", queryType = "phrase", value = "{{winlog.event_data.TargetLogonId}}", valueType = "string" }
],
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "winlog.logon.id", queryType = "phrase", value = "{{winlog.event_data.TargetLogonId}}", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the subject identity"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "winlog.event_data.SubjectUserSid", queryType = "phrase", value = "{{winlog.event_data.SubjectUserSid}}", valueType = "string" }
],
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "user.id", queryType = "phrase", value = "{{winlog.event_data.SubjectUserSid}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the target identity"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "winlog.event_data.TargetUserSid", queryType = "phrase", value = "{{winlog.event_data.TargetUserSid}}", valueType = "string" }
],
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "user.id", queryType = "phrase", value = "{{winlog.event_data.TargetUserSid}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1134"
name = "Access Token Manipulation"
reference = "https://attack.mitre.org/techniques/T1134/"
[[rule.threat.technique.subtechnique]]
id = "T1134.002"
name = "Create Process with Token"
reference = "https://attack.mitre.org/techniques/T1134/002/"
[[rule.threat.technique.subtechnique]]
id = "T1134.003"
name = "Make and Impersonate Token"
reference = "https://attack.mitre.org/techniques/T1134/003/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
Stages and Predicates
Stage 1: authentication
authentication where
host.os.type : "windows" and winlog.event_data.LogonProcessName : "Advapi*" and
winlog.logon.type == "Interactive" and winlog.event_data.SubjectUserSid : ("S-1-5-21*", "S-1-12-*") and
winlog.event_data.TargetUserSid : ("S-1-5-21*", "S-1-12-*") and process.executable : "C:\\*" and
not startswith~(winlog.event_data.SubjectUserSid, winlog.event_data.TargetUserSid) and
not process.executable :
("?:\\Windows\\System32\\winlogon.exe",
"?:\\Windows\\System32\\wininit.exe",
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe",
"?:\\Windows\\System32\\inetsrv\\w3wp.exe",
"?:\\Windows\\SysWOW64\\msiexec.exe")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.executable | wildcard |
| field:"Image" kind:wildcard value:"C:\*" |
winlog.event_data.LogonProcessName | wildcard |
| field:"LogonProcessName" kind:wildcard value:"Advapi*" |
winlog.event_data.SubjectUserSid | wildcard |
| field:"SubjectUserSid" kind:wildcard |
winlog.event_data.TargetUserSid | wildcard |
| field:"TargetUserSid" kind:wildcard |
winlog.logon.type | eq |
| field:"LogonType" kind:eq value:"Interactive" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\Windows\System32\winlogon.exe, ?:\Windows\System32\wininit.exe, ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\SysWOW64\inetsrv\w3wp.exe, ?:\Windows\System32\inetsrv\w3wp.exe, ?:\Windows\SysWOW64\msiexec.exe | excludes:process.executable |
winlog.event_data.SubjectUserSid | starts_with | winlog.event_data.TargetUserSid | excludes:winlog.event_data.SubjectUserSid field:"winlog.event_data.SubjectUserSid" value:"winlog.event_data.TargetUserSid" |
Kernel Module Removal
#Kernel modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. This rule identifies attempts to remove a kernel module.
Known False Positives
- There is usually no reason to remove modules, but some buggy modules require it. These can be exempted by username. Note that some Linux distributions are not built to support the removal of modules at all.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Defense Impairment |
Rule Body
[metadata]
creation_date = "2020/04/24"
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2025/12/18"
[rule]
author = ["Elastic"]
description = """
Kernel modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the
functionality of the kernel without the need to reboot the system. This rule identifies attempts to remove a kernel
module.
"""
false_positives = [
"""
There is usually no reason to remove modules, but some buggy modules require it. These can be exempted by username.
Note that some Linux distributions are not built to support the removal of modules at all.
""",
]
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process*",
"logs-sentinel_one_cloud_funnel.*",
]
language = "eql"
license = "Elastic License v2"
name = "Kernel Module Removal"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Kernel Module Removal
Kernel modules dynamically extend a Linux kernel's capabilities without rebooting. Adversaries may exploit this by removing modules to disable security features or hide malicious activities. The detection rule identifies suspicious module removal attempts by monitoring processes like `rmmod` or `modprobe` with removal arguments, especially when initiated by common shell environments, indicating potential defense evasion tactics.
### Possible investigation steps
- Review the process details to confirm the execution of `rmmod` or `modprobe` with removal arguments. Check the command line arguments to ensure they match the suspicious activity criteria.
- Identify the parent process of the suspicious activity, focusing on shell environments like `sudo`, `bash`, `dash`, `ash`, `sh`, `tcsh`, `csh`, `zsh`, `ksh`, or `fish`, to understand the context in which the module removal was initiated.
- Investigate the user account associated with the process to determine if the activity aligns with expected behavior or if it indicates potential unauthorized access.
- Check system logs and audit logs for any preceding or subsequent suspicious activities that might correlate with the module removal attempt, such as privilege escalation or other defense evasion tactics.
- Assess the impact of the module removal on system security features and functionality, and determine if any critical security modules were targeted.
- Review recent changes or updates to the system that might explain the module removal, such as legitimate maintenance or updates, to rule out false positives.
### False positive analysis
- Routine administrative tasks may trigger the rule when system administrators use `rmmod` or `modprobe` for legitimate maintenance. To handle this, create exceptions for specific user accounts or scripts known to perform these tasks regularly.
- Automated scripts or configuration management tools that manage kernel modules might cause false positives. Identify these tools and exclude their processes from the rule to prevent unnecessary alerts.
- Some Linux distributions or custom setups might use shell scripts that invoke `rmmod` or `modprobe` during system updates or package installations. Monitor these activities and whitelist the associated parent processes if they are verified as non-threatening.
- Development environments where kernel module testing is frequent can generate alerts. Exclude specific development machines or user accounts involved in module testing to reduce noise.
- Security tools that perform regular checks or updates on kernel modules might inadvertently trigger the rule. Verify these tools and add them to the exception list to avoid false positives.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further unauthorized access or potential lateral movement by the adversary.
- Terminate any suspicious processes identified as attempting to remove kernel modules, such as those initiated by `rmmod` or `modprobe` with removal arguments.
- Conduct a thorough review of user accounts and privileges on the affected system to ensure no unauthorized access or privilege escalation has occurred.
- Restore any disabled security features or kernel modules to their original state to ensure the system's defenses are intact.
- Analyze system logs and audit trails to identify any additional indicators of compromise or related malicious activities.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if the threat is part of a larger attack campaign.
- Implement enhanced monitoring and alerting for similar activities across the network to detect and respond to future attempts promptly."""
references = ["http://man7.org/linux/man-pages/man8/modprobe.8.html"]
risk_score = 21
rule_id = "cd66a5af-e34b-4bb0-8931-57d0a043f2ef"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Defense Evasion",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Crowdstrike",
"Data Source: SentinelOne",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
(
process.name == "rmmod" or
(process.name == "modprobe" and process.args in ("--remove", "-r"))
) and
process.parent.name in ("sudo", "bash", "dash", "ash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and
not (
?process.parent.args like "/var/tmp/rpm-tmp*" or
?process.working_directory like~ ("/tmp/makeself*NVIDIA-Linux*", "/tmp/self*NVIDIA-Linux*")
)
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[rule.threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[rule.threat.technique.subtechnique]]
id = "T1547.006"
name = "Kernel Modules and Extensions"
reference = "https://attack.mitre.org/techniques/T1547/006/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
Stages and Predicates
Stage 1: process
process where host.os.type == "linux" and event.type == "start" and
event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
(
process.name == "rmmod" or
(process.name == "modprobe" and process.args in ("--remove", "-r"))
) and
process.parent.name in ("sudo", "bash", "dash", "ash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and
not (
?process.parent.args like "/var/tmp/rpm-tmp*" or
?process.working_directory like~ ("/tmp/makeself*NVIDIA-Linux*", "/tmp/self*NVIDIA-Linux*")
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | in |
| field:"process.args" kind:in |
process.name | eq |
| field:"process_basename" kind:eq |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.args | starts_with | /var/tmp/rpm-tmp | excludes:process.parent.args field:"process.parent.args" value:"/var/tmp/rpm-tmp" |
process.working_directory | wildcard | /tmp/makeself*NVIDIA-Linux*, /tmp/self*NVIDIA-Linux* | excludes:process.working_directory field:"process.working_directory" value:"/tmp/makeself*NVIDIA-Linux*" field:"process.working_directory" value:"/tmp/self*NVIDIA-Linux*" |
LSA Dump via SilentProcessExit
#Identifies the modification of the Image File Execution Options SilentProcessExit key that can be abused to dump LSASS memory via the Windows Error Reporting WerFault.exe. Adversaries may use this technique for credential access.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Rule Body
[rule]
description = """
Identifies the modification of the Image File Execution Options SilentProcessExit key that can be abused to dump LSASS
memory via the Windows Error Reporting WerFault.exe. Adversaries may use this technique for credential access.
"""
id = "28969fe6-0ebe-4442-b40c-dbe9b4234f5e"
license = "Elastic License v2"
name = "LSA Dump via SilentProcessExit"
os_list = ["windows"]
reference = [
"https://www.deepinstinct.com/2021/02/16/lsass-memory-dumps-are-stealthier-than-ever-before-part-2/",
]
version = "1.0.32"
query = '''
registry where registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SilentProcessExit\\lsass*"
'''
min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1003"
name = "OS Credential Dumping"
reference = "https://attack.mitre.org/techniques/T1003/"
[[threat.technique.subtechnique]]
id = "T1003.001"
name = "LSASS Memory"
reference = "https://attack.mitre.org/techniques/T1003/001/"
[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: registry
registry where registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SilentProcessExit\\lsass*"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
registry.path | wildcard |
| field:"TargetObject" kind:wildcard value:"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SilentProcessExit\lsass*" |
Mach-O File with Unusual Extension
#Identifies the creation or modification of an Mach-O file with an unexpected file extension. Attackers may attempt to evade detection by masquerading files using the file extension values used by image, audio, or document file types.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Telemetry Coverage
Rule Body
[rule]
description = """
Identifies the creation or modification of an Mach-O file with an unexpected file extension. Attackers may attempt to
evade detection by masquerading files using the file extension values used by image, audio, or document file types.
"""
id = "9c5c3957-f8cb-4225-ad07-e5a6325eafb2"
license = "Elastic License v2"
name = "Mach-O File with Unusual Extension"
os_list = ["macos"]
version = "1.0.15"
query = '''
file where event.action in ("modification", "rename", "open") and
file.Ext.header_bytes like~ ("cffaedfe*", "cafebabe*") and
(
/* common image file extensions */
file.extension in ("jpg", "jpeg", "emf", "tiff", "gif", "png", "bmp", "fpx", "eps", "svg", "inf") or
/* common audio and video file extensions */
file.extension in ("mp3", "wav", "avi", "mpeg", "flv", "wma", "wmv", "mov", "mp4", "3gp") or
/* common document file extensions */
file.extension in ("txt", "pdf", "doc", "docx", "rtf", "ppt", "pptx", "xls", "xlsx", "hwp", "html") or
/* common log, txt and temporary file extensions */
file.extension in ("log", "conf", "txt", "nib", "ts")
) and
not (process.executable in ("/bin/cp", "/bin/bash") and file.path == "/Library/PrivilegedHelperTools/us.zoom.ZoomDaemon.tmp") and
not (file.path like~ ("/Users/*/Library/Caches/*", "/private/var/folders/*", "/Library/Application Support/CrashPlan/conf/tmp/*") and file.name : "jna*.tmp") and
not (process.name in ("javaapplicationstub", "jspawnhelper", "java") and file.name like~ "jna*.tmp") and
not Effective_process.executable == "/Applications/Cisco Secure Endpoint/Secure Endpoint Service.app/Contents/MacOS/ampdaemon"
'''
min_endpoint_version = "8.10.2"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.2"
Stages and Predicates
Stage 1: file
file where event.action in ("modification", "rename", "open") and
file.Ext.header_bytes like~ ("cffaedfe*", "cafebabe*") and
(
file.extension in ("jpg", "jpeg", "emf", "tiff", "gif", "png", "bmp", "fpx", "eps", "svg", "inf") or
file.extension in ("mp3", "wav", "avi", "mpeg", "flv", "wma", "wmv", "mov", "mp4", "3gp") or
file.extension in ("txt", "pdf", "doc", "docx", "rtf", "ppt", "pptx", "xls", "xlsx", "hwp", "html") or
file.extension in ("log", "conf", "txt", "nib", "ts")
) and
not (process.executable in ("/bin/cp", "/bin/bash") and file.path == "/Library/PrivilegedHelperTools/us.zoom.ZoomDaemon.tmp") and
not (file.path like~ ("/Users/*/Library/Caches/*", "/private/var/folders/*", "/Library/Application Support/CrashPlan/conf/tmp/*") and file.name : "jna*.tmp") and
not (process.name in ("javaapplicationstub", "jspawnhelper", "java") and file.name like~ "jna*.tmp") and
not Effective_process.executable == "/Applications/Cisco Secure Endpoint/Secure Endpoint Service.app/Contents/MacOS/ampdaemon"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | in |
| field:"EventType" kind:in |
file.Ext.header_bytes | wildcard |
| field:"file.Ext.header_bytes" kind:wildcard |
file.extension | in |
| field:"file.extension" kind:in |
Exclusions
The rule actively suppresses these predicates.
Multiple Machine Learning Alerts by Influencer Field
#This rule uses alerts data to determine when multiple unique machine learning jobs involving the same influencer field are triggered. Analysts can use this to prioritize triage and response machine learning alerts.
Rule Body
[metadata]
creation_date = "2026/02/02"
maturity = "production"
updated_date = "2026/02/16"
[rule]
author = ["Elastic"]
description = """
This rule uses alerts data to determine when multiple unique machine learning jobs involving the same influencer field are triggered.
Analysts can use this to prioritize triage and response machine learning alerts.
"""
from = "now-45m"
interval = "30m"
language = "esql"
license = "Elastic License v2"
name = "Multiple Machine Learning Alerts by Influencer Field"
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 73
rule_id = "da7f7a93-26e1-49ce-b336-963c6dc17c7b"
severity = "high"
tags = ["Use Case: Threat Detection", "Rule Type: Higher-Order Rule", "Resources: Investigation Guide", "Rule Type: Machine Learning"]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from .alerts-security.*
| where kibana.alert.rule.type == "machine_learning" and
not KQL("""kibana.alert.rule.tags : "Rule Type: Higher-Order Rule" """)
| stats Esql.count_distinct_job_id = COUNT_DISTINCT(job_id),
Esql.job_id_values = VALUES(job_id),
Esql.rule_name_values = VALUES(kibana.alert.rule.name),
Esql.influencer_field_values = VALUES(influencers.influencer_field_values),
Esql.influencer_field_name = VALUES(influencers.influencer_field_name) by influencers.influencer_field_values, process.name, host.name
| where Esql.count_distinct_job_id >= 3 and not influencers.influencer_field_values in ("root", "SYSTEM")
| KEEP influencers.influencer_field_values, process.name, host.name, Esql.*
'''
note = """## Triage and analysis
### Multiple Machine Learning Alerts by Influencer Field
Attackers may trigger multiple alerts by performing suspicious actions under a compromised user entity. The detection rule identifies such patterns by correlating diverse machine learning alerts linked to the same entity, excluding known system accounts, thus prioritizing potential threats for analysts.
### Possible investigation steps
- Review the alert details to identify the specific influencer field involved to gather initial context.
- Examine the timeline and sequence of the triggered alerts to understand the pattern of activity associated with the influencer field, noting any unusual or unexpected actions.
- Cross-reference the user activity with known legitimate activities or scheduled tasks to rule out false positives, ensuring that the actions are not part of normal operations.
- Investigate the source and destination IP addresses associated with the alerts to identify any suspicious or unauthorized access points.
- Check for any recent changes in user permissions or group memberships that could indicate privilege escalation attempts.
- Look into any recent login attempts or authentication failures for the user account to detect potential brute force or credential stuffing attacks.
- Collaborate with the user or their manager to verify if the activities were authorized or if the account might be compromised.
### False positive analysis
- Alerts triggered by automated system processes or scripts that mimic user behavior can be false positives. To manage these, identify and exclude known benign scripts or processes from the rule.
- Frequent alerts from users in roles that inherently require access to multiple systems or sensitive data, such as IT administrators, may not indicate compromise. Implement role-based exceptions to reduce noise.
- Alerts generated by legitimate software updates or maintenance activities can be mistaken for suspicious behavior. Schedule these activities during known maintenance windows and exclude them from the rule during these times.
- Users involved in testing or development environments may trigger multiple alerts due to their work nature. Create exceptions for these environments to prevent unnecessary alerts.
- High-volume users, such as those in customer support or sales, may naturally generate more alerts. Monitor these users separately and adjust the rule to focus on unusual patterns rather than volume alone.
### Response and remediation
- Isolate the affected user account immediately to prevent further unauthorized access. Disable the account or change the password to stop any ongoing malicious activity.
- Conduct a thorough review of the affected user's recent activities and access logs to identify any unauthorized actions or data access. This will help in understanding the scope of the compromise.
- Remove any malicious software or unauthorized tools that may have been installed on the user's system. Use endpoint detection and response (EDR) tools to scan and clean the system.
- Restore any altered or deleted data from backups, ensuring that the restored data is free from any malicious modifications.
- Notify relevant stakeholders, including IT security teams and management, about the incident and the steps being taken to address it. This ensures that everyone is aware and can provide support if needed.
- Implement additional monitoring on the affected user account and related systems to detect any further suspicious activities. This includes setting up alerts for unusual login attempts or data access patterns.
- Review and update access controls and permissions for the affected user and similar accounts to prevent future incidents. Ensure that least privilege principles are applied."""
Stages and Predicates
Stage 1: from
from .alerts-security.*
Stage 2: where
| where kibana.alert.rule.type == "machine_learning" and
not KQL("""kibana.alert.rule.tags : "Rule Type: Higher-Order Rule" """)
Stage 3: stats
| stats Esql.count_distinct_job_id = COUNT_DISTINCT(job_id),
Esql.job_id_values = VALUES(job_id),
Esql.rule_name_values = VALUES(kibana.alert.rule.name),
Esql.influencer_field_values = VALUES(influencers.influencer_field_values),
Esql.influencer_field_name = VALUES(influencers.influencer_field_name) by influencers.influencer_field_values, process.name, host.name
Stage 4: where
| where Esql.count_distinct_job_id >= 3 and not influencers.influencer_field_values in ("root", "SYSTEM")
Stage 5: keep
| KEEP influencers.influencer_field_values, process.name, host.name, Esql.*
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
Esql.count_distinct_job_id | ge |
| field:"Esql.count_distinct_job_id" kind:ge value:"3" |
kibana.alert.rule.type | eq |
| field:"kibana.alert.rule.type" kind:eq value:"machine_learning" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
kibana.alert.rule.tags | eq | Rule Type: Higher-Order Rule | excludes:kibana.alert.rule.tags field:"kibana.alert.rule.tags" value:"Rule Type: Higher-Order Rule" |
influencers.influencer_field_values | in | SYSTEM, root | excludes:influencers.influencer_field_values field:"influencers.influencer_field_values" value:"SYSTEM" field:"influencers.influencer_field_values" value:"root" |
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
influencers.influencer_field_values | KEEP influencers.influencer_field_values |
process.name | KEEP process.name |
host.name | KEEP host.name |
Esql.* | KEEP Esql.* |
Peripheral Device Discovery
#Identifies use of the Windows file system utility (fsutil.exe) to gather information about attached peripheral devices and components connected to a computer system.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2020/11/02"
integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"
[rule]
author = ["Elastic"]
description = """
Identifies use of the Windows file system utility (fsutil.exe) to gather information about attached peripheral devices
and components connected to a computer system.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-system.security*",
"logs-windows.forwarded*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Peripheral Device Discovery"
note = """## Triage and analysis
### Investigating Peripheral Device Discovery
After successfully compromising an environment, attackers may try to gain situational awareness to plan their next steps. This can happen by running commands to enumerate network resources, users, connections, files, and installed security software.
This rule looks for the execution of the `fsutil` utility with the `fsinfo` subcommand to enumerate drives attached to the computer, which can be used to identify secondary drives used for backups, mapped network drives, and removable media. These devices can contain valuable information for attackers.
#### Possible investigation steps
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Investigate any abnormal account behavior, such as command executions, file creations or modifications, and network connections.
- Determine whether this activity was followed by suspicious file access/copy operations or uploads to file storage services.
### False positive analysis
- Discovery activities are not inherently malicious if they occur in isolation. As long as the analyst did not identify suspicious activity related to the user or host, such alerts can be dismissed.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved hosts to prevent further post-compromise behavior.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""
risk_score = 21
rule_id = "0c7ca5c2-728d-4ad9-b1c5-bbba83ecb1f4"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Discovery",
"Resources: Investigation Guide",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: Windows Security Event Logs",
"Data Source: Microsoft Defender XDR",
"Data Source: Sysmon",
"Data Source: SentinelOne",
"Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
(process.name : "fsutil.exe" or ?process.pe.original_file_name == "fsutil.exe") and
process.args : "fsinfo" and process.args : "drives"
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1120"
name = "Peripheral Device Discovery"
reference = "https://attack.mitre.org/techniques/T1120/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
(process.name : "fsutil.exe" or ?process.pe.original_file_name == "fsutil.exe") and
process.args : "fsinfo" and process.args : "drives"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"fsutil.exe" |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq value:"fsutil.exe" |
Persistence via Login or Logout Hook
#Identifies use of the Defaults command to install a login or logoff hook in MacOS. An adversary may abuse this capability to establish persistence in an environment by inserting code to be executed at login or logout.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rule Body
[metadata]
creation_date = "2020/12/07"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
Identifies use of the Defaults command to install a login or logoff hook in MacOS. An adversary may abuse this
capability to establish persistence in an environment by inserting code to be executed at login or logout.
"""
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Persistence via Login or Logout Hook"
references = [
"https://www.virusbulletin.com/uploads/pdf/conference_slides/2014/Wardle-VB2014.pdf",
"https://www.manpagez.com/man/1/defaults/",
]
risk_score = 47
rule_id = "5d0265bf-dea9-41a9-92ad-48a8dcd05080"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Persistence",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "macos" and event.type == "start" and
process.name == "defaults" and process.args == "write" and process.args : ("LoginHook", "LogoutHook") and
not process.args :
(
"Support/JAMF/ManagementFrameworkScripts/logouthook.sh",
"Support/JAMF/ManagementFrameworkScripts/loginhook.sh",
"/Library/Application Support/JAMF/ManagementFrameworkScripts/logouthook.sh",
"/Library/Application Support/JAMF/ManagementFrameworkScripts/loginhook.sh"
)
'''
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Persistence via Login or Logout Hook
In macOS environments, login and logout hooks are scripts executed automatically during user login or logout, often used for system management tasks. Adversaries exploit this by inserting malicious scripts to maintain persistence. The detection rule identifies suspicious use of the `defaults` command to set these hooks, excluding known legitimate scripts, thus highlighting potential unauthorized persistence attempts.
### Possible investigation steps
- Review the process execution details to confirm the use of the "defaults" command with "write" arguments targeting "LoginHook" or "LogoutHook".
- Check the process execution history for the user account associated with the alert to identify any unusual or unauthorized activity.
- Investigate the source and content of the script specified in the "defaults" command to determine if it contains malicious or unauthorized code.
- Cross-reference the script path against known legitimate scripts to ensure it is not mistakenly flagged.
- Analyze recent system changes or installations that might have introduced the suspicious script or process.
- Review system logs around the time of the alert for any additional indicators of compromise or related suspicious activity.
### False positive analysis
- Known false positives include legitimate scripts used by system management tools like JAMF, which are often set as login or logout hooks.
- To handle these, users can create exceptions for known legitimate scripts by adding their paths to the exclusion list in the detection rule.
- Regularly review and update the exclusion list to ensure it includes all authorized scripts used in your environment.
- Monitor for any changes in the behavior of these scripts to ensure they remain non-threatening and authorized.
- Collaborate with IT and security teams to identify any new legitimate scripts that should be excluded from detection.
### Response and remediation
- Immediately isolate the affected macOS system from the network to prevent potential lateral movement or data exfiltration by the adversary.
- Terminate any suspicious processes associated with the unauthorized login or logout hooks to halt any ongoing malicious activity.
- Remove the unauthorized login or logout hooks by using the `defaults delete` command to ensure the persistence mechanism is dismantled.
- Conduct a thorough review of system logs and recent changes to identify any additional unauthorized modifications or indicators of compromise.
- Restore any affected system files or configurations from a known good backup to ensure system integrity and functionality.
- Escalate the incident to the security operations team for further analysis and to determine if additional systems are affected.
- Implement enhanced monitoring and alerting for similar unauthorized use of the `defaults` command to improve detection and response capabilities."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1037"
name = "Boot or Logon Initialization Scripts"
reference = "https://attack.mitre.org/techniques/T1037/"
[[rule.threat.technique.subtechnique]]
id = "T1037.002"
name = "Login Hook"
reference = "https://attack.mitre.org/techniques/T1037/002/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
Stages and Predicates
Stage 1: process
process where host.os.type == "macos" and event.type == "start" and
process.name == "defaults" and process.args == "write" and process.args : ("LoginHook", "LogoutHook") and
not process.args :
(
"Support/JAMF/ManagementFrameworkScripts/logouthook.sh",
"Support/JAMF/ManagementFrameworkScripts/loginhook.sh",
"/Library/Application Support/JAMF/ManagementFrameworkScripts/logouthook.sh",
"/Library/Application Support/JAMF/ManagementFrameworkScripts/loginhook.sh"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"write" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.name | eq |
| field:"process_basename" kind:eq value:"defaults" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | Support/JAMF/ManagementFrameworkScripts/logouthook.sh, Support/JAMF/ManagementFrameworkScripts/loginhook.sh, /Library/Application Support/JAMF/ManagementFrameworkScripts/logouthook.sh, /Library/Application Support/JAMF/ManagementFrameworkScripts/loginhook.sh | excludes:process.args |
Potential Backdoor Execution Through PAM_EXEC
#This rule detects SSH session ID change followed by a suspicious SSHD child process, this may indicate the successful execution of a potentially malicious process through the Pluggable Authentication Module (PAM) utility. PAM is a framework used by Linux systems to authenticate users. Adversaries may create malicious PAM modules that grant them persistence onto the target every time a user logs in by executing a backdoor script or command.
Known False Positives
- Trusted system module updates or allowed Pluggable Authentication Module (PAM) daemon configuration changes.
MITRE ATT&CK Coverage
Rule Body
[metadata]
creation_date = "2025/04/29"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"
[rule]
author = ["Elastic"]
description = """
This rule detects SSH session ID change followed by a suspicious SSHD child process, this may
indicate the successful execution of a potentially malicious process through the Pluggable
Authentication Module (PAM) utility. PAM is a framework used by Linux systems to authenticate
users. Adversaries may create malicious PAM modules that grant them persistence onto the
target every time a user logs in by executing a backdoor script or command.
"""
false_positives = [
"Trusted system module updates or allowed Pluggable Authentication Module (PAM) daemon configuration changes.",
]
from = "now-9m"
index = ["logs-endpoint.events.process*"]
language = "eql"
license = "Elastic License v2"
name = "Potential Backdoor Execution Through PAM_EXEC"
note = """ ## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Potential Backdoor Execution Through PAM_EXEC
PAM (Pluggable Authentication Module) is a critical framework in Linux systems for user authentication. Adversaries may exploit PAM by inserting malicious modules that execute backdoor scripts during user logins, ensuring persistent access. The detection rule identifies this threat by monitoring SSH session changes followed by unusual child processes, often indicative of backdoor execution, especially when these processes originate from suspicious directories or use scripting languages.
### Possible investigation steps
- Review the process entity ID associated with the alert to identify the specific SSH session and its related activities.
- Examine the parent process details, specifically focusing on the SSH or SSHD process, to determine the source and legitimacy of the login attempt.
- Investigate the child process that was started, paying close attention to its name and executable path, especially if it matches patterns like scripting languages (e.g., perl, python) or suspicious directories (e.g., /tmp, /var/tmp).
- Check the process arguments count and content to understand the command or script being executed, which may provide insights into the potential backdoor's functionality.
- Correlate the event timestamp with user login records and system logs to identify any unusual login patterns or unauthorized access attempts.
- Assess the risk and impact by determining if the process has made any unauthorized changes to the system or if it has established any persistent mechanisms.
- If a backdoor is confirmed, initiate containment measures such as terminating the malicious process, removing the unauthorized PAM module, and conducting a full system audit to prevent further exploitation.
### False positive analysis
- Legitimate administrative scripts executed via SSH may trigger the rule if they use scripting languages like Perl, Python, or PHP. To handle this, identify and whitelist known administrative scripts and their execution paths.
- Automated backup or maintenance processes that run from directories like /var/backups or /var/log can be mistaken for malicious activity. Exclude these processes by specifying their exact paths and names in the exception list.
- Development or testing environments where scripts are frequently executed from temporary directories such as /tmp or /dev/shm may cause false positives. Implement exceptions for these environments by defining specific user accounts or process names that are known to be safe.
- Custom monitoring or logging tools that spawn child processes from SSH sessions might be flagged. Review these tools and add them to the exclusion list if they are verified as non-threatening.
- Regular user activities involving the use of scripting languages for legitimate purposes can be misinterpreted. Educate users on best practices and adjust the rule to exclude common benign scripts used in daily operations.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
- Terminate any suspicious processes identified by the detection rule, especially those originating from unusual directories or using scripting languages.
- Conduct a thorough review of PAM configuration files and modules to identify and remove any unauthorized or malicious entries.
- Reset credentials for all users on the affected system, prioritizing those with elevated privileges, to mitigate potential credential compromise.
- Restore the system from a known good backup if malicious modifications are confirmed, ensuring that the backup is free from tampering.
- Implement enhanced monitoring on the affected system and similar environments to detect any recurrence of the threat, focusing on SSH session changes and unusual child processes.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to assess the potential impact on other systems within the network.
"""
references = [
"https://www.elastic.co/security-labs/approaching-the-summit-on-persistence",
"https://www.group-ib.com/blog/pluggable-authentication-module/",
]
risk_score = 47
rule_id = "96f29282-ffcc-4ce7-834b-b17aee905568"
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Tactic: Persistence",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by process.entity_id with maxspan=3s
[process where host.os.type == "linux" and event.type == "change" and event.action == "session_id_change" and process.name in ("ssh", "sshd")]
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.parent.name in ("ssh", "sshd") and
process.args_count == 2 and process.args like (
"sh", "dash", "bash", "zsh",
"perl*", "python*", "php*", "ruby*", "lua*",
"/bin/sh", "/bin/dash", "/bin/bash", "/bin/zsh",
"/bin/perl*", "/bin/python*", "/bin/php*", "/bin/ruby*", "/bin/lua*",
"/usr/bin/sh", "/usr/bin/dash", "/usr/bin/bash", "/usr/bin/zsh",
"/usr/bin/perl*", "/usr/bin/python*", "/usr/bin/php*", "/usr/bin/ruby*", "/usr/bin/lua*",
"/usr/local/bin/sh", "/usr/local/bin/dash", "/usr/local/bin/bash", "/usr/local/bin/zsh",
"/usr/local/bin/perl*", "/usr/local/bin/python*", "/usr/local/bin/php*", "/usr/local/bin/ruby*", "/usr/local/bin/lua*"
) and (
process.name like ".*" or
process.executable like (
"/tmp/*", "/var/tmp/*", "/dev/shm/*", "./*", "/boot/*", "/sys/*", "/lost+found/*", "/media/*", "/proc/*", "/bin/*", "/usr/bin/*",
"/sbin/*", "/usr/sbin/*", "/lib/*", "/lib64/*", "/usr/lib/*", "/usr/lib64/*", "/opt/*", "/var/lib/*", "/run/*", "/var/backups/*",
"/var/log/*", "/var/mail/*", "/var/spool/*"
)
)
]
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[[rule.threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"
[[rule.threat.technique.subtechnique]]
id = "T1556.003"
name = "Pluggable Authentication Modules"
reference = "https://attack.mitre.org/techniques/T1556/003/"
[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1556"
name = "Modify Authentication Process"
reference = "https://attack.mitre.org/techniques/T1556/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
Stages and Predicates
Ordered sequence: each step below must occur in order within 3s, correlated by process.entity_id.
Stage 1: process
[process where host.os.type == "linux" and event.type == "change" and event.action == "session_id_change" and process.name in ("ssh", "sshd")]
Stage 2: process
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.parent.name in ("ssh", "sshd") and
process.args_count == 2 and process.args like (
"sh", "dash", "bash", "zsh",
"perl*", "python*", "php*", "ruby*", "lua*",
"/bin/sh", "/bin/dash", "/bin/bash", "/bin/zsh",
"/bin/perl*", "/bin/python*", "/bin/php*", "/bin/ruby*", "/bin/lua*",
"/usr/bin/sh", "/usr/bin/dash", "/usr/bin/bash", "/usr/bin/zsh",
"/usr/bin/perl*", "/usr/bin/python*", "/usr/bin/php*", "/usr/bin/ruby*", "/usr/bin/lua*",
"/usr/local/bin/sh", "/usr/local/bin/dash", "/usr/local/bin/bash", "/usr/local/bin/zsh",
"/usr/local/bin/perl*", "/usr/local/bin/python*", "/usr/local/bin/php*", "/usr/local/bin/ruby*", "/usr/local/bin/lua*"
) and (
process.name like ".*" or
process.executable like (
"/tmp/*", "/var/tmp/*", "/dev/shm/*", "./*", "/boot/*", "/sys/*", "/lost+found/*", "/media/*", "/proc/*", "/bin/*", "/usr/bin/*",
"/sbin/*", "/usr/sbin/*", "/lib/*", "/lib64/*", "/usr/lib/*", "/usr/lib64/*", "/opt/*", "/var/lib/*", "/run/*", "/var/backups/*",
"/var/log/*", "/var/mail/*", "/var/spool/*"
)
)
]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.type | eq |
| field:"event.type" kind:eq |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.args_count | eq |
| field:"process.args_count" kind:eq value:"2" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.name | in |
| field:"process_basename" kind:in |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:".*" |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
Potential CVE-2024-21338 Exploitation
#Identifies unsigned code calling a vulnerable IOCTL in the appid.sys AppLocker driver. Adversaries may exploit this vulnerability to execute code in kernel mode and tamper with security solutions.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | |
| Defense Impairment |
Rule Body
[rule]
description = """
Identifies unsigned code calling a vulnerable IOCTL in the appid.sys AppLocker driver. Adversaries may exploit this
vulnerability to execute code in kernel mode and tamper with security solutions.
"""
id = "87cf026c-b242-4fbb-9343-1bdc62136586"
license = "Elastic License v2"
name = "Potential CVE-2024-21338 Exploitation"
os_list = ["windows"]
reference = [
"https://decoded.avast.io/janvojtesek/lazarus-and-the-fudmodule-rootkit-beyond-byovd-with-an-admin-to-kernel-zero-day/",
]
version = "1.0.8"
query = '''
api where
process.Ext.api.name == "DeviceIoControl" and user.id != "S-1-5-18" and
(process.Ext.api.parameters.device : "\\Device\\AppId" or
(user.id : "S-1-5-19" and process.Ext.api.parameters.device == "Unknown")) and
/* IOCTL 0x22A018 & 0x22A014 */
(process.Ext.api.parameters.io_control_code == 2269208 or process.Ext.api.parameters.io_control_code == 2269204) and
/* exclude expected callers */
not (process.name == "svchost.exe" and
(process.thread.Ext.call_stack_final_user_module.protection_provenance == "appidsvc.dll" or
process.thread.Ext.call_stack_final_user_module.name == "appidsvc.dll" or
process.thread.Ext.call_stack_final_user_module.path like "c:\\windows\\system32\\esent.dll") and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $caller, $caller.trusted == true)) and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != "20fae5e8376514a6e500af5a84d08f0f6c58b3302f5c8da48aa74e815a0e78de" and
not process.thread.Ext.call_stack_final_user_module.path like ("c:\\windows\\system32\\mpssvc.dll", "c:\\windows\\system32\\wevtsvc.dll", "c:\\windows\\assembly\\nativeimages_*\\mscorlib.ni.dll") and
not (process.executable : "C:\\Program Files\\Windows Defender Advanced Threat Protection\\Classification\\SenseCE.exe" and
process.parent.executable : "C:\\Program Files\\Windows Defender Advanced Threat Protection\\MsSense.exe") and
not (process.executable : "C:\\Windows\\System32\\WUDFHost.exe" and process.parent.executable : "C:\\Windows\\System32\\services.exe" and
process.thread.Ext.call_stack_final_user_module.name == "ipf_umdf2.dll") and
not (process.executable : "C:\\Windows\\System32\\svchost.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\cdp.dll")
'''
min_endpoint_version = "8.14.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.14.0"
Stages and Predicates
Stage 1: api
api where
process.Ext.api.name == "DeviceIoControl" and user.id != "S-1-5-18" and
(process.Ext.api.parameters.device : "\\Device\\AppId" or
(user.id : "S-1-5-19" and process.Ext.api.parameters.device == "Unknown")) and
(process.Ext.api.parameters.io_control_code == 2269208 or process.Ext.api.parameters.io_control_code == 2269204) and
not (process.name == "svchost.exe" and
(process.thread.Ext.call_stack_final_user_module.protection_provenance == "appidsvc.dll" or
process.thread.Ext.call_stack_final_user_module.name == "appidsvc.dll" or
process.thread.Ext.call_stack_final_user_module.path like "c:\\windows\\system32\\esent.dll") and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $caller, $caller.trusted == true)) and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != "20fae5e8376514a6e500af5a84d08f0f6c58b3302f5c8da48aa74e815a0e78de" and
not process.thread.Ext.call_stack_final_user_module.path like ("c:\\windows\\system32\\mpssvc.dll", "c:\\windows\\system32\\wevtsvc.dll", "c:\\windows\\assembly\\nativeimages_*\\mscorlib.ni.dll") and
not (process.executable : "C:\\Program Files\\Windows Defender Advanced Threat Protection\\Classification\\SenseCE.exe" and
process.parent.executable : "C:\\Program Files\\Windows Defender Advanced Threat Protection\\MsSense.exe") and
not (process.executable : "C:\\Windows\\System32\\WUDFHost.exe" and process.parent.executable : "C:\\Windows\\System32\\services.exe" and
process.thread.Ext.call_stack_final_user_module.name == "ipf_umdf2.dll") and
not (process.executable : "C:\\Windows\\System32\\svchost.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\cdp.dll")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.name | eq |
| field:"process.Ext.api.name" kind:eq value:"DeviceIoControl" |
process.Ext.api.parameters.device | eq |
| field:"process.Ext.api.parameters.device" kind:eq value:"Unknown" |
process.Ext.api.parameters.device | wildcard |
| field:"process.Ext.api.parameters.device" kind:wildcard value:"\Device\AppId" |
process.Ext.api.parameters.io_control_code | eq |
| field:"process.Ext.api.parameters.io_control_code" kind:eq |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | ne |
| field:"process.thread.Ext.call_stack_final_user_module.hash.sha256" kind:ne value:"20fae5e8376514a6e500af5a84d08f0f6c58b3302f5c8da48aa74e815a0e78de" |
user.id | ne |
| field:"user.id" kind:ne value:"S-1-5-18" |
user.id | wildcard |
| field:"user.id" kind:wildcard value:"S-1-5-19" |
Exclusions
The rule actively suppresses these predicates.
Potential Execution via Clickfix Phishing
#Identifies the execution of Windows commands or downloaded files via the browser's dialog box. Adversaries may use phishing to instruct the victim to copy and paste malicious commands for execution via crafted phsihing web pages.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution |
Rule Body
[rule]
description = """
Identifies the execution of Windows commands or downloaded files via the browser's dialog box. Adversaries may use
phishing to instruct the victim to copy and paste malicious commands for execution via crafted phsihing web pages.
"""
id = "7bcc28b7-d1ce-4586-bc46-63ca31156d7a"
license = "Elastic License v2"
name = "Potential Execution via Clickfix Phishing"
os_list = ["windows"]
reference = ["https://mrd0x.com/filefix-clickfix-alternative/"]
version = "1.0.3"
query = '''
process where event.action == "start" and
process.parent.args == "--message-loop-type-ui" and process.parent.args == "--service-sandbox-type=none" and
(
process.name : ("pwsh.exe", "powershell.exe", "curl.exe", "msiexec.exe", "mshta.exe", "wscript.exe", "cscript.exe", "rundll32.exe", "certutil.exe", "certreq.exe") or
process.executable : "?:\\Users\\*\\Downloads\\*"
) and
process.parent.thread.Ext.call_stack_summary like "ntdll.dll|*|windows.storage.dll|shell32.dll|shcore.dll|kernel32.dll|ntdll.dll" and
not (process.name : "rundll32.exe" and process.args : ("ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile", "shwebsvc.dll,AddNetPlaceRunDll"))
'''
min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
tree = true
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"
[[threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"
[[threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
process.parent.args == "--message-loop-type-ui" and process.parent.args == "--service-sandbox-type=none" and
(
process.name : ("pwsh.exe", "powershell.exe", "curl.exe", "msiexec.exe", "mshta.exe", "wscript.exe", "cscript.exe", "rundll32.exe", "certutil.exe", "certreq.exe") or
process.executable : "?:\\Users\\*\\Downloads\\*"
) and
process.parent.thread.Ext.call_stack_summary like "ntdll.dll|*|windows.storage.dll|shell32.dll|shcore.dll|kernel32.dll|ntdll.dll" and
not (process.name : "rundll32.exe" and process.args : ("ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile", "shwebsvc.dll,AddNetPlaceRunDll"))
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.executable | wildcard |
| field:"Image" kind:wildcard value:"?:\Users\*\Downloads\*" |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.args | eq |
| field:"process.parent.args" kind:eq |
process.parent.thread.Ext.call_stack_summary | wildcard |
| field:"process.parent.thread.Ext.call_stack_summary" kind:wildcard value:"ntdll.dll|*|windows.storage.dll|shell32.dll|shcore.dll|kernel32.dll|ntdll.dll" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile, shwebsvc.dll,AddNetPlaceRunDll | excludes:process.args field:"process.args" value:"ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile" field:"process.args" value:"shwebsvc.dll,AddNetPlaceRunDll" |
process.name | eq | rundll32.exe | excludes:process.name field:"process.name" value:"rundll32.exe" |
Potential macOS SSH Brute Force Detected
#Identifies a high number of inbound SSH login attempts on a macOS host within a short time window. On macOS, each inbound SSH authentication attempt spawns the sshd-keygen-wrapper process once, whether the login succeeds or fails. Adversaries may perform password brute force or password spraying against exposed SSH services to obtain unauthorized access.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Credential Access |
Rule Body
[metadata]
creation_date = "2020/11/16"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/05/18"
[rule]
author = ["Elastic"]
description = """
Identifies a high number of inbound SSH login attempts on a macOS host within a short time window. On macOS, each
inbound SSH authentication attempt spawns the sshd-keygen-wrapper process once, whether the login succeeds or fails.
Adversaries may perform password brute force or password spraying against exposed SSH services to obtain unauthorized
access.
"""
from = "now-9m"
index = ["logs-endpoint.events.*"]
language = "kuery"
license = "Elastic License v2"
name = "Potential macOS SSH Brute Force Detected"
references = ["https://themittenmac.com/detecting-ssh-activity-via-process-monitoring/"]
risk_score = 47
rule_id = "ace1e989-a541-44df-93a8-a8b0591b63c0"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: macOS",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Data Source: Elastic Defend",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "threshold"
query = '''
event.category:process and host.os.type:macos and event.type:start and process.name:"sshd-keygen-wrapper" and process.parent.name:launchd
'''
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Potential macOS SSH Brute Force Detected
SSH (Secure Shell) is a protocol used to securely access remote systems. On macOS, each inbound SSH authentication attempt spawns
`sshd-keygen-wrapper` once before handing off to `sshd`, regardless of whether the login succeeds or fails. This rule uses that
1:1 relationship as a proxy for high inbound SSH login attempt volume on a host. It does not detect SSH key generation or
key-based brute force activity.
### Possible investigation steps
- Review alert details for `host.os.type:macos`, `process.name:sshd-keygen-wrapper`, and `process.parent.name:launchd`.
- Examine the frequency and timing of `sshd-keygen-wrapper` process starts to determine if they suggest automated login attempts.
- Review SSH authentication logs on the affected host for failed and successful logins, source IP addresses, and targeted usernames.
- Determine whether Remote Login is expected to be enabled on this host (for example, build servers or developer workstations).
- Correlate the activity with other alerts or logs from the same host to identify additional indicators of compromise.
- Review user account activity on the host to determine if any accounts were accessed or modified unexpectedly.
### False positive analysis
- Build servers, developer workstations, or CI/CD pipelines that receive many legitimate inbound SSH connections may trigger this rule. Exclude known hosts or maintenance windows if the activity is expected.
- Automated deployment or configuration management tools that open many SSH sessions in a short period can cause false positives.
- Internet-facing SSH services may receive high volumes of scanning or credential-stuffing traffic from unrelated sources.
- Security scanners or health checks that repeatedly test SSH connectivity may generate elevated `sshd-keygen-wrapper` activity.
### Response and remediation
- Review SSH authentication logs to identify source IPs, targeted accounts, and whether any logins succeeded.
- If unauthorized access is suspected, isolate the affected macOS host from the network.
- Implement IP blocking or rate limiting on the SSH service to reduce further login attempts.
- Review and reset credentials for affected user accounts if compromise is confirmed.
- Conduct a thorough review of the host's SSH configuration and enabled Remote Login settings.
- Escalate to the security operations team if additional hosts show similar patterns.
- Enhance monitoring for SSH authentication anomalies across the environment."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1110"
name = "Brute Force"
reference = "https://attack.mitre.org/techniques/T1110/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1133"
name = "External Remote Services"
reference = "https://attack.mitre.org/techniques/T1133/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[rule.threshold]
field = ["host.id"]
value = 20
Stages and Predicates
Stage 1: query
event.category:process and host.os.type:macos and event.type:start and process.name:"sshd-keygen-wrapper" and process.parent.name:launchd
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.category | eq |
| field:"event.category" kind:eq value:"process" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.name | eq |
| field:"process_basename" kind:eq value:"sshd-keygen-wrapper" |
process.parent.name | eq |
| field:"parent_process_basename" kind:eq value:"launchd" |
Potential Obfuscated PowerShell Script
#Identifies the execution of PowerShell with potentially obfuscated content. This behavior is often observed during malware installation leveraging PowerShell.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution |
Rule Body
[rule]
description = """
Identifies the execution of PowerShell with potentially obfuscated content. This behavior is often observed during
malware installation leveraging PowerShell.
"""
id = "f4db84b1-13d8-432d-999a-54a09784e62b"
license = "Elastic License v2"
name = "Potential Obfuscated PowerShell Script"
os_list = ["windows"]
version = "1.0.5"
query = '''
api where process.Ext.api.name == "AmsiScanBuffer" and
process.Ext.api.parameters.app_name == "PowerShell" and
(
process.Ext.api.parameters.buffer regex """.*(\"\{[0-9]{1,2}\}\{[0-9]{1,2}\}\{[0-9]{1,2}\}|['\"] {0,2}\+ {0,2}['\"][^$]{1,25}['\"]{0,2}\+ {0,2}['\"][^$]{1,25}['\"]\+['\"][^$]{1,25}['\"]\+['\"]).*""" or
process.Ext.api.parameters.buffer regex~ """.*\.\"s(`+e`*t`*v`*a`*l`*u`*e)|(`*e`+t`*v`*a`*l`*u`*e)|(`*e`*t`+v`*a`*l`*u`*e)|(`*e`*t`*v`+a`*l`*u`*e)|(`*e`*t`*v`*a`+l`*u`*e)|(`*e`*t`*v`*a`*l`+u`*e)|(`*e`*t`*v`*a`*l`*u`+e).*"""
) and
not (user.id == "S-1-5-18" and process.Ext.api.parameters.content_name == "C:\\Install-Beats.ps1" and process.Ext.api.parameters.buffer like "*Install-Beat($ElasticAgent)*") and
not process.Ext.api.parameters.buffer :
("*:::::\\windows\\sentinel\\*", "*<#sentinelbreakpoints#>*", "*$merged_stderr*", "*$branchStatusTextSpan.Text*") and
not (user.id == "S-1-5-18" and process.Ext.api.parameters.content_name : "C:\\WINDOWS\\CCM\\*.ps1") and
not process.Ext.api.parameters.content_name : ("C:\\Program Files\\Microsoft Azure AD Connect Health Agent\\Products\\AdFederationService\\AdfsDiagnostics\\AdfsToolbox\\diagnosticsModule\\Private\\CommonHealthChecks.ps1") and
not process.parent.executable : "C:\\Program Files\\ConEmu\\ConEmu\\ConEmuC64.exe"
'''
min_endpoint_version = "8.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.16.0"
Stages and Predicates
Stage 1: api
api where process.Ext.api.name == "AmsiScanBuffer" and
process.Ext.api.parameters.app_name == "PowerShell" and
(
process.Ext.api.parameters.buffer regex """.*(\"\{[0-9]{1,2}\}\{[0-9]{1,2}\}\{[0-9]{1,2}\}|['\"] {0,2}\+ {0,2}['\"][^$]{1,25}['\"]{0,2}\+ {0,2}['\"][^$]{1,25}['\"]\+['\"][^$]{1,25}['\"]\+['\"]).*""" or
process.Ext.api.parameters.buffer regex~ """.*\.\"s(`+e`*t`*v`*a`*l`*u`*e)|(`*e`+t`*v`*a`*l`*u`*e)|(`*e`*t`+v`*a`*l`*u`*e)|(`*e`*t`*v`+a`*l`*u`*e)|(`*e`*t`*v`*a`+l`*u`*e)|(`*e`*t`*v`*a`*l`+u`*e)|(`*e`*t`*v`*a`*l`*u`+e).*"""
) and
not (user.id == "S-1-5-18" and process.Ext.api.parameters.content_name == "C:\\Install-Beats.ps1" and process.Ext.api.parameters.buffer like "*Install-Beat($ElasticAgent)*") and
not process.Ext.api.parameters.buffer :
("*:::::\\windows\\sentinel\\*", "*<#sentinelbreakpoints#>*", "*$merged_stderr*", "*$branchStatusTextSpan.Text*") and
not (user.id == "S-1-5-18" and process.Ext.api.parameters.content_name : "C:\\WINDOWS\\CCM\\*.ps1") and
not process.Ext.api.parameters.content_name : ("C:\\Program Files\\Microsoft Azure AD Connect Health Agent\\Products\\AdFederationService\\AdfsDiagnostics\\AdfsToolbox\\diagnosticsModule\\Private\\CommonHealthChecks.ps1") and
not process.parent.executable : "C:\\Program Files\\ConEmu\\ConEmu\\ConEmuC64.exe"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.name | eq |
| field:"process.Ext.api.name" kind:eq value:"AmsiScanBuffer" |
process.Ext.api.parameters.app_name | eq |
| field:"process.Ext.api.parameters.app_name" kind:eq value:"PowerShell" |
process.Ext.api.parameters.buffer | regex_match |
| field:"process.Ext.api.parameters.buffer" kind:regex_match |
Exclusions
The rule actively suppresses these predicates.
Potential Proxy Execution via Tcpdump
#This rule detects the execution of a command or binary through the Tcpdump binary. Attackers may use this technique to execute commands while attempting to evade detection.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Stealth |
Rule Body
[rule]
description = """
This rule detects the execution of a command or binary through the Tcpdump binary. Attackers may use this technique to
execute commands while attempting to evade detection.
"""
id = "b1d81dfe-93d7-4d7d-827d-5def574e8cda"
license = "Elastic License v2"
name = "Potential Proxy Execution via Tcpdump"
os_list = ["linux"]
reference = ["https://gtfobins.github.io/gtfobins/tcpdump/"]
version = "1.0.4"
query = '''
process where event.type == "start" and event.action == "exec" and process.name == "tcpdump" and process.args == "-z" and
not process.parent.executable == "/usr/lib/systemd/systemd"
// potential tunings
// IOC: /sbin/tcpdump -ln -i lo -w /dev/null -W 1 -G 1 -z $TF -Z root
// process.args : "-*l*" and process.args == "-w" and process.args == "-W" and process.args == "-G"
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.name == "tcpdump" and process.args == "-z" and
not process.parent.executable == "/usr/lib/systemd/systemd"
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.executable | eq | /usr/lib/systemd/systemd | excludes:process.parent.executable field:"process.parent.executable" value:"/usr/lib/systemd/systemd" |
Potential Remote Desktop Tunneling Detected
#Identifies potential use of an SSH utility to establish RDP over an SSH Tunnel. This can be used by attackers to enable routing of network packets that would otherwise not reach their intended destination.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Lateral Movement | |
| Command & Control |
Telemetry Coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule Body
[metadata]
creation_date = "2020/10/14"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "m365_defender", "system", "crowdstrike"]
maturity = "production"
updated_date = "2026/04/07"
[rule]
author = ["Elastic"]
description = """
Identifies potential use of an SSH utility to establish RDP over an SSH Tunnel. This can be used by attackers to enable
routing of network packets that would otherwise not reach their intended destination.
"""
from = "now-9m"
index = [
"endgame-*",
"logs-crowdstrike.fdr*",
"logs-endpoint.events.process-*",
"logs-m365_defender.event-*",
"logs-sentinel_one_cloud_funnel.*",
"logs-system.security*",
"logs-windows.forwarded*",
"logs-windows.sysmon_operational-*",
"winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Potential Remote Desktop Tunneling Detected"
references = ["https://blog.netspi.com/how-to-access-rdp-over-a-reverse-ssh-tunnel/"]
risk_score = 73
rule_id = "76fd43b7-3480-4dd9-8ad7-8bd36bfad92f"
severity = "high"
tags = [
"Domain: Endpoint",
"OS: Windows",
"Use Case: Threat Detection",
"Tactic: Command and Control",
"Tactic: Lateral Movement",
"Resources: Investigation Guide",
"Data Source: Elastic Endgame",
"Data Source: Elastic Defend",
"Data Source: SentinelOne",
"Data Source: Microsoft Defender XDR",
"Data Source: Windows Security Event Logs",
"Data Source: Crowdstrike",
"Data Source: Sysmon",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
process where host.os.type == "windows" and event.type == "start" and
/* RDP port with SSH local or reverse port-forwarding flags */
process.args : "*:3389" and process.args : ("-L", "-R")
'''
note = """## Triage and analysis
### Investigating Potential Remote Desktop Tunneling Detected
#### Possible investigation steps
- Does the command line describe local or reverse forwarding of RDP, and who is being exposed through it?
- Why: tunnel direction changes the risk. "-L" accesses a remote RDP service through the tunnel (common admin pattern); "-R" exposes a host's RDP service outward through an attacker-controlled SSH server (the classic plink reverse-tunnel attack pattern).
- Focus: `process.command_line` and `process.executable`, checking whether the flag is "-L" (local) or "-R" (reverse), which host and port 3389 are forwarded, and whether inline credentials ("-pw") or saved sessions ("-load") are present. Many SSH clients ship unsigned, so use `process.Ext.relative_file_creation_time` to distinguish long-installed tools from recently dropped ones.
- Implication: "-R" (reverse forward) exposes an internal RDP service outward through the SSH server and is the higher-risk direction; "-L" (local forward) accesses a remote RDP service through the tunnel and is common in admin jump-host workflows. Both directions are common. Concern rises further when inline credentials are embedded, the remote endpoint is obscured behind a wrapper, or the binary is renamed, portable, or recently dropped.
- Do surrounding artifacts show the operator seeded trust or tried to keep the tunnel reusable?
- Why: persistent tunnels are often paired with host-key trust, saved configuration, or scheduled relaunch so the tunnel can start non-interactively and survive user interruption.
- Focus: for OpenSSH clients, check `file.path` for recent changes to `~/.ssh/known_hosts`, `~/.ssh/config`, or `~/.ssh/authorized_keys`, and surrounding `process.command_line` for "schtasks.exe", "at.exe", or scripted relaunches. For PuTTY/plink, check `registry.path` and `registry.data.strings` for "SshHostKeys", "Sessions", or "-load" session reuse.
- Implication: more concerning when new host-key entries, saved configurations, or scheduled relaunch activity appear just before or after the tunnel start; more explainable when the trust cache and relaunch method already belong to an established workflow with no new persistence changes.
- Does network telemetry show an SSH session to a destination that fits the expected workflow?
- Focus: the SSH destination is already in `process.args` from the alert. Use the network transform to confirm the connection succeeded and to check `destination.as.organization.name` for ownership context, especially for reverse forwards to external servers. $investigate_2
- Hint: if the command line already names an internal hostname you can verify, the network transform is optional. It adds the most value when the destination is an IP literal or an unfamiliar external host.
- Implication: supports concern when the process reaches a rare external destination, an unexpected SSH port, or infrastructure with no recognizable ownership; less concerning when the destination, port, and domain pattern fit a known bastion or jump host. Missing network telemetry is unresolved, not benign.
- If the local evidence stays suspicious, does this host or user show related alerts or repeated tunneling activity?
- Focus: related alerts for the same `host.id` and `user.id` in the last 48 hours, looking for delivery, persistence, credential access, or other remote-access activity around the tunnel event.
- $investigate_0
- $investigate_1
- Implication: supports concern when the host or user shows delivery, credential theft, or follow-on remote-access alerts; keeps the case locally bounded when alert history stays tied to one recognized admin workflow.
- Escalate when tunnel direction, binary context, persistence artifacts, network destination, or alert scope align on unauthorized RDP exposure or SSH tunneling; close only when all evidence fits a recognized administration workflow; if mixed or incomplete, preserve and escalate.
### False positive analysis
- Bastion or jump-host tunneling can legitimately trigger this rule. Confirm it when `process.executable`, `process.parent.executable`, the forwarding direction and target in `process.args`, and the `user.id`/`host.id` pairing all align with one recognized admin workflow. If records are unavailable, require the same binary path, parent, and tunnel pattern to recur across prior alerts.
- Before creating an exception, build on the forwarding target in `process.command_line` (e.g., the specific host and port being tunneled) combined with `process.executable`, `user.id`, and `host.id`. Most SSH clients triggering this rule are unsigned, so `process.code_signature.subject_name` is usually empty and `process.hash.sha256` changes with updates. Avoid exceptions on port 3389, `process.name`, or SSH switches alone.
### Response and remediation
- If confirmed benign, reverse temporary destination blocks or process suspension and document the evidence that proved the workflow, including `process.hash.sha256`, `process.parent.executable`, `process.command_line`, `destination.ip` or `dns.question.name`, any linked `source.ip`, and the bounded `user.id` and `host.id` scope. Create an exception only if that same workflow recurs across prior alerts from this rule.
- If suspicious but unconfirmed, preserve the full `process.command_line`, the alert's `process.entity_id`, `process.hash.sha256`, signer details, `destination.ip`, `dns.question.name`, linked `winlog.event_data.TargetLogonId` and `source.ip`, and any trust-seeding or relaunch artifacts (OpenSSH config files or PuTTY registry entries). Apply reversible containment first, such as blocking the SSH destination, suspending the tunneling process, or restricting the affected account. Escalate to host isolation only if the host role can tolerate it and the session or related-alert evidence suggests active abuse.
- If confirmed malicious, use endpoint response to isolate the host and terminate or suspend the tunneling process after recording `process.entity_id`, the parent chain, destination indicators, linked logon details, and any scheduled task, service, script, or registry artifacts that relaunch the tunnel. If direct endpoint response is unavailable, escalate with that artifact set to the team that can contain the host or account.
- Before deleting artifacts or resetting accounts, review other hosts and users for the same destination pattern, launcher lineage, or scheduled relaunch method so scoping is complete. Then remove the scheduled task, service, script, registry entries, and SSH client artifacts that sustained the tunnel, review any RDP-reachable systems for follow-on access, and reset credentials where the session review shows likely exposure or misuse.
- Post-incident hardening: restrict which hosts and accounts can run SSH tunneling tools, limit outbound SSH to recognized bastions, and retain process, file, and registry telemetry for SSH client activity.
"""
setup = """## Setup
This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
### Additional data sources
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
"""
[rule.investigation_fields]
field_names = [
"@timestamp",
"host.name",
"host.id",
"user.name",
"user.id",
"user.domain",
"process.entity_id",
"process.executable",
"process.command_line",
"process.hash.sha256",
"process.pe.original_file_name",
"process.parent.executable",
"process.parent.command_line",
"process.code_signature.subject_name",
"process.code_signature.trusted",
"process.working_directory",
"process.Ext.relative_file_creation_time",
]
[[transform.investigate]]
label = "Alerts associated with the user"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
[
{ excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
]
]
relativeFrom = "now-48h/h"
relativeTo = "now"
[[transform.investigate]]
label = "Network activity for the alerting process"
description = ""
providers = [
[
{ excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
{ excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
{ excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" }
]
]
relativeFrom = "now-1h"
relativeTo = "now"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1572"
name = "Protocol Tunneling"
reference = "https://attack.mitre.org/techniques/T1572/"
[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[rule.threat.technique.subtechnique]]
id = "T1021.001"
name = "Remote Desktop Protocol"
reference = "https://attack.mitre.org/techniques/T1021/001/"
[[rule.threat.technique.subtechnique]]
id = "T1021.004"
name = "SSH"
reference = "https://attack.mitre.org/techniques/T1021/004/"
[rule.threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
Stages and Predicates
Stage 1: process
process where host.os.type == "windows" and event.type == "start" and
process.args : "*:3389" and process.args : ("-L", "-R")
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
SSFileCopySender Executed as Root
#Identifies execution of the macOS Screen Sharing file-copy helper SSFileCopySender with root UID/GID attributes (0 80). Under the native Apple authentication path this helper runs in the connecting user's context; execution as root is anomalous and consistent with pre-authentication exploitation of the Screen Sharing service (CVE-2026-65400), where a flawed SRP validation path lets an unauthenticated attacker reach privileged file operations. Note that the 0/80 UID/GID pair reflects only initial exploitation attempts and can be evaded once an attacker enumerates another local account. It is advisable to treat this as a tripwire and pair it with the SSFileCopyReceiver Writing to Common Persistence Locations rule coverage.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Privilege Escalation |
Rule Body
[metadata]
creation_date = "2026/08/19"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/08/19"
[rule]
author = ["Elastic"]
description = """
Identifies execution of the macOS Screen Sharing file-copy helper SSFileCopySender with root UID/GID attributes
(0 80). Under the native Apple authentication path this helper runs in the connecting user's context; execution as
root is anomalous and consistent with pre-authentication exploitation of the Screen Sharing service (CVE-2026-65400),
where a flawed SRP validation path lets an unauthenticated attacker reach privileged file operations. Note that the
0/80 UID/GID pair reflects only initial exploitation attempts and can be evaded once an attacker enumerates another
local account. It is advisable to treat this as a tripwire and pair it with
the SSFileCopyReceiver Writing to Common Persistence Locations rule coverage.
"""
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "SSFileCopySender Executed as Root"
note = """ ## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating SSFileCopySender Executed as Root
This detects the macOS Screen Sharing file-copy helper starting with root privileges, which is abnormal because legitimate file transfers run in the remote user’s context. That pattern matters because it strongly suggests a pre-authentication Screen Sharing exploit path that lets an unauthenticated attacker invoke privileged file operations, for example by reaching the service over the network and copying a payload into /Library/LaunchDaemons before any user logs in.
### Possible investigation steps
- Correlate the alert time with unified logs, firewall records, and endpoint network telemetry to identify the source IP that reached Screen Sharing and determine whether the connection came from an unexpected internal or external host.
- Reconstruct the 5–10 minute execution timeline around the event to capture the launch context and any follow-on activity such as shell, scripting, download, archive, permission-change, or service-management commands.
- Review concurrent and subsequent file activity for newly written or modified items in common staging and persistence paths such as /Library/LaunchDaemons, /Library/LaunchAgents, /Library/PrivilegedHelperTools, /Users/Shared, and temporary directories, and collect hashes for any payloads.
- Validate whether any legitimate remote administration or support session was expected on the host and compare that with authentication and user-session records to spot execution without a corresponding successful login or a rapid pivot to another local account.
- Scope for broader exploitation by confirming whether Screen Sharing or Remote Management was enabled, checking the host’s patch status for CVE-2026-65400, and searching for the same source IP or related indicators across other macOS systems.
### False positive analysis
- An authorized administrator may manually invoke SSFileCopySender as root during macOS Screen Sharing troubleshooting or control validation; verify the parent process is an expected local shell or maintenance script, the activity aligns with a documented change window, and there are no unexpected follow-on file writes.
- A lab or staging Mac used for patch verification or regression testing may intentionally exercise the Screen Sharing file-copy helper with the 0/80 arguments; verify the host’s role, confirm the timing matches approved test activity, and ensure any related network source and copied files are expected.
- Legacy VNC authentication runs SSFileCopySender in a root context, so root-context execution alone is expected and this rule will fire on benign legacy-VNC sessions. Treat it as a lead, not a finding and corroborate with a near-in-time "SSFileCopyReceiver Writing to Common Persistence Locations" alert on the same host before take an action.
### Related Rules
- SSFileCopyReceiver Writing to Common Persistence Locations - 5773cef4-11a5-4d51-a40b-0e0a79d68432
### Response and remediation
- Immediately isolate the affected Mac from the network, disable Screen Sharing and Remote Management on the host, and block the identified source IP or access path while preserving relevant logs and suspicious files for follow-up analysis.
- Remove attacker footholds by unloading and deleting unauthorized launchd items from /Library/LaunchDaemons and /Library/LaunchAgents, removing rogue binaries from /Library/PrivilegedHelperTools, /Users/Shared, and temporary directories, and deleting any unknown local accounts or added SSH authorized_keys.
- Restore the system to a known-good state by reimaging the host or recovering from a trusted backup if SSFileCopySender was followed by writes to privileged locations, modified system settings, or execution of additional payloads.
- Escalate to incident response immediately if you confirm persistence in system-wide paths, evidence of lateral movement, tampering with security tooling, or the same Screen Sharing source interacting with any other macOS endpoints.
- Harden the environment by applying the vendor patch for CVE-2026-65400, disabling Screen Sharing where it is not required, restricting remote administration to approved management networks or VPN, and rotating passwords for any local or administrative accounts exposed on the host.
"""
references = [
"https://www.huntress.com/blog/macos-screen-sharing-rce-patched",
"https://nvd.nist.gov/vuln/detail/CVE-2026-65400",
"https://support.apple.com/en-us/HT201222",
]
risk_score = 47
rule_id = "e54c3f36-e243-402d-9d44-8f7349eb8c88"
setup = """## Setup
This rule requires data coming in from Elastic Defend.
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "medium"
tags = [
"Domain: Endpoint",
"OS: macOS",
"Use Case: Threat Detection",
"Use Case: Vulnerability",
"Tactic: Initial Access",
"Data Source: Elastic Defend",
"Resources: Investigation Guide"
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-endpoint.events.process-* METADATA _id, _index, _version
| WHERE host.os.type == "macos"
AND event.type == "start"
AND process.name == "SSFileCopySender"
AND KQL(""" process.args : "0" AND process.args : "80" """)
| KEEP _id, _version, _index,
@timestamp,
data_stream.namespace,
host.name,
host.id,
user.id,
user.name,
process.name,
process.entity_id,
process.parent.name,
process.command_line
| SORT @timestamp DESC
| LIMIT 100
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1190"
name = "Exploit Public-Facing Application"
reference = "https://attack.mitre.org/techniques/T1190/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"
[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
Stages and Predicates
Stage 1: from
from logs-endpoint.events.process-* METADATA _id, _index, _version
Stage 2: where
| WHERE host.os.type == "macos"
AND event.type == "start"
AND process.name == "SSFileCopySender"
AND KQL(""" process.args : "0" AND process.args : "80" """)
Stage 3: keep
| KEEP _id, _version, _index,
@timestamp,
data_stream.namespace,
host.name,
host.id,
user.id,
user.name,
process.name,
process.entity_id,
process.parent.name,
process.command_line
Stage 4: sort
| SORT @timestamp DESC
Stage 5: limit
| LIMIT 100
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.name | eq |
| field:"process_basename" kind:eq value:"SSFileCopySender" |
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
_id | KEEP _id |
_version | KEEP _version |
_index | KEEP _index |
@timestamp | KEEP @timestamp |
data_stream.namespace | KEEP data_stream.namespace |
host.name | KEEP host.name |
host.id | KEEP host.id |
user.id | KEEP user.id |
user.name | KEEP user.name |
process.name | KEEP process.name |
process.entity_id | KEEP process.entity_id |
process.parent.name | KEEP process.parent.name |
process.command_line | KEEP process.command_line |
Suspicious NTDLL Image Load
#Identifies when a process loads a second copy of Windows NTDLL image. This may be indicative of adversarial attempt to evade NTDLL syscall hooking by loading a clean (unhooked) copy of the same image.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies when a process loads a second copy of Windows NTDLL image. This may be indicative of adversarial attempt to
evade NTDLL syscall hooking by loading a clean (unhooked) copy of the same image.
"""
id = "5eb3c0b3-8d11-439d-b26d-d7623c5b3723"
license = "Elastic License v2"
name = "Suspicious NTDLL Image Load"
os_list = ["windows"]
reference = [
"https://www.elastic.co/security-labs/Hunting-for-Suspicious-Windows-Libraries-for-Execution-and-Evasion",
]
version = "1.0.29"
query = '''
sequence by process.entity_id with maxspan=1m
[process where event.action == "start" and
not process.Ext.token.integrity_level_name in ("system", "low") and
(
process.name : ("rundll32.exe", "regsvr32.exe", "mshta.exe", "wscript.exe", "notepad.exe", "msbuild.exe", "regasm.exe", "Installutil.exe") or
process.executable : ("?:\\Users\\Public\\*",
"?:\\Windows\\SysWOW64\\explorer.exe",
"?:\\Users\\*\\AppData\\Local\\Temp\\7z*\\",
"?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*\\*",
"?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*\\*",
"?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*") or
(process.parent.name : ("rundll32.exe", "regsvr32.exe", "winword.exe", "excel.exe", "powerpnt.exe") and
not process.executable : ("?:\\Program Files (x86)\\Microsoft Office\\*", "?:\\Program Files\\Microsoft Office\\*")) or
(process.name : "powershell.exe" and (length(process.command_line) >= 100 or process.command_line : "*http*"))
) and
not (process.name : ("wscript.exe", "cscript.exe") and process.args : "\\\\*\\SysVol\\*")
]
[library where
dll.path : ("?:\\Windows\\SysWOW64\\ntdll.dll", "?:\\Windows\\System32\\ntdll.dll") and
process.thread.Ext.call_stack_summary : "?*" and
not process.thread.Ext.call_stack_summary : "ntdll.dll" and
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.symbol_info : ("?:\\Program Files\\ESET\\ESET Security\\ebehmoni.dll*", "?:\\Program Files (x86)\\ESET\\ESET Security\\ebehmoni.dll*"))]
[dns where dns.question.name : "*.*"]
'''
min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where event.action == "start" and
not process.Ext.token.integrity_level_name in ("system", "low") and
(
process.name : ("rundll32.exe", "regsvr32.exe", "mshta.exe", "wscript.exe", "notepad.exe", "msbuild.exe", "regasm.exe", "Installutil.exe") or
process.executable : ("?:\\Users\\Public\\*",
"?:\\Windows\\SysWOW64\\explorer.exe",
"?:\\Users\\*\\AppData\\Local\\Temp\\7z*\\",
"?:\\Users\\*\\AppData\\Local\\Temp\\Rar$*\\*",
"?:\\Users\\*\\AppData\\Local\\Temp\\Temp?_*\\*",
"?:\\Users\\*\\AppData\\Local\\Temp\\BNZ.*") or
(process.parent.name : ("rundll32.exe", "regsvr32.exe", "winword.exe", "excel.exe", "powerpnt.exe") and
not process.executable : ("?:\\Program Files (x86)\\Microsoft Office\\*", "?:\\Program Files\\Microsoft Office\\*")) or
(process.name : "powershell.exe" and (length(process.command_line) >= 100 or process.command_line : "*http*"))
) and
not (process.name : ("wscript.exe", "cscript.exe") and process.args : "\\\\*\\SysVol\\*")
]
Stage 2: library
[library where
dll.path : ("?:\\Windows\\SysWOW64\\ntdll.dll", "?:\\Windows\\System32\\ntdll.dll") and
process.thread.Ext.call_stack_summary : "?*" and
not process.thread.Ext.call_stack_summary : "ntdll.dll" and
not _arraysearch(process.thread.Ext.call_stack, $entry,
$entry.symbol_info : ("?:\\Program Files\\ESET\\ESET Security\\ebehmoni.dll*", "?:\\Program Files (x86)\\ESET\\ESET Security\\ebehmoni.dll*"))]
Stage 3: dns
[dns where dns.question.name : "*.*"]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dll.path | wildcard |
| field:"ImageLoaded" kind:wildcard |
dns.question.name | wildcard |
| field:"QueryName" kind:wildcard value:"*.*" |
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:"*http*" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_basename" kind:wildcard |
process.thread.Ext.call_stack_summary | wildcard |
| field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"?*" |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | wildcard | \\*\SysVol\* | excludes:process.args field:"process.args" value:"\\*\SysVol\*" |
process.name | eq | wscript.exe, cscript.exe | excludes:process.name field:"process.name" value:"wscript.exe" field:"process.name" value:"cscript.exe" |
process.Ext.token.integrity_level_name | in | low, system | excludes:process.Ext.token.integrity_level_name field:"process.Ext.token.integrity_level_name" value:"low" field:"process.Ext.token.integrity_level_name" value:"system" |
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack | |
process.thread.Ext.call_stack_summary | eq | ntdll.dll | excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll" |
UAC Bypass via Sdclt
#Identifies attempts to bypass User Account Control (UAC) via sdclt.exe. Attackers bypass UAC to stealthily execute code with elevated permissions.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule Body
[rule]
description = """
Identifies attempts to bypass User Account Control (UAC) via sdclt.exe. Attackers bypass UAC to stealthily execute code
with elevated permissions.
"""
id = "e9095298-65e0-40a2-97c9-055de8685645"
license = "Elastic License v2"
name = "UAC Bypass via Sdclt"
os_list = ["windows"]
reference = ["https://github.com/hfiref0x/UACME"]
version = "1.0.31"
query = '''
process where event.action == "start" and
process.parent.name : "sdclt.exe" and process.parent.command_line : "*/kickoffelev*" and
process.Ext.token.integrity_level_name == "high" and
not process.executable :
("?:\\Windows\\SysWOW64\\sdclt.exe",
"?:\\Windows\\System32\\sdclt.exe",
"?:\\Windows\\SysWOW64\\control.exe",
"?:\\Windows\\System32\\control.exe",
"?:\\Windows\\System32\\WerFault.exe",
"?:\\Windows\\SysWOW64\\WerFault.exe",
"?:\\Windows\\System32\\wermgr.exe",
"?:\\Windows\\SysWOW64\\wermgr.exe")
'''
min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.002"
name = "Bypass User Account Control"
reference = "https://attack.mitre.org/techniques/T1548/002/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
process.parent.name : "sdclt.exe" and process.parent.command_line : "*/kickoffelev*" and
process.Ext.token.integrity_level_name == "high" and
not process.executable :
("?:\\Windows\\SysWOW64\\sdclt.exe",
"?:\\Windows\\System32\\sdclt.exe",
"?:\\Windows\\SysWOW64\\control.exe",
"?:\\Windows\\System32\\control.exe",
"?:\\Windows\\System32\\WerFault.exe",
"?:\\Windows\\SysWOW64\\WerFault.exe",
"?:\\Windows\\System32\\wermgr.exe",
"?:\\Windows\\SysWOW64\\wermgr.exe")
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | eq | ?:\Windows\SysWOW64\sdclt.exe, ?:\Windows\System32\sdclt.exe, ?:\Windows\SysWOW64\control.exe, ?:\Windows\System32\control.exe, ?:\Windows\System32\WerFault.exe, ?:\Windows\SysWOW64\WerFault.exe, ?:\Windows\System32\wermgr.exe, ?:\Windows\SysWOW64\wermgr.exe | excludes:process.executable |
Unsigned DLL Loaded by an Elastic Signed Binary
#Identifies the load of an unsigned or untrusted DLL by an Elastic signed binary. This may indicate a potential DLL sideloading attempt.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule Body
[rule]
description = """
Identifies the load of an unsigned or untrusted DLL by an Elastic signed binary. This may indicate a potential DLL
sideloading attempt.
"""
id = "b3edbd4f-d829-49fe-a638-8ef2dc56e8fd"
license = "Elastic License v2"
name = "Unsigned DLL Loaded by an Elastic Signed Binary"
os_list = ["windows"]
version = "1.0.19"
query = '''
library where
process.code_signature.subject_name == "Elasticsearch, Inc." and
(dll.code_signature.exists == false or
(dll.code_signature.trusted == false and not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*"))) and
/* loaded from current dir */
endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), substring(process.executable, 0, length(process.executable) - (length(process.name) + 1))) and
not startswith~(dll.name, process.name)
'''
min_endpoint_version = "8.0.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[threat.technique.subtechnique]]
id = "T1574.001"
name = "DLL"
reference = "https://attack.mitre.org/techniques/T1574/001/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.0.0"
Stages and Predicates
Stage 1: library
library where
process.code_signature.subject_name == "Elasticsearch, Inc." and
(dll.code_signature.exists == false or
(dll.code_signature.trusted == false and not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*"))) and
endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), substring(process.executable, 0, length(process.executable) - (length(process.name) + 1))) and
not startswith~(dll.name, process.name)
Indicators
These rows show field, operator, and value matches.
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
dll.name | starts_with | process.name | excludes:dll.name field:"dll.name" value:"process.name" |
Unusual Bundle Execution via Shell
#Detects when a bundle identifier binary, denoted by the com. syntax, is executed via a shell interpreter where the effective parent process is the path of the bundle identifier itself.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry Coverage
Rule Body
[rule]
description = """
Detects when a bundle identifier binary, denoted by the com. syntax, is executed via a shell interpreter where the
effective parent process is the path of the bundle identifier itself.
"""
id = "b2c0f8bb-890b-4938-9427-fc66650451b3"
license = "Elastic License v2"
name = "Unusual Bundle Execution via Shell"
os_list = ["macos"]
reference = [
"https://github.com/center-for-threat-informed-defense/adversary_emulation_library/tree/4a57b3dd5d28ad1bd79e927e04b20fd4d66934a0/ocean_lotus",
]
version = "1.0.3"
query = '''
process where event.type == "start" and event.action == "exec" and process.name like "com.*" and
process.executable like ("/Users/*", "/Volumes/*", "/tmp/*", "/private/tmp/*", "/var/tmp/*", "/var/root/*") and process.parent.name in ("bash", "zsh", "sh") and
startswith~(process.executable, process.Ext.effective_parent.executable)
'''
min_endpoint_version = "8.11.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.11.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.name like "com.*" and
process.executable like ("/Users/*", "/Volumes/*", "/tmp/*", "/private/tmp/*", "/var/tmp/*", "/var/root/*") and process.parent.name in ("bash", "zsh", "sh") and
startswith~(process.executable, process.Ext.effective_parent.executable)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.executable | starts_with |
| field:"Image" kind:starts_with value:"process.Ext.effective_parent.executable" |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.name | wildcard |
| field:"process_basename" kind:wildcard value:"com.*" |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
Unusual Command Execution via Cron
#This rule detects the execution of suspicious commands and executables by cron. Threat actors may abuse cron to execute malicious commands or scripts to maintain persistence or escalate privileges.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Persistence | |
| Privilege Escalation | |
| Command & Control |
Rule Body
[rule]
description = """
This rule detects the execution of suspicious commands and executables by cron. Threat actors may abuse cron to execute
malicious commands or scripts to maintain persistence or escalate privileges.
"""
id = "9f587c35-8c2b-4410-b419-2eff4e0607cc"
license = "Elastic License v2"
name = "Unusual Command Execution via Cron"
os_list = ["linux"]
reference = [
"https://pberba.github.io/security/2022/01/30/linux-threat-hunting-for-persistence-systemd-timers-cron/",
"https://www.elastic.co/security-labs/primer-on-persistence-mechanisms",
]
version = "1.0.8"
query = '''
process where event.type == "start" and event.action == "exec" and process.parent.name in ("cron", "crond") and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox", "pwsh", "mksh") and
process.args in ("-c", "--command", "-lc", "-cl") and (
process.command_line like~ (
/* Encoding, Decoding & Piping */
"*|sh", "*| sh *", "*| sh ", "*|bash*", "*| bash*", "*|zsh*", "*| zsh*", "*|dash*", "*| dash*",
"*|python*", "*| python*", "*|php*", "*| php*", "*|perl*", "*| perl*", "*|ruby*", "*| ruby*",
"*|node*", "*| node*", "*|lua*", "*| lua*", "*|busybox*", "*| busybox*", "*|*base64 -d*", "*|*base64 --decode*",
"*|*openssl base64 -d*", "*xxd *", "*| openssl*enc * -d *", "*b64decode -r*",
/* Reverse Shell CLIs */
"*/dev/tcp*", "*/dev/udp/*", "*import*pty*spawn*", "*import*subprocess*call*", "*TCPSocket.new*", "*TCPSocket.open*",
"*io.popen*", "*os.execute*", "*fsockopen*", "*socat*exec:*", "*socat*tcp-connect*",
/* Persistence */
"*>*/home/*/.ssh/*", "*>*/root/.ssh*", "*>*~/.ssh/*", "*>*/etc/shadow*", "*>*/etc/passwd*",
"*>*/etc/master.passwd*", "*chpasswd*", "*NOPASSWD:ALL*>*sudoers.d*", "*>*/etc/systemd/system/*[Unit]*ExecStart*",
"*| crontab -*",
/* Miscellaneous */
"* setsid *", "*timeout *sh -c *", "*disown*", "*chattr *", "busybox *", "*chmod +x *",
"*<?php*?>*", "*kworker*", "*stty*raw*-echo*", "*mkfifo /tmp/*", "*/dev/shm/*"
) or
(
process.command_line like ("*curl *", "*wget *") and
not process.command_line like ("*> /dev/null*", "*>/dev/null*", "* -O /dev/null*") and
(
process.command_line regex~ """.*curl.* \-[a-zA-Z]*[oO]( .+|\-.*)?""" or
process.command_line like~ ("*curl* --output*", "*curl* --remote-name*") or
process.command_line regex~ """.*wget.* \-[a-zA-Z]*O.*""" or
process.command_line like~ "*wget* --output-document*" or
process.command_line like ("*|*sh*", "*|*python*", "*|*php*", "*|*perl*", "*|*ruby*", "*|*node*", "*|*lua*", "*|*busybox*") or
process.command_line like ("*curl *>> /*", "*curl *>>/*", "*curl *> /*", "*curl *>/*", "*wget *>> /*", "*wget *>>/*", "*wget *> /*", "*wget *>/*") or
process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(:[0-9]{1,5})?/.*"
) and
not process.command_line like (
"*var/log/check_zhyldyz.log*", "*intranet-app.*.com.*/system/scheduler/scheduler.php*", "*smartcrm.*/cron/index*", "*helpdesk_mailer/get_mail*",
"*download.cdn.*.com/resources/dns-utils/*", "*api.*.cloud/unsecure/runCronManagement*", "*index.php/ecosport/Member/Generateandupdatemember*",
"*var/www/html/anywhere/dictionary/sip-blacklist-ips*", "*10.5.0.3:6106/api/2/*", "*etc/ssh/revoked_keys*", "*var/log/crons.log*",
"*nl/software/*/appserver_updates.sh*", "*var/cache/bind/zones/db.rpz.urlhaus*", "*srv/www/htdocs/seasonalhurricanepredictions/misc/new-web/php/globalstats.txt*",
"*api.*/api/actualizaguiaTransportadoraManual*", "*10.*.36/api/v0/ports/?device_id=*", "*165.*/jai_mobileapp_services/cron_*.php*", "*10.*/feeds/fetchFromAllFeeds*",
"*64.*/jai_erp_chatbot/impex/cron_*sync.php*"
)
)
) and
not (
process.command_line like (
"*localhost*", "*127.0.0.1*", "*>*/run/*.pid", "*>*/tmp/*.log*", "*/etc/init.d/mailman*", "/bin/sh -c /var/www/MISP/app/Console/*> /tmp/cronlog 2>&1",
"""/bin/bash -c echo "" > /tmp/stdout && echo "" > /tmp/stderr""", "/bin/sh -c /usr/bin/curl -s http://scripts.*.lan:8080/*",
"""/bin/sh -c echo "Define current_date $(date -I)" > /var/www/current_date.conf; service apache2 reload""", "*api.github.com/meta*", "*/opt/commvault/*",
"/bin/sh -c curl -s https://tools.*.ch/vuls.sh | bash -s", "/bin/sh -c curl -ks https://*:7443/users/heartbeat > /dev/null || exit 1",
"*test*", "*grep*", "*logger*", "/bin/sh -c curl --user*.log", "/bin/sh -c /dev/shm/pty3 > /dev/null 2>&1 &", "/bin/sh -c*backup.sh*logToFile.sh",
"/bin/sh -c /home/*/sub/backup-archivelogs.sh*", "*/usr/bin/curl -s https://check.torproject.org/torbulkexitlist*", "*/run/cloud-init/share/*.sock*",
"sh -c ldd /var/tmp/dracut*/initramfs/usr/bin/mkfifo*", "*cpanel*.zendesk.com/api/v2/ticket_metrics.json*, *fortigate-backup.sh*hc-ping.com*",
"/bin/sh -c curl -sSL https://*/scripts/linux/syslog-archival/report_syslog_v3.sh | bash -x > /var/log/report_syslog_v3.debug.out 2>&1",
"/bin/sh -c curl -s https://*/retrieve-validca.sh | bash -s /data/certificate > /data/log/valica.log 2>&1 && supervisorctl apache2 reload >>/data/log/valica.log 2>&1",
"/bin/sh -c echo $(date) >> /var/log/pay/epgw_log.txt;/usr/bin/curl*", "/bin/sh -c wget -q -O - https://*.com/wp-cron.php?doing_wp_cron",
"""/bin/sh -c wget -q -O /dev/null "https://*/v2/index.php?route=cron/recurring&platform_id=1"""", "/bin/sh -c docker exec*/bin/bash -c '/bin/rm /opt/flink/core.*' 2>/dev/null",
"""/bin/sh -c /home/cronjob/proses_sap_mm_einvoice.sh || bash /var/cartenz/send_notify.sh "$(/home/cronjob/proses_sap_mm_einvoice.sh 2>&1)"""",
"/bin/sh -c /usr/bin/wget https://www.*/modules/mod_fewo_uploader/mod_fewo_uploader_cronjob.php >/private-backup/scripte/logs/mod_fewo_uploader_cronjob.log 2>&1",
"*ec/tr/docflow/logs/tc.session.expire*", "*scripts/redeploy_disconnected_worker_autostore.log*", "*https://10.*.36/api/v0/devices/*",
"*https://*/index.php/ccm/system/jobs/run_single?auth=*", "*var/www/html/ess/cronjob/notifikasi.sh*", "*http://*/software/*/appserver_updates.sh*",
"*home/*/wnt/backups/postgres_dump*.sql*", "/bin/sh -c /usr/bin/curl -s https://automailer.bgss.in/sendMail >> /var/log/automailer.log 2>&1",
"/bin/sh -c /usr/bin/curl -s https://compliancehub.bgss.in/fetch >> /var/log/compliancehub.log 2>&1", "*var/www/html/ess/cronjob/*",
"*https://10.*.33:5665/v1/*", "*https://10.*", "*http://10.*", "*var/cartenz/send_notify.sh*", "*http://*.com/?wlmcron=*", "*https://*/webstat/data/send_excel_lab.php*",
"*/var/spool/threat-feed/threatfox_ip_port.csv*", "/bin/sh -c curl https://*.go.id/batch/fastBatch 2>&1 | timestamp.sh >> backup.log",
"/bin/sh -c curl https://*.go.id/batch/fastbatch 2>&1 | timestamp.sh >> backup.log", "/bin/sh -c curl https://*.go.id/batch/updateIkrap 2>&1 | timestamp.sh >> backup.log",
"/bin/sh -c curl https://*.go.id/batch/daily 2>&1 | timestamp.sh >> backup.log", "*https://api.*.kz/v3/kaseOrders/*", "*https://api.*.kz/v3/sendAmlRequest*",
"*/var/log/mco_push_log.log*", "*./luigi_start_job.sh*", "*go.id/batch/closingExam*", "*/var/www/html/*/wp-content/heatrisk/heatrisk.xml*",
"*/var/log1/cron_*.log*", "*/var/www/log/cron_xml.log*", "*https://qrcode.*.com/system/cron*", "*w=app/akasha/configuration/ExportDocumentsAsXml*",
"/bin/sh -c wget -O - -t 1 https://*/custom-api-server/hubspot/oauth/callback*", "*/var/log/*.log*", "*/var/log1/*.log*", "*wget*akasha*"
) or
process.command_line in (
"/bin/sh -c /usr/bin/flock -n /dev/shm/loadwatch.lock -c /usr/local/lp/bin/loadwatch &> /dev/null",
"/bin/sh -c curl -L https://chef.io/chef/install.sh | bash", "sh -c ldd /usr/bin/mkfifo 2>&1",
"/bin/bash -c curl -fs https://get.upwind.io/sensor.sh | bash -s -- upgrade",
"/bin/bash -c curl -s https://get.upwind.io/sensor.sh | bash -s -- upgrade",
"/bin/sh -c /opt/arcsight/backup_local/backup.sh || /opt/arcsight/backup_local/backup_error.sh",
"""/usr/bin/sh -c echo date=$(date +"%Y%m%d") > /dev/shm/mag/sptwweb.env""",
"/bin/sh -c /usr/bin/find /dev/shm/munin/mtsms/http -type f -mmin +15 -delete",
"/bin/sh -c echo 'LW_APP_CRONTAB' | php /itops/nginx/html/lwjk_app/bin/manager process-console/listen 2>&1"
) or
process.args like (
"[ ! -e *", "ansible *", "php -q /var/www/*php > /tmp/datastore*", "wget --proxy=off*cat*batch_trigger.log",
"sudo curl*raw.githubusercontent.com/*/backup-scripts/refs/heads/main/fortigate-backup.sh*",
"/usr/bin/curl -s -H*zendesk.com/api/v2/ticket_metrics.json*", "export PM2_HOME=*",
"/usr/bin/curl*/var/log/checkdiskusage.log", "ps*/opt/fortinet/fortisiem/linux-agent/tmp/*",
"flock*/tmp/edl.lock*"
) or
process.working_directory like "/opt/nessus_agent/*"
)
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[threat.technique.subtechnique]]
id = "T1053.003"
name = "Cron"
reference = "https://attack.mitre.org/techniques/T1053/003/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[threat.technique.subtechnique]]
id = "T1053.003"
name = "Cron"
reference = "https://attack.mitre.org/techniques/T1053/003/"
[[threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.parent.name in ("cron", "crond") and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox", "pwsh", "mksh") and
process.args in ("-c", "--command", "-lc", "-cl") and (
process.command_line like~ (
"*|sh", "*| sh *", "*| sh ", "*|bash*", "*| bash*", "*|zsh*", "*| zsh*", "*|dash*", "*| dash*",
"*|python*", "*| python*", "*|php*", "*| php*", "*|perl*", "*| perl*", "*|ruby*", "*| ruby*",
"*|node*", "*| node*", "*|lua*", "*| lua*", "*|busybox*", "*| busybox*", "*|*base64 -d*", "*|*base64 --decode*",
"*|*openssl base64 -d*", "*xxd *", "*| openssl*enc * -d *", "*b64decode -r*",
"*/dev/tcp*", "*/dev/udp/*", "*import*pty*spawn*", "*import*subprocess*call*", "*TCPSocket.new*", "*TCPSocket.open*",
"*io.popen*", "*os.execute*", "*fsockopen*", "*socat*exec:*", "*socat*tcp-connect*",
"*>*/home/*/.ssh/*", "*>*/root/.ssh*", "*>*~/.ssh/*", "*>*/etc/shadow*", "*>*/etc/passwd*",
"*>*/etc/master.passwd*", "*chpasswd*", "*NOPASSWD:ALL*>*sudoers.d*", "*>*/etc/systemd/system/*[Unit]*ExecStart*",
"*| crontab -*",
"* setsid *", "*timeout *sh -c *", "*disown*", "*chattr *", "busybox *", "*chmod +x *",
"*<?php*?>*", "*kworker*", "*stty*raw*-echo*", "*mkfifo /tmp/*", "*/dev/shm/*"
) or
(
process.command_line like ("*curl *", "*wget *") and
not process.command_line like ("*> /dev/null*", "*>/dev/null*", "* -O /dev/null*") and
(
process.command_line regex~ """.*curl.* \-[a-zA-Z]*[oO]( .+|\-.*)?""" or
process.command_line like~ ("*curl* --output*", "*curl* --remote-name*") or
process.command_line regex~ """.*wget.* \-[a-zA-Z]*O.*""" or
process.command_line like~ "*wget* --output-document*" or
process.command_line like ("*|*sh*", "*|*python*", "*|*php*", "*|*perl*", "*|*ruby*", "*|*node*", "*|*lua*", "*|*busybox*") or
process.command_line like ("*curl *>> /*", "*curl *>>/*", "*curl *> /*", "*curl *>/*", "*wget *>> /*", "*wget *>>/*", "*wget *> /*", "*wget *>/*") or
process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(:[0-9]{1,5})?/.*"
) and
not process.command_line like (
"*var/log/check_zhyldyz.log*", "*intranet-app.*.com.*/system/scheduler/scheduler.php*", "*smartcrm.*/cron/index*", "*helpdesk_mailer/get_mail*",
"*download.cdn.*.com/resources/dns-utils/*", "*api.*.cloud/unsecure/runCronManagement*", "*index.php/ecosport/Member/Generateandupdatemember*",
"*var/www/html/anywhere/dictionary/sip-blacklist-ips*", "*10.5.0.3:6106/api/2/*", "*etc/ssh/revoked_keys*", "*var/log/crons.log*",
"*nl/software/*/appserver_updates.sh*", "*var/cache/bind/zones/db.rpz.urlhaus*", "*srv/www/htdocs/seasonalhurricanepredictions/misc/new-web/php/globalstats.txt*",
"*api.*/api/actualizaguiaTransportadoraManual*", "*10.*.36/api/v0/ports/?device_id=*", "*165.*/jai_mobileapp_services/cron_*.php*", "*10.*/feeds/fetchFromAllFeeds*",
"*64.*/jai_erp_chatbot/impex/cron_*sync.php*"
)
)
) and
not (
process.command_line like (
"*localhost*", "*127.0.0.1*", "*>*/run/*.pid", "*>*/tmp/*.log*", "*/etc/init.d/mailman*", "/bin/sh -c /var/www/MISP/app/Console/*> /tmp/cronlog 2>&1",
"""/bin/bash -c echo "" > /tmp/stdout && echo "" > /tmp/stderr""", "/bin/sh -c /usr/bin/curl -s http://scripts.*.lan:8080/*",
"""/bin/sh -c echo "Define current_date $(date -I)" > /var/www/current_date.conf; service apache2 reload""", "*api.github.com/meta*", "*/opt/commvault/*",
"/bin/sh -c curl -s https://tools.*.ch/vuls.sh | bash -s", "/bin/sh -c curl -ks https://*:7443/users/heartbeat > /dev/null || exit 1",
"*test*", "*grep*", "*logger*", "/bin/sh -c curl --user*.log", "/bin/sh -c /dev/shm/pty3 > /dev/null 2>&1 &", "/bin/sh -c*backup.sh*logToFile.sh",
"/bin/sh -c /home/*/sub/backup-archivelogs.sh*", "*/usr/bin/curl -s https://check.torproject.org/torbulkexitlist*", "*/run/cloud-init/share/*.sock*",
"sh -c ldd /var/tmp/dracut*/initramfs/usr/bin/mkfifo*", "*cpanel*.zendesk.com/api/v2/ticket_metrics.json*, *fortigate-backup.sh*hc-ping.com*",
"/bin/sh -c curl -sSL https://*/scripts/linux/syslog-archival/report_syslog_v3.sh | bash -x > /var/log/report_syslog_v3.debug.out 2>&1",
"/bin/sh -c curl -s https://*/retrieve-validca.sh | bash -s /data/certificate > /data/log/valica.log 2>&1 && supervisorctl apache2 reload >>/data/log/valica.log 2>&1",
"/bin/sh -c echo $(date) >> /var/log/pay/epgw_log.txt;/usr/bin/curl*", "/bin/sh -c wget -q -O - https://*.com/wp-cron.php?doing_wp_cron",
"""/bin/sh -c wget -q -O /dev/null "https:
"""/bin/sh -c /home/cronjob/proses_sap_mm_einvoice.sh || bash /var/cartenz/send_notify.sh "$(/home/cronjob/proses_sap_mm_einvoice.sh 2>&1)"""",
"/bin/sh -c /usr/bin/wget https://www.*/modules/mod_fewo_uploader/mod_fewo_uploader_cronjob.php >/private-backup/scripte/logs/mod_fewo_uploader_cronjob.log 2>&1",
"*ec/tr/docflow/logs/tc.session.expire*", "*scripts/redeploy_disconnected_worker_autostore.log*", "*https://10.*.36/api/v0/devices/*",
"*https://*/index.php/ccm/system/jobs/run_single?auth=*", "*var/www/html/ess/cronjob/notifikasi.sh*", "*http://*/software/*/appserver_updates.sh*",
"*home/*/wnt/backups/postgres_dump*.sql*", "/bin/sh -c /usr/bin/curl -s https://automailer.bgss.in/sendMail >> /var/log/automailer.log 2>&1",
"/bin/sh -c /usr/bin/curl -s https://compliancehub.bgss.in/fetch >> /var/log/compliancehub.log 2>&1", "*var/www/html/ess/cronjob/*",
"*https://10.*.33:5665/v1/*", "*https://10.*", "*http://10.*", "*var/cartenz/send_notify.sh*", "*http://*.com/?wlmcron=*", "*https://*/webstat/data/send_excel_lab.php*",
"*/var/spool/threat-feed/threatfox_ip_port.csv*", "/bin/sh -c curl https://*.go.id/batch/fastBatch 2>&1 | timestamp.sh >> backup.log",
"/bin/sh -c curl https://*.go.id/batch/fastbatch 2>&1 | timestamp.sh >> backup.log", "/bin/sh -c curl https://*.go.id/batch/updateIkrap 2>&1 | timestamp.sh >> backup.log",
"/bin/sh -c curl https://*.go.id/batch/daily 2>&1 | timestamp.sh >> backup.log", "*https://api.*.kz/v3/kaseOrders/*", "*https://api.*.kz/v3/sendAmlRequest*",
"*/var/log/mco_push_log.log*", "*./luigi_start_job.sh*", "*go.id/batch/closingExam*", "*/var/www/html/*/wp-content/heatrisk/heatrisk.xml*",
"*/var/log1/cron_*.log*", "*/var/www/log/cron_xml.log*", "*https://qrcode.*.com/system/cron*", "*w=app/akasha/configuration/ExportDocumentsAsXml*",
"/bin/sh -c wget -O - -t 1 https://*/custom-api-server/hubspot/oauth/callback*", "*/var/log/*.log*", "*/var/log1/*.log*", "*wget*akasha*"
) or
process.command_line in (
"/bin/sh -c /usr/bin/flock -n /dev/shm/loadwatch.lock -c /usr/local/lp/bin/loadwatch &> /dev/null",
"/bin/sh -c curl -L https://chef.io/chef/install.sh | bash", "sh -c ldd /usr/bin/mkfifo 2>&1",
"/bin/bash -c curl -fs https://get.upwind.io/sensor.sh | bash -s -- upgrade",
"/bin/bash -c curl -s https://get.upwind.io/sensor.sh | bash -s -- upgrade",
"/bin/sh -c /opt/arcsight/backup_local/backup.sh || /opt/arcsight/backup_local/backup_error.sh",
"""/usr/bin/sh -c echo date=$(date +"%Y%m%d") > /dev/shm/mag/sptwweb.env""",
"/bin/sh -c /usr/bin/find /dev/shm/munin/mtsms/http -type f -mmin +15 -delete",
"/bin/sh -c echo 'LW_APP_CRONTAB' | php /itops/nginx/html/lwjk_app/bin/manager process-console/listen 2>&1"
) or
process.args like (
"[ ! -e *", "ansible *", "php -q /var/www/*php > /tmp/datastore*", "wget --proxy=off*cat*batch_trigger.log",
"sudo curl*raw.githubusercontent.com/*/backup-scripts/refs/heads/main/fortigate-backup.sh*",
"/usr/bin/curl -s -H*zendesk.com/api/v2/ticket_metrics.json*", "export PM2_HOME=*",
"/usr/bin/curl*/var/log/checkdiskusage.log", "ps*/opt/fortinet/fortisiem/linux-agent/tmp/*",
"flock*/tmp/edl.lock*"
) or
process.working_directory like "/opt/nessus_agent/*"
)
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | in |
| field:"process.args" kind:in |
process.command_line | regex_match |
| field:"CommandLine" kind:regex_match |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.name | in |
| field:"process_basename" kind:in |
process.parent.name | in |
| field:"parent_process_basename" kind:in |
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | wildcard | [ ! -e *, ansible *, php -q /var/www/*php > /tmp/datastore*, wget --proxy=off*cat*batch_trigger.log, sudo curl*raw.githubusercontent.com/*/backup-scripts/refs/heads/main/fortigate-backup.sh*, /usr/bin/curl -s -H*zendesk.com/api/v2/ticket_metrics.json*, export PM2_HOME=*, /usr/bin/curl*/var/log/checkdiskusage.log, ps*/opt/fortinet/fortisiem/linux-agent/tmp/*, flock*/tmp/edl.lock* | excludes:process.args |
process.command_line | in | /bin/bash -c curl -fs https://get.upwind.io/sensor.sh | bash -s -- upgrade, /bin/bash -c curl -s https://get.upwind.io/sensor.sh | bash -s -- upgrade, /bin/sh -c /opt/arcsight/backup_local/backup.sh || /opt/arcsight/backup_local/backup_error.sh, /bin/sh -c /usr/bin/find /dev/shm/munin/mtsms/http -type f -mmin +15 -delete, /bin/sh -c /usr/bin/flock -n /dev/shm/loadwatch.lock -c /usr/local/lp/bin/loadwatch &> /dev/null, /bin/sh -c curl -L https://chef.io/chef/install.sh | bash, /bin/sh -c echo 'LW_APP_CRONTAB' | php /itops/nginx/html/lwjk_app/bin/manager process-console/listen 2>&1, /usr/bin/sh -c echo date=$(date +"%Y%m%d") > /dev/shm/mag/sptwweb.env, sh -c ldd /usr/bin/mkfifo 2>&1 | excludes:process.command_line |
process.command_line | wildcard | *localhost*, *127.0.0.1*, *>*/run/*.pid, *>*/tmp/*.log*, */etc/init.d/mailman*, /bin/sh -c /var/www/MISP/app/Console/*> /tmp/cronlog 2>&1, /bin/bash -c echo "" > /tmp/stdout && echo "" > /tmp/stderr, /bin/sh -c /usr/bin/curl -s http://scripts.*.lan:8080/*, /bin/sh -c echo "Define current_date $(date -I)" > /var/www/current_date.conf; service apache2 reload, *api.github.com/meta*, */opt/commvault/*, /bin/sh -c curl -s https://tools.*.ch/vuls.sh | bash -s, /bin/sh -c curl -ks https://*:7443/users/heartbeat > /dev/null || exit 1, *test*, *grep*, *logger*, /bin/sh -c curl --user*.log, /bin/sh -c /dev/shm/pty3 > /dev/null 2>&1 &, /bin/sh -c*backup.sh*logToFile.sh, /bin/sh -c /home/*/sub/backup-archivelogs.sh*, */usr/bin/curl -s https://check.torproject.org/torbulkexitlist*, */run/cloud-init/share/*.sock*, sh -c ldd /var/tmp/dracut*/initramfs/usr/bin/mkfifo*, *cpanel*.zendesk.com/api/v2/ticket_metrics.json*, *fortigate-backup.sh*hc-ping.com*, /bin/sh -c curl -sSL https://*/scripts/linux/syslog-archival/report_syslog_v3.sh | bash -x > /var/log/report_syslog_v3.debug.out 2>&1, /bin/sh -c curl -s https://*/retrieve-validca.sh | bash -s /data/certificate > /data/log/valica.log 2>&1 && supervisorctl apache2 reload >>/data/log/valica.log 2>&1, /bin/sh -c echo $(date) >> /var/log/pay/epgw_log.txt;/usr/bin/curl*, /bin/sh -c wget -q -O - https://*.com/wp-cron.php?doing_wp_cron, /bin/sh -c wget -q -O /dev/null "https://*/v2/index.php?route=cron/recurring&platform_id=1", /bin/sh -c docker exec*/bin/bash -c '/bin/rm /opt/flink/core.*' 2>/dev/null, /bin/sh -c /home/cronjob/proses_sap_mm_einvoice.sh || bash /var/cartenz/send_notify.sh "$(/home/cronjob/proses_sap_mm_einvoice.sh 2>&1)", /bin/sh -c /usr/bin/wget https://www.*/modules/mod_fewo_uploader/mod_fewo_uploader_cronjob.php >/private-backup/scripte/logs/mod_fewo_uploader_cronjob.log 2>&1, *ec/tr/docflow/logs/tc.session.expire*, *scripts/redeploy_disconnected_worker_autostore.log*, *https://10.*.36/api/v0/devices/*, *https://*/index.php/ccm/system/jobs/run_single?auth=*, *var/www/html/ess/cronjob/notifikasi.sh*, *http://*/software/*/appserver_updates.sh*, *home/*/wnt/backups/postgres_dump*.sql*, /bin/sh -c /usr/bin/curl -s https://automailer.bgss.in/sendMail >> /var/log/automailer.log 2>&1, /bin/sh -c /usr/bin/curl -s https://compliancehub.bgss.in/fetch >> /var/log/compliancehub.log 2>&1, *var/www/html/ess/cronjob/*, *https://10.*.33:5665/v1/*, *https://10.*, *http://10.*, *var/cartenz/send_notify.sh*, *http://*.com/?wlmcron=*, *https://*/webstat/data/send_excel_lab.php*, */var/spool/threat-feed/threatfox_ip_port.csv*, /bin/sh -c curl https://*.go.id/batch/fastBatch 2>&1 | timestamp.sh >> backup.log, /bin/sh -c curl https://*.go.id/batch/fastbatch 2>&1 | timestamp.sh >> backup.log, /bin/sh -c curl https://*.go.id/batch/updateIkrap 2>&1 | timestamp.sh >> backup.log, /bin/sh -c curl https://*.go.id/batch/daily 2>&1 | timestamp.sh >> backup.log, *https://api.*.kz/v3/kaseOrders/*, *https://api.*.kz/v3/sendAmlRequest*, */var/log/mco_push_log.log*, *./luigi_start_job.sh*, *go.id/batch/closingExam*, */var/www/html/*/wp-content/heatrisk/heatrisk.xml*, */var/log1/cron_*.log*, */var/www/log/cron_xml.log*, *https://qrcode.*.com/system/cron*, *w=app/akasha/configuration/ExportDocumentsAsXml*, /bin/sh -c wget -O - -t 1 https://*/custom-api-server/hubspot/oauth/callback*, */var/log/*.log*, */var/log1/*.log*, *wget*akasha* | excludes:process.command_line |
process.working_directory | starts_with | /opt/nessus_agent/ | excludes:process.working_directory field:"process.working_directory" value:"/opt/nessus_agent/" |
Unusual High Denied Topic Blocks Detected
#Detects repeated compliance violation 'BLOCKED' actions coupled with specific policy name such as 'topic_policy', indicating persistent misuse or attempts to probe the model's denied topics.
Known False Positives
- New model deployments.
- Testing updates to compliance policies.
MITRE ATLAS Coverage
Adversarial-ML threat framework (not MITRE ATT&CK).
| Tactic | Techniques |
|---|---|
| Execution | |
| Privilege Escalation | |
| Defense Evasion |
Rule Body
[metadata]
creation_date = "2024/11/20"
integration = ["aws_bedrock"]
maturity = "production"
updated_date = "2025/11/10"
[rule]
author = ["Elastic"]
description = """
Detects repeated compliance violation 'BLOCKED' actions coupled with specific policy name such as 'topic_policy',
indicating persistent misuse or attempts to probe the model's denied topics.
"""
false_positives = ["New model deployments.", "Testing updates to compliance policies."]
from = "now-60m"
interval = "10m"
language = "esql"
license = "Elastic License v2"
name = "Unusual High Denied Topic Blocks Detected"
note = """## Triage and analysis
### Investigating Unusual High Denied Topic Blocks Detected
Amazon Bedrock Guardrail is a set of features within Amazon Bedrock designed to help businesses apply robust safety and privacy controls to their generative AI applications.
It enables users to set guidelines and filters that manage content quality, relevancy, and adherence to responsible AI practices.
Through Guardrail, organizations can define "denied topics" to prevent the model from generating content on specific, undesired subjects,
and they can establish thresholds for harmful content categories, including hate speech, violence, or offensive language.
#### Possible investigation steps
- Identify the user account that queried denied topics and whether it should perform this kind of action.
- Investigate other alerts associated with the user account during the past 48 hours.
- Consider the time of day. If the user is a human (not a program or script), did the activity take place during a normal time of day?
- Examine the account's prompts and responses in the last 24 hours.
- If you suspect the account has been compromised, scope potentially compromised assets by tracking Amazon Bedrock model access, prompts generated, and responses to the prompts by the account in the last 24 hours.
### False positive analysis
- Verify the user account that queried denied topics, is not testing any new model deployments or updated compliance policies in Amazon Bedrock guardrails.
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Disable or limit the account during the investigation and response.
- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
- Identify the account role in the cloud environment.
- Identify if the attacker is moving laterally and compromising other Amazon Bedrock Services.
- Identify any regulatory or legal ramifications related to this activity.
- Review the permissions assigned to the implicated user group or role behind these requests to ensure they are authorized and expected to access bedrock and ensure that the least privilege principle is being followed.
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = [
"https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html",
"https://atlas.mitre.org/techniques/AML.T0051",
"https://atlas.mitre.org/techniques/AML.T0054",
"https://www.elastic.co/security-labs/elastic-advances-llm-security",
]
risk_score = 47
rule_id = "266bbea8-fcf9-4b0e-ba7b-fc00f6b1dc73"
setup = """## Setup
This rule requires that guardrails are configured in AWS Bedrock. For more information, see the AWS Bedrock documentation:
https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.html
"""
severity = "medium"
tags = [
"Domain: LLM",
"Data Source: AWS Bedrock",
"Data Source: AWS S3",
"Use Case: Policy Violation",
"Mitre Atlas: T0051",
"Mitre Atlas: T0054",
"Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"
query = '''
from logs-aws_bedrock.invocation-*
// Expand multi-value policy name field
| mv_expand gen_ai.policy.name
| mv_expand gen_ai.policy.action
// Filter for blocked topic policy violations
| where
gen_ai.policy.action == "BLOCKED"
and gen_ai.compliance.violation_detected == "true"
and gen_ai.policy.name == "topic_policy"
// keep only user info
| keep user.id
// count how many times each user triggered a blocked topic policy
| stats
Esql.ml_policy_blocked_topic_count = count()
by user.id
// Filter for excessive violations
| where Esql.ml_policy_blocked_topic_count > 5
// sort highest to lowest
| sort Esql.ml_policy_blocked_topic_count desc
'''
Stages and Predicates
Stage 1: from
from logs-aws_bedrock.invocation-*
Stage 2: mv_expand
| mv_expand gen_ai.policy.name
Stage 3: mv_expand
| mv_expand gen_ai.policy.action
Stage 4: where
| where
gen_ai.policy.action == "BLOCKED"
and gen_ai.compliance.violation_detected == "true"
and gen_ai.policy.name == "topic_policy"
Stage 5: keep
| keep user.id
Stage 6: stats
| stats
Esql.ml_policy_blocked_topic_count = count()
by user.id
Stage 7: where
| where Esql.ml_policy_blocked_topic_count > 5
Stage 8: sort
| sort Esql.ml_policy_blocked_topic_count desc
Indicators
These rows show field, operator, and value matches.
Output Fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
Esql.ml_policy_blocked_topic_count | STATS Esql.ml_policy_blocked_topic_count = count() |
user.id | STATS BY |
Unusual Linux Process Discovery Activity
#Looks for commands related to system process discovery from an unusual user context. This can be due to uncommon troubleshooting activity or due to a compromised account. A compromised account may be used by a threat actor to engage in system process discovery in order to increase their understanding of software applications running on a target host or network. This may be a precursor to selection of a persistence mechanism or a method of privilege elevation.
Known False Positives
- Uncommon user command activity can be due to an engineer logging onto a server instance in order to perform manual troubleshooting or reconfiguration.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Rule Body
[metadata]
creation_date = "2020/09/03"
integration = ["auditd_manager", "endpoint"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"
[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = """
Looks for commands related to system process discovery from an unusual user context. This can be due to uncommon
troubleshooting activity or due to a compromised account. A compromised account may be used by a threat actor to engage
in system process discovery in order to increase their understanding of software applications running on a target host
or network. This may be a precursor to selection of a persistence mechanism or a method of privilege elevation.
"""
false_positives = [
"""
Uncommon user command activity can be due to an engineer logging onto a server instance in order to perform manual
troubleshooting or reconfiguration.
""",
]
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = ["v3_linux_system_process_discovery_ea"]
name = "Unusual Linux Process Discovery Activity"
setup = """## Setup
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
- Elastic Defend
- Auditd Manager
### Anomaly Detection Setup
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration to your system:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
### Auditd Manager Integration Setup
The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
Auditd Manager provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system.
#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Auditd Manager” and select the integration to see more details about it.
- Click “Add Auditd Manager”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “auditd manager” to an existing or a new agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).
#### Rule Specific Setup Note
Auditd Manager subscribes to the kernel and receives events as they occur without any additional configuration.
However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
- For this detection rule no additional audit rules are required.
"""
risk_score = 21
rule_id = "5c983105-4681-46c3-9890-0c66d05e776b"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Data Source: Elastic Defend",
"Data Source: Auditd Manager",
"Use Case: Threat Detection",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Tactic: Discovery",
"Resources: Investigation Guide",
]
type = "machine_learning"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Unusual Linux Process Discovery Activity
In Linux environments, process discovery commands help users and administrators understand active processes, aiding in system management and troubleshooting. However, adversaries can exploit these commands to map running applications, potentially identifying vulnerabilities for privilege escalation or persistence. The detection rule leverages machine learning to identify atypical usage patterns, flagging potential threats when process discovery occurs from unexpected user contexts, thus helping to preemptively mitigate risks associated with compromised accounts.
### Possible investigation steps
- Review the user context from which the process discovery command was executed to determine if the user account is expected to perform such actions.
- Check the command history for the user account to identify any other unusual or unauthorized commands executed around the same time.
- Analyze the process discovery command details, including the specific command used and its parameters, to understand the intent and scope of the activity.
- Investigate the source IP address and host from which the command was executed to verify if it aligns with known and authorized devices for the user.
- Examine recent authentication logs for the user account to identify any suspicious login attempts or anomalies in login patterns.
- Correlate the activity with any other alerts or logs that might indicate a broader attack pattern or compromise, such as privilege escalation attempts or lateral movement.
### False positive analysis
- System administrators performing routine maintenance or troubleshooting may trigger the rule. To manage this, create exceptions for known administrator accounts or specific maintenance windows.
- Automated scripts or monitoring tools that regularly check system processes can be mistaken for unusual activity. Identify these scripts and whitelist their execution context to prevent false alerts.
- New software installations or updates might involve process discovery commands as part of their setup. Monitor installation activities and temporarily adjust the rule sensitivity during these periods.
- Developers or power users who frequently use process discovery commands for legitimate purposes can be excluded by adding their user accounts to an exception list, ensuring their activities do not trigger false positives.
- Training or testing environments where process discovery is part of normal operations should be configured with separate rules or exceptions to avoid unnecessary alerts.
### Response and remediation
- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement by the threat actor.
- Terminate any suspicious processes identified during the investigation to halt potential malicious activity.
- Change passwords for the compromised account and any other accounts that may have been accessed using the same credentials to prevent further unauthorized access.
- Conduct a thorough review of system logs and user activity to identify any additional signs of compromise or unauthorized access attempts.
- Restore the system from a known good backup if any malicious modifications or persistence mechanisms are detected.
- Implement additional monitoring on the affected system and similar environments to detect any recurrence of unusual process discovery activity.
- Escalate the incident to the security operations team for further analysis and to determine if broader organizational impacts need to be addressed."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1057"
name = "Process Discovery"
reference = "https://attack.mitre.org/techniques/T1057/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
Unusual Linux User Discovery Activity
#Looks for commands related to system user or owner discovery from an unusual user context. This can be due to uncommon troubleshooting activity or due to a compromised account. A compromised account may be used to engage in system owner or user discovery in order to identify currently active or primary users of a system. This may be a precursor to additional discovery, credential dumping or privilege elevation activity.
Known False Positives
- Uncommon user command activity can be due to an engineer logging onto a server instance in order to perform manual troubleshooting or reconfiguration.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Rule Body
[metadata]
creation_date = "2020/09/03"
integration = ["auditd_manager", "endpoint"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"
[rule]
anomaly_threshold = 75
author = ["Elastic"]
description = """
Looks for commands related to system user or owner discovery from an unusual user context. This can be due to uncommon
troubleshooting activity or due to a compromised account. A compromised account may be used to engage in system owner or
user discovery in order to identify currently active or primary users of a system. This may be a precursor to additional
discovery, credential dumping or privilege elevation activity.
"""
false_positives = [
"""
Uncommon user command activity can be due to an engineer logging onto a server instance in order to perform manual
troubleshooting or reconfiguration.
""",
]
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = ["v3_linux_system_user_discovery_ea"]
name = "Unusual Linux User Discovery Activity"
setup = """## Setup
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
- Elastic Defend
- Auditd Manager
### Anomaly Detection Setup
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration to your system:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
### Auditd Manager Integration Setup
The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
Auditd Manager provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system.
#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Auditd Manager” and select the integration to see more details about it.
- Click “Add Auditd Manager”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “auditd manager” to an existing or a new agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).
#### Rule Specific Setup Note
Auditd Manager subscribes to the kernel and receives events as they occur without any additional configuration.
However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
- For this detection rule no additional audit rules are required.
"""
risk_score = 21
rule_id = "59756272-1998-4b8c-be14-e287035c4d10"
severity = "low"
tags = [
"Domain: Endpoint",
"OS: Linux",
"Data Source: Elastic Defend",
"Data Source: Auditd Manager",
"Use Case: Threat Detection",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Tactic: Discovery",
"Resources: Investigation Guide",
]
type = "machine_learning"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Unusual Linux User Discovery Activity
In Linux environments, user discovery commands help identify active users and system owners, crucial for system management. However, adversaries exploit this by executing these commands from atypical user contexts, often indicating account compromise. The detection rule leverages machine learning to identify anomalies in user discovery activities, flagging potential threats for further investigation.
### Possible investigation steps
- Review the alert details to identify the specific user account and the command executed that triggered the alert.
- Check the login history and session details for the identified user account to determine if the activity aligns with their typical behavior or if it appears suspicious.
- Investigate the source IP address and hostname associated with the user session to verify if they are known and trusted within the organization.
- Examine recent changes to user permissions or group memberships for the identified account to detect any unauthorized modifications.
- Look for any additional unusual or unexpected commands executed by the same user account around the time of the alert to identify potential follow-up malicious activities.
- Correlate the alert with other security events or logs, such as authentication logs or network traffic, to gather more context and assess the scope of the potential compromise.
### False positive analysis
- System administrators performing routine checks may trigger the rule. To manage this, create exceptions for known admin accounts executing user discovery commands during regular maintenance windows.
- Automated scripts or monitoring tools that run user discovery commands can cause false positives. Identify these scripts and whitelist their execution paths or user accounts.
- Developers or IT staff conducting legitimate troubleshooting might be flagged. Document these activities and exclude specific user accounts or IP addresses from the rule.
- Scheduled tasks or cron jobs that include user discovery commands could be misinterpreted as threats. Review and exclude these tasks from the detection rule to prevent unnecessary alerts.
### Response and remediation
- Isolate the affected system from the network to prevent further unauthorized access or lateral movement by the adversary.
- Terminate any suspicious processes associated with the unusual user discovery activity to halt potential malicious actions.
- Conduct a thorough review of the affected user account's recent activities and access logs to identify any unauthorized changes or access.
- Reset the credentials of the compromised account and any other accounts that may have been accessed using the compromised credentials.
- Implement additional monitoring on the affected system and user accounts to detect any further suspicious activities or attempts to regain access.
- Escalate the incident to the security operations team for a deeper investigation into potential related threats, such as credential dumping or privilege escalation attempts.
- Review and update access controls and permissions to ensure that only authorized users have access to sensitive systems and data, reducing the risk of future compromises."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1033"
name = "System Owner/User Discovery"
reference = "https://attack.mitre.org/techniques/T1033/"
[rule.threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
Unusual Login Activity
#Identifies an unusually high number of authentication attempts.
Known False Positives
- Security audits may trigger this alert. Conditions that generate bursts of failed logins, such as misconfigured applications or account lockouts could trigger this alert.
MITRE ATT&CK Coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Rule Body
[metadata]
creation_date = "2020/03/25"
integration = ["auditd_manager", "endpoint", "system"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"
[rule]
anomaly_threshold = 50
author = ["Elastic"]
description = "Identifies an unusually high number of authentication attempts."
false_positives = [
"""
Security audits may trigger this alert. Conditions that generate bursts of failed logins, such as misconfigured
applications or account lockouts could trigger this alert.
""",
]
from = "now-45m"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "suspicious_login_activity_ea"
name = "Unusual Login Activity"
setup = """## Setup
This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
- Elastic Defend
- Auditd Manager
- System
### Anomaly Detection Setup
Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).
### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
#### The following steps should be executed in order to add the Elastic Defend integration to your system:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
- Click "Save and Continue".
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
### Auditd Manager Integration Setup
The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
Auditd Manager provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system.
#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “Auditd Manager” and select the integration to see more details about it.
- Click “Add Auditd Manager”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “auditd manager” to an existing or a new agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).
#### Rule Specific Setup Note
Auditd Manager subscribes to the kernel and receives events as they occur without any additional configuration.
However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
- For this detection rule no additional audit rules are required.
### System Integration Setup
The System integration allows you to collect system logs and metrics from your servers with Elastic Agent.
#### The following steps should be executed in order to add the Elastic Agent System integration "system" to your system:
- Go to the Kibana home page and click “Add integrations”.
- In the query bar, search for “System” and select the integration to see more details about it.
- Click “Add System”.
- Configure the integration name and optionally add a description.
- Review optional and advanced settings accordingly.
- Add the newly installed “system” to an existing or a new agent policy, and deploy the agent on your system from which system log files are desirable.
- Click “Save and Continue”.
- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/system).
"""
references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
risk_score = 21
rule_id = "4330272b-9724-4bc6-a3ca-f1532b81e5c2"
severity = "low"
tags = [
"Data Source: Elastic Defend",
"Data Source: Auditd Manager",
"Data Source: Windows Security Event Logs",
"Use Case: Identity and Access Audit",
"Use Case: Threat Detection",
"Rule Type: ML",
"Rule Type: Machine Learning",
"Tactic: Credential Access",
"Resources: Investigation Guide",
]
type = "machine_learning"
note = """## Triage and analysis
> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
### Investigating Unusual Login Activity
The 'Unusual Login Activity' detection leverages machine learning to identify anomalies in authentication patterns, flagging potential brute force attacks. Adversaries exploit credential access by attempting numerous logins to gain unauthorized entry. This rule assesses login frequency and patterns, alerting analysts to deviations indicative of credential abuse, thus enhancing threat detection and identity audit processes.
### Possible investigation steps
- Review the source IP addresses associated with the unusual login attempts to determine if they are known or suspicious.
- Check the user accounts involved in the alert for any recent changes or unusual activity, such as password resets or privilege escalations.
- Analyze the timestamps of the login attempts to identify patterns or timeframes that may indicate automated or scripted attacks.
- Correlate the login attempts with other security events or logs to identify any concurrent suspicious activities, such as failed login attempts or access to sensitive resources.
- Investigate the geographic locations of the login attempts to see if they align with the user's typical login behavior or if they suggest potential compromise.
- Assess the risk score and severity of the alert in the context of the organization's security posture and any ongoing threats or incidents.
### False positive analysis
- High login activity from automated scripts or scheduled tasks can trigger false positives. Identify and whitelist these known scripts to prevent unnecessary alerts.
- Employees using shared accounts may cause an increase in login attempts. Implement user-specific accounts and monitor shared account usage to reduce false positives.
- Frequent logins from IT personnel conducting routine maintenance can be misinterpreted as unusual activity. Exclude these users or adjust thresholds for specific roles to minimize false alerts.
- Users with legitimate reasons for high login frequency, such as customer support staff, should be identified and their activity patterns analyzed to adjust detection parameters accordingly.
- Remote workers using VPNs or accessing systems from multiple locations might trigger alerts. Consider location-based exceptions for known remote access points to avoid false positives.
### Response and remediation
- Immediately isolate the affected user accounts to prevent further unauthorized access and contain the threat.
- Reset passwords for the compromised accounts and enforce multi-factor authentication (MFA) to enhance security.
- Conduct a thorough review of recent login activity and access logs to identify any unauthorized access or data exfiltration.
- Notify the security operations team to monitor for any further suspicious activity and ensure continuous surveillance of the affected systems.
- Escalate the incident to the incident response team if there is evidence of data compromise or if the attack persists despite initial containment efforts.
- Implement additional monitoring rules to detect similar brute force attempts in the future, focusing on login frequency and patterns.
- Review and update access controls and authentication policies to prevent recurrence, ensuring they align with best practices for credential security."""
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1110"
name = "Brute Force"
reference = "https://attack.mitre.org/techniques/T1110/"
[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"