Self-paced

Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.

Bootcamp

Learn live

Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.

Upcoming live events

Learning library

For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Search from all Lessons


LoginGet Started

Register to 4Geeks

← Back to Projects

Configure and use Wazuh as a SIEM

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

  • linux

  • cybersecurity

  • penetration testing

  • wazuh

  • siem

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

🌱 How to Start This Project

Before you start...

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.

🌱 How to Start This Project

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

📝 Instructions

Adding Multiple Data Sources to Wazuh

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.

Multi-Source Attack Simulation

Now we are going to simulate a distributed attack across different systems.

  1. Attempt to log in with incorrect credentials on the endpoint (Debian machine) several times.

  2. Modify sensitive files on the endpoint so that Wazuh detects the change.

1sudo echo "Simulating malicious change" >> /etc/passwd
  1. Simulate Apache access and error logs. Generate activity by accessing the WordPress website and attempt to access a non-existent page to generate a 404 error and verify that it is logged in Apache's log.

Monitor in the Dashboard

  1. Go to the dashboard and observe the events in 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.

imagen 1

  1. Go to the Reports section in Wazuh and generate a report that shows all recent events and alerts. Filter the events by type and source to see the correlations and anomalies detected.

⚠ 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.

Signup and get access to similar projects

We will use it to give you access to your account.
Already have an account? Login here.

By signing up, you agree to the Terms and conditions and Privacy policy.

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Signup and get access to similar projects

We will use it to give you access to your account.
Already have an account? Login here.

By signing up, you agree to the Terms and conditions and Privacy policy.

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies