TCR

SSH Attack Detection and Response Made Easy with Wazuh

May 20, 2025 | by JSK

SSH Detection

Machines Used:

Configuration for monitoring the Auth log files

sudo nano /var/ossec/etc/ossec.conf
<localfile>
  <location>/var/log/auth.log</location>
  <log_format>syslog</log_format>
</localfile>
sudo systemctl restart wazuh-agent

Setting up an SSH server

sudo apt install openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh
ssh user@ip

Configuring wazuh Active response capabilities

<!--
  <active-response>
    active-response options here
  </active-response>
-->
<active-response>
  <command>firewall-drop</command>
  <location>local</location>
  <rules_id>5710</rules_id>
  <timeout>600</timeout> <!-- Block IP for 10 minutes -->
</active-response>

Attack simulation

sudo hydra -L <USER_LIST.txt> -P <PASSWD_LIST.txt> <IP> ssh

Visualization of alerts

rule.id:(5551 OR 5712) 

References

RELATED POSTS

View all

view all