Tính năng thông báo khi đăng nhập vào MikroTik 3 lần sai mật khẩu là một trong những tính năng bảo mật quan trọng trên MikroTik Router. Nó cho phép người quản trị mạng nhận được cảnh báo ngay khi có ai đặt nỗ lực để đăng nhập vào hệ thống với mục đích xấu. Điều này giúp cho việc bảo mật mạng được đảm bảo tốt hơn và người quản trị có thể thực hiện các hành động cần thiết để bảo vệ mạng của mình.
# Cấu hình tài khoản email gửi thông báo/tool email set address=smtp.gmail.com from=your-email@gmail.com password=your-email-password port=587 start-tls=yes user=your-email@gmail.com
# Tạo một rule tính toán số lần đăng nhập sai/ip firewall filter add chain=input protocol=tcp dst-port=22 action=count counter-name=ssh-login-attempt
# Tạo một rule cho phép IP đăng nhập sai tối đa 3 lần/ip firewall filter add chain=input protocol=tcp dst-port=22 connection-state=new limit=3,3 limit-burst=3 action=drop counter-name=ssh-login-attempt
# Tạo một rule gửi email thông báo khi IP đăng nhập sai quá số lần cho phép/ip firewall filter add chain=input protocol=tcp dst-port=22 connection-state=invalid action=log message="Failed SSH login attempt from $src-address"/system script add name=send-alert-email source=\"/tool email send to=your-email@gmail.com subject=\\"Failed SSH login attempt\" body=\\"A failed SSH login attempt was detected from IP address $src-address.\\n\nThis is an automated message from your MikroTik Router.\\n\nRegards,\\nMikroTik Router" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive/ip firewall filter add chain=input protocol=tcp dst-port=22 connection-state=invalid action=call-script script=send-alert-email
Lưu ý: Trước khi chạy script này, bạn cần cấu hình tài khoản email của mình để gửi thông báo.
