Detection rules › Elastic
Security Tooling Enumeration
Detects a sequence where the same parent process executes several distinct "systemctl", "service", "chkconfig", "grep", "egrep", or "pgrep" commands to check for known security tooling within 3 seconds. Repeated identical command lines are de-duplicated, helping identify rapid multi-command security software discovery rather than a single enumeration attempt.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Rule body
[rule]
description = """
Detects a sequence where the same parent process executes several distinct "systemctl", "service", "chkconfig", "grep",
"egrep", or "pgrep" commands to check for known security tooling within 3 seconds. Repeated identical command lines are
de-duplicated, helping identify rapid multi-command security software discovery rather than a single enumeration
attempt.
"""
id = "9de52bd9-0537-4b2c-a3ba-34c3c3ffd855"
license = "Elastic License v2"
name = "Security Tooling Enumeration"
os_list = ["linux"]
version = "1.0.4"
query = '''
sequence by process.parent.entity_id with maxspan=3s
[process where event.type == "start" and event.action == "exec" and process.parent.executable != null and
(
process.name in ("service", "chkconfig", "grep", "egrep", "pgrep") or
process.name == "systemctl" and process.args in ("is-enabled", "show", "is-active", "status", "list-units")
) and
process.args in (
"avast", "bdsec", "cylancesvc", "cyoptics", "cbsensor", "cpla", "itsm", "cloudmonitor", "falcon-sensor", "cybereason-sensor",
"elastic-agent", "sraagent", "eraagent", "eea", "eea-user-agent", "xagt", "keeperx", "kesl", "klnagent64", "kesl-supervisor",
"kics", "kess", "rocketcyber", "limacharlie", "lr-agent.logrhythm", "MFEcma", "mdatp", "osqueryd", "traps_pmd", "ir_agent",
"armor", "sophoslinuxsensor", "sophos-spl", "otelcol-sumo", "ds_agent", "titanagent", "taniumclient", "oneavd", "mbdaemon",
"wazuh-agent", "emit_scand_service", "f-secure-linuxsecurity-activate"
) and not (
process.parent.executable in (
"/opt/puppetlabs/puppet/bin/ruby", "/opt/puppetlabs/puppet/bin/puppet", "/opt/sophos-spl/base/bin/SulDownloader",
"/usr/local/manageengine/uems_agent/bin/dctaskengine", "/usr/bin/newrelic-infra", "/usr/bin/puppet",
"/usr/lib64/nagios/plugins/check_agents", "/opt/chef/bin/chef-client", "/opt/chef/embedded/bin/ruby",
"/usr/local/manageengine/uems_agent/bin/dcinventory", "/opt/scripts/puppet/puppetrun", "/usr/bin/chef-client"
) or
process.parent.executable like (
"/opt/sophos-spl/base/bin/SulDownloader.*", "/opt/rapid7/ir_agent/components/bootstrap/*/bootstrap_upgrader",
"/usr/local/rapid7/ir_agent/components/bootstrap/*/bootstrap_upgrader", "/tmp/newroot/opt/chef/bin/chef-client",
"/usr/lib/venv-salt-minion/bin/python.original", "/etc/checkpoint/common/install_offline.sh"
) or
process.parent.args like (
"/usr/lib/nagios/plugins/check_agents", "/usr/bin/puppet", "/home/*/.ansible/tmp/ansible-tmp-*/AnsiballZ_*.py",
"/root/.ansible/tmp/ansible-tmp-*/AnsiballZ_*.py", "/var/tmp/rpm-tmp*", "/var/lib/dpkg/info/cybereason-sensor.prerm",
"/var/lib/dpkg/info/mdatp.postinst"
) or
(process.parent.name like "python*" and process.parent.command_line like "*mitogen*") or
(process.parent.executable like "/usr/bin/python*" and process.args == "otelcol-sumo" and process.args == "show") or
(
(
process.working_directory == "/var/ossec" or
process.parent.executable in ("/var/lib/dpkg/tmp.ci/preinst", "/var/lib/dpkg/info/wazuh-agent.prerm")
) and
process.args == "wazuh-agent"
) and not process.args == "disable"
)] as event0
[process where event.type == "start" and event.action == "exec" and
(
process.name in ("service", "chkconfig", "grep", "egrep", "pgrep") or
process.name == "systemctl" and process.args in ("is-enabled", "show", "is-active", "status", "list-units")
) and
not startswith~(process.command_line, event0.process.command_line) and
process.args in (
"avast", "bdsec", "cylancesvc", "cyoptics", "cbsensor", "cpla", "itsm", "cloudmonitor", "falcon-sensor", "cybereason-sensor",
"elastic-agent", "sraagent", "eraagent", "eea", "eea-user-agent", "xagt", "keeperx", "kesl", "klnagent64", "kesl-supervisor",
"kics", "kess", "rocketcyber", "limacharlie", "lr-agent.logrhythm", "MFEcma", "mdatp", "osqueryd", "traps_pmd", "ir_agent",
"armor", "sophoslinuxsensor", "sophos-spl", "otelcol-sumo", "ds_agent", "titanagent", "taniumclient", "oneavd", "mbdaemon",
"wazuh-agent", "emit_scand_service", "f-secure-linuxsecurity-activate"
)] as event1
[process where event.type == "start" and event.action == "exec" and
(
process.name in ("service", "chkconfig", "grep", "egrep", "pgrep") or
process.name == "systemctl" and process.args in ("is-enabled", "show", "is-active", "status", "list-units")
) and
not (startswith~(process.command_line, event0.process.command_line) or startswith~(process.command_line, event1.process.command_line)) and
process.args in (
"avast", "bdsec", "cylancesvc", "cyoptics", "cbsensor", "cpla", "itsm", "cloudmonitor", "falcon-sensor", "cybereason-sensor",
"elastic-agent", "sraagent", "eraagent", "eea", "eea-user-agent", "xagt", "keeperx", "kesl", "klnagent64", "kesl-supervisor",
"kics", "kess", "rocketcyber", "limacharlie", "lr-agent.logrhythm", "MFEcma", "mdatp", "osqueryd", "traps_pmd", "ir_agent",
"armor", "sophoslinuxsensor", "sophos-spl", "otelcol-sumo", "ds_agent", "titanagent", "taniumclient", "oneavd", "mbdaemon",
"wazuh-agent", "emit_scand_service", "f-secure-linuxsecurity-activate"
)]
'''
min_endpoint_version = "8.4.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[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 = 1
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 2
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1518"
name = "Software Discovery"
reference = "https://attack.mitre.org/techniques/T1518/"
[[threat.technique.subtechnique]]
id = "T1518.001"
name = "Security Software Discovery"
reference = "https://attack.mitre.org/techniques/T1518/001/"
[threat.tactic]
id = "TA0007"
name = "Discovery"
reference = "https://attack.mitre.org/tactics/TA0007/"
[internal]
min_endpoint_version = "8.4.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 3s, correlated by process.parent.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "exec" and process.parent.executable != null and
(
process.name in ("service", "chkconfig", "grep", "egrep", "pgrep") or
process.name == "systemctl" and process.args in ("is-enabled", "show", "is-active", "status", "list-units")
) and
process.args in (
"avast", "bdsec", "cylancesvc", "cyoptics", "cbsensor", "cpla", "itsm", "cloudmonitor", "falcon-sensor", "cybereason-sensor",
"elastic-agent", "sraagent", "eraagent", "eea", "eea-user-agent", "xagt", "keeperx", "kesl", "klnagent64", "kesl-supervisor",
"kics", "kess", "rocketcyber", "limacharlie", "lr-agent.logrhythm", "MFEcma", "mdatp", "osqueryd", "traps_pmd", "ir_agent",
"armor", "sophoslinuxsensor", "sophos-spl", "otelcol-sumo", "ds_agent", "titanagent", "taniumclient", "oneavd", "mbdaemon",
"wazuh-agent", "emit_scand_service", "f-secure-linuxsecurity-activate"
) and not (
process.parent.executable in (
"/opt/puppetlabs/puppet/bin/ruby", "/opt/puppetlabs/puppet/bin/puppet", "/opt/sophos-spl/base/bin/SulDownloader",
"/usr/local/manageengine/uems_agent/bin/dctaskengine", "/usr/bin/newrelic-infra", "/usr/bin/puppet",
"/usr/lib64/nagios/plugins/check_agents", "/opt/chef/bin/chef-client", "/opt/chef/embedded/bin/ruby",
"/usr/local/manageengine/uems_agent/bin/dcinventory", "/opt/scripts/puppet/puppetrun", "/usr/bin/chef-client"
) or
process.parent.executable like (
"/opt/sophos-spl/base/bin/SulDownloader.*", "/opt/rapid7/ir_agent/components/bootstrap/*/bootstrap_upgrader",
"/usr/local/rapid7/ir_agent/components/bootstrap/*/bootstrap_upgrader", "/tmp/newroot/opt/chef/bin/chef-client",
"/usr/lib/venv-salt-minion/bin/python.original", "/etc/checkpoint/common/install_offline.sh"
) or
process.parent.args like (
"/usr/lib/nagios/plugins/check_agents", "/usr/bin/puppet", "/home/*/.ansible/tmp/ansible-tmp-*/AnsiballZ_*.py",
"/root/.ansible/tmp/ansible-tmp-*/AnsiballZ_*.py", "/var/tmp/rpm-tmp*", "/var/lib/dpkg/info/cybereason-sensor.prerm",
"/var/lib/dpkg/info/mdatp.postinst"
) or
(process.parent.name like "python*" and process.parent.command_line like "*mitogen*") or
(process.parent.executable like "/usr/bin/python*" and process.args == "otelcol-sumo" and process.args == "show") or
(
(
process.working_directory == "/var/ossec" or
process.parent.executable in ("/var/lib/dpkg/tmp.ci/preinst", "/var/lib/dpkg/info/wazuh-agent.prerm")
) and
process.args == "wazuh-agent"
) and not process.args == "disable"
)] as event0
Stage 2: process
[process where event.type == "start" and event.action == "exec" and
(
process.name in ("service", "chkconfig", "grep", "egrep", "pgrep") or
process.name == "systemctl" and process.args in ("is-enabled", "show", "is-active", "status", "list-units")
) and
not startswith~(process.command_line, event0.process.command_line) and
process.args in (
"avast", "bdsec", "cylancesvc", "cyoptics", "cbsensor", "cpla", "itsm", "cloudmonitor", "falcon-sensor", "cybereason-sensor",
"elastic-agent", "sraagent", "eraagent", "eea", "eea-user-agent", "xagt", "keeperx", "kesl", "klnagent64", "kesl-supervisor",
"kics", "kess", "rocketcyber", "limacharlie", "lr-agent.logrhythm", "MFEcma", "mdatp", "osqueryd", "traps_pmd", "ir_agent",
"armor", "sophoslinuxsensor", "sophos-spl", "otelcol-sumo", "ds_agent", "titanagent", "taniumclient", "oneavd", "mbdaemon",
"wazuh-agent", "emit_scand_service", "f-secure-linuxsecurity-activate"
)] as event1
Stage 3: process
[process where event.type == "start" and event.action == "exec" and
(
process.name in ("service", "chkconfig", "grep", "egrep", "pgrep") or
process.name == "systemctl" and process.args in ("is-enabled", "show", "is-active", "status", "list-units")
) and
not (startswith~(process.command_line, event0.process.command_line) or startswith~(process.command_line, event1.process.command_line)) and
process.args in (
"avast", "bdsec", "cylancesvc", "cyoptics", "cbsensor", "cpla", "itsm", "cloudmonitor", "falcon-sensor", "cybereason-sensor",
"elastic-agent", "sraagent", "eraagent", "eea", "eea-user-agent", "xagt", "keeperx", "kesl", "klnagent64", "kesl-supervisor",
"kics", "kess", "rocketcyber", "limacharlie", "lr-agent.logrhythm", "MFEcma", "mdatp", "osqueryd", "traps_pmd", "ir_agent",
"armor", "sophoslinuxsensor", "sophos-spl", "otelcol-sumo", "ds_agent", "titanagent", "taniumclient", "oneavd", "mbdaemon",
"wazuh-agent", "emit_scand_service", "f-secure-linuxsecurity-activate"
)]
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | disable | excludes:process.args field:"process.args" value:"disable" |
process.parent.executable | in | /var/lib/dpkg/info/wazuh-agent.prerm, /var/lib/dpkg/tmp.ci/preinst | excludes:process.parent.executable field:"process.parent.executable" value:"/var/lib/dpkg/info/wazuh-agent.prerm" field:"process.parent.executable" value:"/var/lib/dpkg/tmp.ci/preinst" |
process.working_directory | eq | /var/ossec | excludes:process.working_directory field:"process.working_directory" value:"/var/ossec" |
process.args | eq | wazuh-agent | excludes:process.args field:"process.args" value:"wazuh-agent" |
process.args | eq | otelcol-sumo | excludes:process.args field:"process.args" value:"otelcol-sumo" |
process.args | eq | show | excludes:process.args field:"process.args" value:"show" |
process.parent.executable | starts_with | /usr/bin/python | excludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/python" |
process.parent.command_line | match | mitogen | excludes:process.parent.command_line field:"process.parent.command_line" value:"mitogen" |
process.parent.name | starts_with | python | excludes:process.parent.name field:"process.parent.name" value:"python" |
process.parent.args | wildcard | /usr/lib/nagios/plugins/check_agents, /usr/bin/puppet, /home/*/.ansible/tmp/ansible-tmp-*/AnsiballZ_*.py, /root/.ansible/tmp/ansible-tmp-*/AnsiballZ_*.py, /var/tmp/rpm-tmp*, /var/lib/dpkg/info/cybereason-sensor.prerm, /var/lib/dpkg/info/mdatp.postinst | excludes:process.parent.args |
process.parent.executable | in | /opt/chef/bin/chef-client, /opt/chef/embedded/bin/ruby, /opt/puppetlabs/puppet/bin/puppet, /opt/puppetlabs/puppet/bin/ruby, /opt/scripts/puppet/puppetrun, /opt/sophos-spl/base/bin/SulDownloader, /usr/bin/chef-client, /usr/bin/newrelic-infra, /usr/bin/puppet, /usr/lib64/nagios/plugins/check_agents, /usr/local/manageengine/uems_agent/bin/dcinventory, /usr/local/manageengine/uems_agent/bin/dctaskengine | excludes:process.parent.executable |
process.parent.executable | wildcard | /opt/sophos-spl/base/bin/SulDownloader.*, /opt/rapid7/ir_agent/components/bootstrap/*/bootstrap_upgrader, /usr/local/rapid7/ir_agent/components/bootstrap/*/bootstrap_upgrader, /tmp/newroot/opt/chef/bin/chef-client, /usr/lib/venv-salt-minion/bin/python.original, /etc/checkpoint/common/install_offline.sh | excludes:process.parent.executable |
process.command_line | starts_with | event0.process.command_line | excludes:process.command_line field:"process.command_line" value:"event0.process.command_line" |
process.command_line | starts_with | event1.process.command_line | excludes:process.command_line field:"process.command_line" value:"event1.process.command_line" |
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:"disable" |
process.args | in |
| field:"process.args" kind:in |
process.name | eq |
| field:"process_name" kind:eq value:"systemctl" |
process.name | in |
| field:"process_name" kind:in |
process.parent.executable | is_not_null | field:"ParentImage" kind:is_not_null |