Detection rules › Elastic
Auditctl Disabled via Shell Process
Detects when auditctl is executed with the -e 0 option to disable auditing via a shell process. Malware is seen to disable auditing to avoid detection and to cover its tracks.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Rule body
[rule]
description = """
Detects when auditctl is executed with the `-e 0` option to disable auditing via a shell process. Malware is seen to
disable auditing to avoid detection and to cover its tracks.
"""
id = "36a8d397-7fef-4bdf-9152-71c750168580"
license = "Elastic License v2"
name = "Auditctl Disabled via Shell Process"
os_list = ["linux"]
version = "1.0.4"
query = '''
process where event.type == "start" and event.action == "exec" and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and process.args == "-c" and
process.command_line like "*auditctl *-e*0*" and not (
process.parent.name == "sudo" or
(process.parent.name like ("python3*", "platform-python3*") and process.args like "declare*")
)
'''
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 = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"
[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 in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and process.args == "-c" and
process.command_line like "*auditctl *-e*0*" and not (
process.parent.name == "sudo" or
(process.parent.name like ("python3*", "platform-python3*") and process.args like "declare*")
)
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | starts_with | declare | excludes:process.args field:"process.args" value:"declare" |
process.parent.name | starts_with | python3, platform-python3 | excludes:process.parent.name field:"process.parent.name" value:"python3" field:"process.parent.name" value:"platform-python3" |
process.parent.name | eq | sudo | excludes:process.parent.name field:"process.parent.name" value:"sudo" |
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 | eq |
| field:"process.args" kind:eq value:"-c" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:"*auditctl *-e*0*" |
process.name | in |
| field:"process_name" kind:in |