Difficulty
intermediate
Average duration
4 hrs
Technologies
linux
cybersecurity
penetration testing
wazuh
siem
Difficulty
intermediate
Average duration
4 hrs
Technologies
linux
cybersecurity
penetration testing
wazuh
siem
We need you! These exercises are created and maintained in collaboration with people like you. If you find any errors or typos, please contribute and/or report them.
Through this exercise, we will collect and analyze security events from a Linux endpoint a Debian machine with WordPress, monitoring access, file changes, and simulating potential attacks. We will use Wazuh's capabilities as a SIEM to manage these events.
⚠ In case you don't have the Debian machine with WordPress available, you can download this image .ova with a configured Debian machine with WordPress.
1username: debian 2password: 123456
As a SIEM, Wazuh collects and analyzes data from various sources, such as servers, applications, firewalls, routers, and more. The first step is to ensure that Wazuh is configured to receive logs from these various sources.
Example, to monitor Web Server Logs. In the agent configuration file (/var/ossec/etc/ossec.conf), add the configuration to monitor them.
1<localfile> 2 <log_format>apache</log_format> 3 <location>/var/log/apache2/access.log</location> 4</localfile> 5<localfile> 6 <log_format>apache</log_format> 7 <location>/var/log/apache2/error.log</location> 8</localfile>
Additionally, since WordPress does not generate logs by default, enable log generation to record PHP errors and warnings. To enable WordPress error logs, edit the wp-config.php file and add the following lines:
1define( 'WP_DEBUG', true ); 2define( 'WP_DEBUG_LOG', true ); 3define( 'WP_DEBUG_DISPLAY', false );
💡 This will generate a log file at /wp-content/debug.log where all PHP errors and warnings related to WordPress will be recorded.
NOTE: We will practice with sources 1 and 2.
Now we are going to simulate a distributed attack across different systems.
Attempt to log in with incorrect credentials on the endpoint (Debian machine) several times.
Modify sensitive files on the endpoint so that Wazuh detects the change.
1sudo echo "Simulating malicious change" >> /etc/passwd
Threat Hunting
. Look for event correlation involving failed access attempts, port scans from another machine, and file modifications on the endpoints. Wazuh should generate alerts as it correlates events from these multiple sources.The results obtained should be something similar to this, where you will be able to see all the simulations performed. Example: T1078
, which refers to the misuse of credentials, T1548.003
, which indicates a successful sudo to ROOT, and multiple Apache 400 errors, which may result from failed attempts to access web server resources.
⚠ If the events do not appear immediately, review the log collection configuration on the agents and ensure that all sources (such as application and device logs) are properly connected and sending data to the Wazuh Manager.
Difficulty
intermediate
Average duration
4 hrs
Technologies
linux
cybersecurity
penetration testing
wazuh
siem
Difficulty
intermediate
Average duration
4 hrs
Technologies
linux
cybersecurity
penetration testing
wazuh
siem
Difficulty
intermediate
Average duration
4 hrs
Technologies
linux
cybersecurity
penetration testing
wazuh
siem
Difficulty
intermediate
Average duration
4 hrs
Technologies
linux
cybersecurity
penetration testing
wazuh
siem
Difficulty
intermediate
Average duration
4 hrs
Technologies
linux
cybersecurity
penetration testing
wazuh
siem
Difficulty
intermediate
Average duration
4 hrs
Technologies
linux
cybersecurity
penetration testing
wazuh
siem