WAZUH - BLOCKED IP W11
WAZUH - AMBASSADORS
🛡️Implementación de Active Response con netsh en Windows para Mitigar Ataques de Fuerza Bruta a RDP
En esta práctica configuraremos un equipo Windows como agente de Wazuh para activar un mecanismo de defensa automática basado en Active Response utilizando netsh. El objetivo es simular un escenario real de ataque mediante fuerza bruta a RDP desde un equipo atacante con Kali Linux y comprobar cómo el sistema responde bloqueando automáticamente la dirección IP ofensora en el firewall de Windows.
Además, se implementará una lista blanca (whitelist) para evitar bloquear nuestra propia dirección IP durante las pruebas, garantizando un entorno controlado, seguro y realista.
🎯 Objetivos de la práctica
-
Configurar Active Response en Windows utilizando netsh.
-
Simular un ataque de fuerza bruta a RDP desde Kali Linux.
-
Detectar los intentos fallidos de autenticación mediante Wazuh.
-
Ver cómo Active Response ejecuta netsh para bloquear la IP atacante.
-
Validar que la regla se añade automáticamente al firewall de Windows.
-
Implementar whitelisting para evitar autobloqueo.
-
Comprobar el bloqueo y comportamiento del sistema durante el ataque.
🧩 Aspectos clave de la práctica
🎛️ Configuración de Active Response en el agente de Windows
-
Ejecutar comandos netsh en tiempo real.
-
Añadir reglas al firewall de Windows.
-
Bloquear direcciones IP ofensivas.
-
Mitigar ataques sin intervención humana.
Este mecanismo convierte al agente en un sistema de autodefensa eficaz.
🔐 Ataque de fuerza bruta a RDP desde Kali Linux
-
Eventos de autenticación fallida.
-
Registros en el sistema de eventos de Windows.
-
Alertas en Wazuh indicando la actividad sospechosa.
Este escenario reproduce un ataque real contra servicios expuestos.
🚨 Detección de intentos fallidos por parte de Wazuh
Wazuh monitoriza los eventos de seguridad de Windows y detecta:
-
Intentos de autenticación fallidos.
-
Frecuencia anormal de intentos.
-
Patrones típicos de fuerza bruta o diccionarios.
Cuando este comportamiento coincide con las reglas configuradas, Wazuh genera una alerta crítica, suficiente para activar la respuesta automática.
🛑 Ejecución automática del bloqueo con netsh
Tras la alerta, Active Response ejecutará un comando diseñado para:
-
Añadir una regla nueva al firewall.
-
Bloquear la IP que está realizando los intentos.
-
Impedir nuevas conexiones desde el atacante.
El proceso es instantáneo y visible en el firewall de Windows, demostrando la capacidad de respuesta dinámica ante ataques en curso.
🧐 Validación del bloqueo
Una vez aplicada la regla:
-
El atacante dejará de poder conectar por RDP.
-
Los intentos adicionales serán descartados por el firewall.
-
Los registros mostrarán la intervención de Active Response.
Esto confirma que la protección funciona correctamente.
🤝 Implementación de whitelist para evitar autobloqueo
Para no bloquear nuestra propia IP (o la red interna):
-
Se configurará una lista blanca que Active Response respetará.
-
Cualquier evento generado desde una IP confiable no activará la acción automática.
-
Se garantizará que el administrador no quede bloqueado fuera del sistema.
Esto es fundamental en entornos de pruebas y en producción.
🧪 Pruebas completas con ataque real
Finalmente se realizará toda la cadena:
-
Kali ejecuta fuerza bruta contra RDP.
-
Windows registra múltiples fallos consecutivos.
-
Wazuh detecta el patrón sospechoso.
-
Se genera una alerta significativa.
-
Active Response ejecuta netsh para bloquear la IP.
-
La máquina atacante pierde el acceso inmediatamente.
Esta prueba confirma la eficacia del sistema de defensa automática.
🔍 ¿Por qué es importante esta práctica?
-
Cómo se detectan ataques por fuerza bruta.
-
Cómo se defiende un endpoint de forma autónoma.
-
La importancia del firewall local como medida de contención.
-
El valor real del Active Response en un SOC moderno.
-
Cómo realizar pruebas seguras y reproducibles.
Es una aproximación directa y efectiva al concepto de endpoint self-defense.
✅ Resultados esperados
-
Active Response correctamente configurado en Windows.
-
Simulación exitosa de un ataque desde Kali Linux.
-
Detección precisa del intento de fuerza bruta por parte de Wazuh.
-
Bloqueo automático de la IP atacante mediante netsh.
-
Regla visible en el firewall de Windows.
-
Sistema funcionando sin bloquear direcciones IP internas gracias a la whitelist.
-
Comprensión completa del flujo ataque → alerta → acción automática.
⚙️ Estructura de red
🛡️Implementing Active Response with netsh on Windows to Mitigate RDP Brute-Force Attacks
In this practice, a Windows machine will be configured as a Wazuh agent to activate an automated defense mechanism using Active Response and netsh. The goal is to simulate a real-world attack scenario by launching a dictionary-based brute-force attack against RDP from a Kali Linux machine and observe how the system automatically blocks the attacker’s IP using the Windows Firewall.
Additionally, a whitelist will be implemented to prevent accidental self-blocking during testing, ensuring a controlled and safe environment.
🎯 Objectives of the Practice
-
Configure Active Response on a Windows agent using netsh.
-
Simulate an RDP brute-force attack from Kali Linux.
-
Detect repeated failed authentication attempts through Wazuh.
-
Trigger an automatic firewall block using Active Response.
-
Verify that Windows Firewall adds the blocking rule automatically.
-
Implement a whitelist to avoid blocking our own IP.
-
Perform controlled testing to validate system behavior.
🧩 Key Aspects of the Practice
🎛️ Configuring Active Response on the Windows Agent
-
Execute Windows Firewall commands in real time.
-
Add firewall rules to block offending IP addresses.
-
Mitigate attacks without manual intervention.
This turns the endpoint into a self-defense system capable of reacting autonomously to threats.
🔐 Simulating a Brute-Force RDP Attack from Kali Linux
-
Repeated authentication failures,
-
Windows Security Event Log entries,
-
Wazuh alerts indicating suspicious login activity.
This setup simulates a realistic attack on an exposed service.
🚨 Detection of Failed Login Attempts by Wazuh
Wazuh continuously monitors Windows Security Logs and identifies:
-
Failed login attempts,
-
Abnormally high frequency of authentication errors,
-
Behavior consistent with brute-force or dictionary attacks.
When these patterns match the configured ruleset, Wazuh generates a high-severity alert, which is used to trigger the Active Response action.
🛑 Automatic Blocking with netsh
Once the alert is generated, Active Response executes a command that:
-
Creates a new Windows Firewall rule,
-
Blocks the attacker’s IP address,
-
Prevents the attacker from making further RDP connections.
This process is immediate, verifiable, and demonstrates how Active Response helps contain threats in real time.
🧐 Validating the Block in Windows Firewall
After the blocking rule is applied:
-
The attacker will lose all RDP access.
-
Additional attempts will be dropped by the firewall.
-
Logs will confirm that Active Response executed successfully.
This validation step ensures that the automated mitigation is working as intended.
🤝 Implementing a Whitelist to Avoid Self-Blocking
To prevent accidentally blocking our own management IP:
-
A whitelist will be configured within Active Response.
-
Any event generated from trusted IPs will be ignored.
-
The machine running the tests will remain accessible at all times.
This is essential for safe testing and is equally important in production environments.
🧪 Full End-to-End Testing
Finally, the complete sequence will be executed:
-
Kali launches a brute-force attack against RDP.
-
Windows logs multiple consecutive authentication failures.
-
Wazuh detects suspicious activity.
-
A high-severity alert is generated.
-
Active Response runs netsh to block the attacker’s IP.
-
Kali immediately loses network access to the Windows machine.
This confirms successful automated detection and mitigation.
🔍 Why This Practice Is Important
-
How brute-force attacks are detected,
-
How endpoints can defend themselves automatically,
-
The role of the local firewall as a containment mechanism,
-
The power of Active Response in modern SOC operations,
-
How to safely create and test real-world attack scenarios.
It’s a practical and realistic approach to endpoint self-protection concepts.
✅ Expected Results
-
Active Response correctly configured on the Windows agent.
-
Successful simulation of the brute-force attack from Kali Linux.
-
Accurate detection of repeated failed logins by Wazuh.
-
Automatic blocking of the attacker’s IP via netsh.
-
Firewall rule visible and functioning in Windows Defender Firewall.
-
Trusted IPs protected through the whitelist configuration.
-
Full understanding of the attack → alert → automated action workflow.

Comentarios
Publicar un comentario