docs/ref/modules/rootcheck/README.md
The Rootcheck module performs anomaly and behavior-based detection on monitored endpoints to identify potential security threats. It focuses on detecting hidden processes, hidden network ports, unusual file system objects, and network interfaces operating in promiscuous mode.
Important Changes in Wazuh 5.0: Starting in version 5.0, rootcheck no longer performs signature-based detection of rootkit files and trojans, nor does it support policy checking capabilities. The manager also no longer persists rootcheck data in a database. Rootcheck now operates in a stateless mode, sending real-time alerts without server-side storage.
For policy and configuration assessment, use the Security Configuration Assessment (SCA) module instead.
Rootcheck operates by inspecting system internals using various techniques to detect anomalies that may indicate malware presence. Unlike signature-based detection, rootcheck focuses on behavioral patterns and system inconsistencies that malicious software commonly exploits.
/dev directory for suspicious filesAdd to your agent's ossec.conf:
<rootcheck>
<disabled>no</disabled>
<!-- Anomaly detection checks -->
<check_dev>yes</check_dev>
<check_sys>yes</check_sys>
<check_pids>yes</check_pids>
<check_ports>yes</check_ports>
<check_if>yes</check_if>
<!-- Scan frequency - every 12 hours -->
<frequency>43200</frequency>
<!-- Skip network mounted filesystems -->
<skip_nfs>yes</skip_nfs>
</rootcheck>
Check that rootcheck is running:
grep rootcheck /var/ossec/logs/ossec.log
Force an immediate scan:
/var/ossec/bin/wazuh-control restart
Rootcheck inspects all process IDs (PIDs) using different system calls such as getsid and getpgid, looking for discrepancies. Malware can hide processes from tools like ps by replacing them with trojaned versions or using kernel-level rootkits.
Scans every port using the bind() system call. If a port cannot be bound and doesn't appear in netstat output, it may indicate hidden malware using that port for communication.
stat size with fopen/read results/dev)The /dev directory should only contain device-specific files. Rootcheck inspects all files here because malware may use this location to hide files.
Scans network interfaces for promiscuous mode, which allows capturing all network traffic. This mode is often enabled by malware for packet sniffing.
| Platform | Hidden Processes | Hidden Ports | File System | Device Scan | Promiscuous |
|---|---|---|---|---|---|
| Linux | ✓ | ✓ | ✓ | ✓ | ✓ |
| Windows | ✓ | ✓ | ✓ | N/A | ✓ |
| macOS | ✓ | ✓ | ✓ | ✓ | ✓ |
| BSD | ✓ | ✓ | ✓ | ✓ | ✓ |
| Document | Description |
|---|---|
| Configuration | Complete configuration options and examples |
| Architecture | Technical architecture and detection methods |
| Output Samples | Alert formats and examples |
If you were using rootcheck features removed in Wazuh 5.0, here are the recommended alternatives:
| Removed Feature | Alternative Solution |
|---|---|
| File check (rootkit_files.txt) | Use FIM with threat intelligence integration |
| Trojan scan (rootkit_trojans.txt) | Use FIM with YARA rules or VirusTotal integration |
| Policy check (system_audit_*.txt) | Use SCA module with YAML policies |