Detection rules › Elastic

Security Tooling Enumeration

Time window
3s
Sequence by
process.parent.entity_id
Source
github.com/elastic/protections-artifacts

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

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.

FieldKindExcluded valuesSearch
process.argseqdisableexcludes:process.args field:"process.args" value:"disable"
process.parent.executablein/var/lib/dpkg/info/wazuh-agent.prerm, /var/lib/dpkg/tmp.ci/preinstexcludes: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_directoryeq/var/ossecexcludes:process.working_directory field:"process.working_directory" value:"/var/ossec"
process.argseqwazuh-agentexcludes:process.args field:"process.args" value:"wazuh-agent"
process.argseqotelcol-sumoexcludes:process.args field:"process.args" value:"otelcol-sumo"
process.argseqshowexcludes:process.args field:"process.args" value:"show"
process.parent.executablestarts_with/usr/bin/pythonexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/python"
process.parent.command_linematchmitogenexcludes:process.parent.command_line field:"process.parent.command_line" value:"mitogen"
process.parent.namestarts_withpythonexcludes:process.parent.name field:"process.parent.name" value:"python"
process.parent.argswildcard/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.postinstexcludes:process.parent.args
process.parent.executablein/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/dctaskengineexcludes:process.parent.executable
process.parent.executablewildcard/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.shexcludes:process.parent.executable
process.command_linestarts_withevent0.process.command_lineexcludes:process.command_line field:"process.command_line" value:"event0.process.command_line"
process.command_linestarts_withevent1.process.command_lineexcludes:process.command_line field:"process.command_line" value:"event1.process.command_line"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argseq
  • disable
field:"process.args" kind:eq value:"disable"
process.argsin
  • MFEcma
  • armor
  • avast
  • bdsec
  • cbsensor
  • cloudmonitor
  • cpla
  • cybereason-sensor
  • cylancesvc
  • cyoptics
  • ds_agent
  • eea
  • eea-user-agent
  • elastic-agent
  • emit_scand_service
  • eraagent
  • f-secure-linuxsecurity-activate
  • falcon-sensor
  • ir_agent
  • is-active
  • is-enabled
  • itsm
  • keeperx
  • kesl
  • kesl-supervisor
  • kess
  • kics
  • klnagent64
  • limacharlie
  • list-units
  • lr-agent.logrhythm
  • mbdaemon
  • mdatp
  • oneavd
  • osqueryd
  • otelcol-sumo
  • rocketcyber
  • show
  • sophos-spl
  • sophoslinuxsensor
  • sraagent
  • status
  • taniumclient
  • titanagent
  • traps_pmd
  • wazuh-agent
  • xagt
field:"process.args" kind:in
process.nameeq
  • systemctl
field:"process_name" kind:eq value:"systemctl"
process.namein
  • chkconfig
  • egrep
  • grep
  • pgrep
  • service
field:"process_name" kind:in
process.parent.executableis_not_null
  • (no value, null check)
field:"ParentImage" kind:is_not_null