WAZUH - MALWAREBAZAAR
🧠🛡️Integración de MalwareBazaar con Wazuh mediante Listas CDB y Sincronización Automatizada de Threat Intelligence
En esta práctica se integra MalwareBazaar con Wazuh para utilizar hashes SHA256 como fuente de inteligencia de amenazas, empleando listas CDB para realizar correlación de forma eficiente. El objetivo es construir un sistema capaz de ingestar automáticamente feeds externos y correlacionarlos en tiempo real con la actividad del endpoint.
El proceso comienza habilitando FIM (File Integrity Monitoring) sobre un directorio de laboratorio, permitiendo a Wazuh detectar la creación de archivos y calcular sus hashes, que posteriormente podrán ser comparados con indicadores de compromiso.
Una vez comprendido el formato, se configura en Wazuh una lista CDB junto con una regla personalizada que compara el campo sha256 de los eventos generados por FIM con los valores obtenidos desde MalwareBazaar.
Para automatizar el proceso, se desarrolla un script de sincronización que:
- Descarga el CSV actualizado
- Extrae los hashes SHA256 válidos
- Genera la lista CDB
- Recarga el Wazuh Manager
- Registra la ejecución en un log local
Este log se integra en Wazuh mediante localfile, permitiendo generar alertas cuando la sincronización se realiza correctamente o cuando ocurre algún error.
Finalmente, se valida el sistema sin utilizar malware real, añadiendo temporalmente un hash benigno a la lista y creando un fichero de prueba en el directorio monitorizado. Esto permite comprobar tanto la detección basada en CDB como la visibilidad de los eventos de sincronización en Wazuh.
🧰 Tecnologías empleadas
Wazuh
Wazuh actúa como plataforma SIEM/XDR encargada de:
- Monitorizar actividad de archivos mediante FIM
- Correlacionar eventos con inteligencia externa
- Generar alertas
- Supervisar procesos de integración
Su soporte para listas CDB permite correlaciones rápidas y escalables.
MalwareBazaar (abuse.ch)
MalwareBazaar es una plataforma de inteligencia de amenazas que proporciona:
- Hashes SHA256 de muestras de malware
- Información contextual
- Feeds actualizados constantemente
El acceso autenticado garantiza datos más completos y actualizados.
CDB (Constant Database)
CDB es un formato optimizado para:
- Búsquedas extremadamente rápidas
- Manejo eficiente de grandes volúmenes de indicadores
- Integración directa con Wazuh
Es ideal para implementar listas de threat intelligence.
FIM (File Integrity Monitoring)
FIM permite:
- Detectar la creación de archivos en tiempo real
- Calcular hashes automáticamente
- Generar eventos de seguridad
Actúa como punto de entrada del flujo de detección.
Script de sincronización
El script automatiza la ingesta de inteligencia:
- Descarga feeds
- Procesa datos
- Actualiza listas
- Registra estado de ejecución
Es clave para mantener la inteligencia actualizada.
Localfile
Localfile permite a Wazuh:
- Leer logs personalizados
- Monitorizar procesos externos
- Generar alertas operativas
Aporta visibilidad al pipeline de integración.
🎯 Objetivos de la práctica
- Integrar MalwareBazaar como fuente de threat intelligence.
- Configurar FIM para detección basada en hashes.
- Comprender la estructura de los feeds CSV.
- Crear y utilizar listas CDB en Wazuh.
- Correlacionar eventos FIM con hashes SHA256.
- Desarrollar reglas personalizadas de detección.
- Automatizar la sincronización de inteligencia.
- Monitorizar el estado de la integración.
- Validar detección y visibilidad del sistema.
- Comprender el modelo de ingestión continua de inteligencia.
🧩 Aspectos clave de la práctica
🌐 Threat Intelligence como proceso continuo
La inteligencia de amenazas no es estática. Debe ser:
- Actualizada continuamente
- Automatizada
- Integrada en los sistemas de detección
Esta práctica muestra cómo operacionalizar este concepto.
📥 Análisis manual del feed
Antes de automatizar:
- Se revisa el CSV
- Se entiende la estructura
- Se identifican los campos relevantes
Esto evita errores en la integración.
⚙️ Uso de CDB para correlación eficiente
Los hashes se almacenan en una lista CDB que permite:
- Búsquedas en tiempo real
- Alto rendimiento
- Escalabilidad
Esto es clave en entornos productivos.
🔗 Correlación FIM + Threat Intelligence
Cuando se crea un archivo:
- FIM detecta el evento
- Se calcula el hash
- Se compara con la lista CDB
- Se genera alerta si hay coincidencia
Esto conecta actividad local con inteligencia global.
🤖 Automatización del proceso de inteligencia
El script permite:
- Mantener datos actualizados
- Reducir trabajo manual
- Garantizar consistencia
La automatización es esencial en seguridad moderna.
📊 Monitorización del pipeline
Al integrar el log en Wazuh:
- Se visualiza el estado del proceso
- Se detectan fallos
- Se generan alertas operativas
Esto convierte el sistema en observable.
🧪 Validación segura
Para evitar riesgos:
- Se añade un hash benigno
- Se crea un archivo de prueba
- Se valida la detección
Esto permite comprobar el sistema sin malware real.
🔄 Flujo completo de trabajo
La práctica implementa un pipeline completo:
Feed → Procesado → CDB → FIM → Detección → Alertas → Monitorización
🔍 ¿Por qué es importante esta práctica?
La integración de threat intelligence es fundamental en seguridad moderna. Esta práctica permite comprender:
- Cómo automatizar la ingesta de IOCs
- Cómo mantener detecciones actualizadas
- Cómo monitorizar integraciones
- Cómo reducir carga operativa
- Cómo construir pipelines escalables
Es un enfoque real de un SOC profesional.
✅ Resultados esperados
- Feed de MalwareBazaar integrado correctamente
- Sincronización automatizada funcionando
- Lista CDB generada y actualizada
- Monitorización FIM activa
- Correlación de hashes operativa
- Alertas generadas correctamente
- Alertas de estado de sincronización visibles
- Visibilidad completa del pipeline
- Comprensión del flujo:Inteligencia → Automatización → Detección → Monitorización
🔗 Enlaces de interés
DOCUMENTACIÓN
⚙️ Estructura de red
🧠🛡️Integrating MalwareBazaar with Wazuh Using CDB Lists for Automated Threat Intelligence Synchronization
In this practice, we integrate MalwareBazaar with Wazuh to use SHA256 hashes as a threat intelligence source, leveraging CDB lists for high-performance correlation. The objective is to build a system capable of automatically ingesting external intelligence feeds and correlating them with endpoint activity in real time.
The process begins by enabling File Integrity Monitoring (FIM) on a lab directory, allowing Wazuh to detect file activity and calculate hashes that can later be compared against threat intelligence indicators.
Next, an account is created on abuse.ch, and an Auth-Key is obtained to access authenticated MalwareBazaar feeds.
A recent CSV feed is then manually downloaded and analyzed to understand its structure and verify how SHA256 hashes are presented.
After that, a CDB list is configured in Wazuh, along with a custom rule that compares the sha256 field from FIM events against the values obtained from MalwareBazaar.
To automate the workflow, a synchronization script is developed. This script:
-
Downloads the latest CSV feed
-
Extracts valid SHA256 hashes
-
Generates the updated CDB list
-
Reloads the Wazuh Manager
-
Logs execution results locally
The generated log is also integrated into Wazuh using a localfile configuration, allowing the system to generate alerts indicating whether the synchronization process completed successfully or failed.
Finally, the system is validated without using real malware by temporarily adding a benign test hash to the list and creating a test file in the monitored directory. This confirms both the CDB-based detection mechanism and the visibility of synchronization alerts within Wazuh.
In this practice, we integrate MalwareBazaar with Wazuh to use SHA256 hashes as a threat intelligence source, leveraging CDB lists for high-performance correlation. The objective is to build a system capable of automatically ingesting external intelligence feeds and correlating them with endpoint activity in real time.
The process begins by enabling File Integrity Monitoring (FIM) on a lab directory, allowing Wazuh to detect file activity and calculate hashes that can later be compared against threat intelligence indicators.
Next, an account is created on abuse.ch, and an Auth-Key is obtained to access authenticated MalwareBazaar feeds.
A recent CSV feed is then manually downloaded and analyzed to understand its structure and verify how SHA256 hashes are presented.
After that, a CDB list is configured in Wazuh, along with a custom rule that compares the sha256 field from FIM events against the values obtained from MalwareBazaar.
To automate the workflow, a synchronization script is developed. This script:
- Downloads the latest CSV feed
- Extracts valid SHA256 hashes
- Generates the updated CDB list
- Reloads the Wazuh Manager
- Logs execution results locally
The generated log is also integrated into Wazuh using a localfile configuration, allowing the system to generate alerts indicating whether the synchronization process completed successfully or failed.
Finally, the system is validated without using real malware by temporarily adding a benign test hash to the list and creating a test file in the monitored directory. This confirms both the CDB-based detection mechanism and the visibility of synchronization alerts within Wazuh.
🧰 Technologies Used
Wazuh
Wazuh acts as the SIEM/XDR platform responsible for:
-
Monitoring file activity via FIM
-
Correlating events with threat intelligence
-
Generating alerts
-
Monitoring external integration processes
Its support for CDB lists enables efficient large-scale indicator matching.
Wazuh acts as the SIEM/XDR platform responsible for:
- Monitoring file activity via FIM
- Correlating events with threat intelligence
- Generating alerts
- Monitoring external integration processes
Its support for CDB lists enables efficient large-scale indicator matching.
MalwareBazaar (abuse.ch)
MalwareBazaar is a threat intelligence platform that provides:
-
SHA256 hashes of malware samples
-
Associated metadata
-
Continuously updated feeds
Authenticated access ensures up-to-date and reliable data.
MalwareBazaar is a threat intelligence platform that provides:
- SHA256 hashes of malware samples
- Associated metadata
- Continuously updated feeds
Authenticated access ensures up-to-date and reliable data.
CDB (Constant Database)
CDB is used to store threat intelligence indicators:
-
Optimized for extremely fast lookups
-
Suitable for large datasets
-
Efficient for real-time correlation
It forms the backbone of hash-based detection in Wazuh.
CDB is used to store threat intelligence indicators:
- Optimized for extremely fast lookups
- Suitable for large datasets
- Efficient for real-time correlation
It forms the backbone of hash-based detection in Wazuh.
FIM (File Integrity Monitoring)
FIM enables:
-
Real-time monitoring of file creation
-
Automatic hash calculation
-
Triggering of correlation workflows
It acts as the entry point for detection at the endpoint level.
FIM enables:
- Real-time monitoring of file creation
- Automatic hash calculation
- Triggering of correlation workflows
It acts as the entry point for detection at the endpoint level.
Custom Synchronization Script
The script automates the ingestion pipeline:
-
Fetches threat intelligence feeds
-
Processes and filters data
-
Updates detection lists
-
Logs execution status
This enables continuous and autonomous updates.
The script automates the ingestion pipeline:
- Fetches threat intelligence feeds
- Processes and filters data
- Updates detection lists
- Logs execution status
This enables continuous and autonomous updates.
Localfile Integration
Localfile allows Wazuh to:
-
Ingest custom logs
-
Monitor script execution
-
Generate alerts based on operational status
This adds observability to the intelligence pipeline.
Localfile allows Wazuh to:
- Ingest custom logs
- Monitor script execution
- Generate alerts based on operational status
This adds observability to the intelligence pipeline.
🎯 Objectives of the Practice
-
Integrate MalwareBazaar threat intelligence into Wazuh.
-
Enable FIM for hash-based detection.
-
Understand the structure of MalwareBazaar CSV feeds.
-
Create and use CDB lists for threat intelligence.
-
Develop custom detection rules based on SHA256 hashes.
-
Automate feed synchronization using scripts.
-
Monitor synchronization processes via Wazuh.
-
Validate detection and operational visibility.
-
Understand continuous threat intelligence ingestion workflows.
- Integrate MalwareBazaar threat intelligence into Wazuh.
- Enable FIM for hash-based detection.
- Understand the structure of MalwareBazaar CSV feeds.
- Create and use CDB lists for threat intelligence.
- Develop custom detection rules based on SHA256 hashes.
- Automate feed synchronization using scripts.
- Monitor synchronization processes via Wazuh.
- Validate detection and operational visibility.
- Understand continuous threat intelligence ingestion workflows.
🧩 Key Aspects of the Practice
🌐 Threat Intelligence as a Continuous Process
Threat intelligence is not static.
It must be:
-
Continuously updated
-
Automatically ingested
-
Integrated into detection workflows
This practice demonstrates how to operationalize this concept.
Threat intelligence is not static.
It must be:
- Continuously updated
- Automatically ingested
- Integrated into detection workflows
This practice demonstrates how to operationalize this concept.
📥 Manual Feed Analysis
Before automation:
-
The CSV feed is inspected
-
Data structure is understood
-
Relevant fields (SHA256) are identified
This ensures correct data processing and avoids ingestion errors.
Before automation:
- The CSV feed is inspected
- Data structure is understood
- Relevant fields (SHA256) are identified
This ensures correct data processing and avoids ingestion errors.
⚙️ CDB-Based Correlation
Hashes extracted from MalwareBazaar are stored in a CDB list:
-
Enables real-time lookup
-
Minimizes performance impact
-
Scales efficiently
This allows Wazuh to correlate events instantly.
Hashes extracted from MalwareBazaar are stored in a CDB list:
- Enables real-time lookup
- Minimizes performance impact
- Scales efficiently
This allows Wazuh to correlate events instantly.
🔗 FIM and Threat Intelligence Correlation
When a file is created:
-
FIM detects the event
-
Wazuh calculates the hash
-
The hash is compared against the CDB list
-
A match triggers an alert
This connects endpoint activity with global threat intelligence.
When a file is created:
- FIM detects the event
- Wazuh calculates the hash
- The hash is compared against the CDB list
- A match triggers an alert
This connects endpoint activity with global threat intelligence.
🤖 Automation with Synchronization Script
The script ensures:
-
Up-to-date intelligence feeds
-
Consistent data processing
-
Reduced manual effort
-
Reliable system operation
Automation is critical in modern security environments.
The script ensures:
- Up-to-date intelligence feeds
- Consistent data processing
- Reduced manual effort
- Reliable system operation
Automation is critical in modern security environments.
📊 Monitoring the Intelligence Pipeline
By integrating the script logs into Wazuh:
-
Execution success/failure is visible
-
Alerts are generated for operational issues
-
The pipeline becomes observable
This is a key aspect of production-ready systems.
By integrating the script logs into Wazuh:
- Execution success/failure is visible
- Alerts are generated for operational issues
- The pipeline becomes observable
This is a key aspect of production-ready systems.
🧪 Safe Validation Strategy
To validate without real malware:
-
A benign hash is added to the CDB list
-
A test file is created
-
Detection is triggered safely
This ensures system functionality without introducing risk.
To validate without real malware:
- A benign hash is added to the CDB list
- A test file is created
- Detection is triggered safely
This ensures system functionality without introducing risk.
🔄 End-to-End Workflow
The practice implements a full pipeline:
Threat Feed → Processing → CDB → FIM Detection → Alerting → Monitoring
This reflects real-world SOC workflows.
The practice implements a full pipeline:
Threat Feed → Processing → CDB → FIM Detection → Alerting → Monitoring
This reflects real-world SOC workflows.
🔍 Why This Practice Is Important
Modern security relies on automated threat intelligence ingestion.
This practice demonstrates:
-
How to integrate external IOC feeds
-
How to maintain up-to-date detection capabilities
-
How to monitor the health of integrations
-
How to reduce manual workload
-
How to build scalable detection pipelines
It closely mirrors real-world SOC and threat intelligence operations.
Modern security relies on automated threat intelligence ingestion.
This practice demonstrates:
- How to integrate external IOC feeds
- How to maintain up-to-date detection capabilities
- How to monitor the health of integrations
- How to reduce manual workload
- How to build scalable detection pipelines
It closely mirrors real-world SOC and threat intelligence operations.
✅ Expected Results
-
MalwareBazaar feed successfully integrated
-
Automated synchronization working correctly
-
CDB list generated and updated
-
FIM monitoring active
-
Hash correlation functioning
-
Alerts generated for detected matches
-
Alerts generated for synchronization status
-
Full visibility into the intelligence pipeline
-
Clear understanding of the workflow:
Threat Intelligence → Automation → Detection → Monitoring
- MalwareBazaar feed successfully integrated
- Automated synchronization working correctly
- CDB list generated and updated
- FIM monitoring active
- Hash correlation functioning
- Alerts generated for detected matches
- Alerts generated for synchronization status
- Full visibility into the intelligence pipeline
-
Clear understanding of the workflow:
Threat Intelligence → Automation → Detection → Monitoring

Comentarios
Publicar un comentario