Skip to content
Threat Feed
medium advisory

Detection of Security Software Discovery via Grep on macOS and Linux

Attackers utilize standard command-line tools like grep and pgrep to enumerate installed security software on macOS and Linux, enabling situational awareness for post-compromise activity.

Post-compromise activity frequently involves situational awareness, where attackers attempt to identify the security posture of an infected host. On macOS and Linux environments, this is often achieved by searching process lists or security software configuration files for indicators of known antivirus, EDR, or firewall solutions. The use of native utilities like grep, egrep, and pgrep to filter for common security tool names (e.g., ESET, Sophos, SentinelOne, McAfee) allows an attacker to tailor their next steps, such as disabling agents, using bypasses, or choosing to abandon the host entirely.

Defenders must differentiate between legitimate administrative maintenance, patch verification, and malicious reconnaissance. Because security software discovery is a common precursor to more damaging actions, this behavior should trigger investigations into the parent process tree, account behavior, and recent system changes.

Attack Chain

  1. An attacker gains initial access to a macOS or Linux host via an exploit or stolen credentials.
  2. The attacker establishes a foothold and performs internal reconnaissance.
  3. The attacker identifies the OS and common installation paths for security software.
  4. The attacker executes grep, egrep, or pgrep to query logs, configuration files, or the process list for signatures of security tools (e.g., "Little Snitch", "kav", "sophos", "falcond").
  5. The utility returns matches confirming the presence and potentially the version of security software.
  6. Based on the output, the attacker proceeds to disable or circumvent the identified security controls.
  7. The attacker moves to the final objective, such as data exfiltration or deploying ransomware.

Impact

Successful security software discovery provides attackers with the necessary intelligence to evade detection, disable protective measures, and persist within the network. This activity significantly increases the probability of successful data theft or system destruction by allowing attackers to tailor their payloads to the specific defensive environment.

Recommendation

  • Deploy the provided detection rules to monitor for grep and pgrep commands targeting security software keywords.
  • Investigate the parent process tree when these utilities are executed by non-root users, as this is a high-confidence indicator of reconnaissance.
  • Baseline administrative scripts and maintenance tasks to tune out false positives originating from known paths like /opt/McAfee/ or management frameworks.
  • Isolate systems showing evidence of successful security software discovery to prevent further movement.

Immediate actions

Deploy the Security Software Discovery via Grep detection rule.

Detection Engineering 48h

Threat Hunt

Search for grep/egrep/pgrep commands occurring in short successions with security-related keywords.

T1518.001 medium medium confidence convert to detection

Data: Process command line arguments

Mitigations

Review and restrict shell execution permissions for non-privileged users.

medium IT Operations

T1518.001

Detection coverage 1

Security Software Discovery via Grep

medium

Identifies the use of grep, egrep, or pgrep to discover known macOS and Linux security tools.

sigma tactics: discovery techniques: T1518.001 sources: process_creation, linux

Detection queries are available on the platform. Get full rules →