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
- An attacker gains initial access to a macOS or Linux host via an exploit or stolen credentials.
- The attacker establishes a foothold and performs internal reconnaissance.
- The attacker identifies the OS and common installation paths for security software.
- The attacker executes
grep,egrep, orpgrepto query logs, configuration files, or the process list for signatures of security tools (e.g., "Little Snitch", "kav", "sophos", "falcond"). - The utility returns matches confirming the presence and potentially the version of security software.
- Based on the output, the attacker proceeds to disable or circumvent the identified security controls.
- 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
grepandpgrepcommands 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.
Threat Hunt
Search for grep/egrep/pgrep commands occurring in short successions with security-related keywords.
Data: Process command line arguments
Mitigations
Review and restrict shell execution permissions for non-privileged users.
T1518.001
Detection coverage 1
Security Software Discovery via Grep
mediumIdentifies the use of grep, egrep, or pgrep to discover known macOS and Linux security tools.
Detection queries are available on the platform. Get full rules →