Detecting suspicious binaries

Wazuh provides you with powerful anomaly and malware detection capabilities to detect suspicious binaries. In this POC, you detect trojaned system binaries by using signatures in the /var/ossec/etc/shared/rootkit_trojans.txt file.


Configure your environment as follows to test the POC.

No additional configuration is required since trojan detection is configured out-of-the-box. Check your configuration in the /var/ossec/etc/ossec.conf file at the CentOS 8 monitored endpoint.


    <!-- Line for trojans detection -->


    <!-- Frequency that rootcheck is executed - every 12 hours -->

Steps to generate the alerts

  1. Create a copy of the original system binary.

    # cp -p /usr/bin/w /usr/bin/w.copy
  2. Replace the original system binary /usr/bin/w with the following shell script.

    echo "`date` this is evil"   > /tmp/trojan_created_file
    echo 'test for /usr/bin/w trojaned file' >> /tmp/trojan_created_file
    #Now running original binary

Query the alerts

You can visualize the alert data in the Wazuh Kibana plugin. To do this, go to the Security events module and add the filters in the search bar to query the alerts.

  • location:rootcheck AND AND data.title:Trojaned version of file detected