رفتن به محتوا
بازگشت به وبلاگ
میکروتیک

تشخیص تلاش‌های نفوذ در لاگ‌های MikroTik

یاد بگیرید لاگ‌های MikroTik را بخوانید تا تلاش‌های نفوذ را شناسایی کنید، Log Action پیکربندی کنید و هشدارها را به Syslog از راه دور ارسال کنید.

فروردین ۱۴۰۶
۱۱ دقیقه مطالعه

استفاده از لاگ‌های میکروتیک برای تشخیص نفوذ

RouterOS سیستم لاگ‌گیری قدرتمندی دارد. با پیکربندی صحیح آن، می‌توانید تلاش‌های نفوذ، دسترسی‌های غیرمجاز و فعالیت‌های مشکوک را — همه از لاگ‌های خود روتر — شناسایی کنید.

تنظیم Remote Syslog

همه لاگ‌ها را به یک سرور syslog مرکزی ارسال کنید:

TEXT
/system logging action
add name=remote-syslog target=remote remote=192.168.88.200 remote-port=514 bsd-syslog=yes syslog-facility=local0

/system logging
add topics=info action=remote-syslog
add topics=warning action=remote-syslog
add topics=error action=remote-syslog
add topics=critical action=remote-syslog

فعال کردن لاگ‌گیری قوانین فایروال

log=yes و log-prefix را به قوانین فایروال بحرانی اضافه کنید:
TEXT
/ip firewall filter
add chain=input action=drop log=yes log-prefix="INPUT-DROP:"
add chain=input src-address-list=ssh_blacklist protocol=tcp dst-port=22 action=drop log=yes log-prefix="SSH-BLACKLIST:"

تجزیه و تحلیل لاگ: چه چیزی باید جستجو کرد

تلاش‌های ناموفق ورود:
TEXT
/log print where message~"login failure"
Drop های فایروال:
TEXT
/log print where message~"INPUT-DROP"
تغییرات پیکربندی:
TEXT
/log print where topics~"system"

شناسایی تغییرات پیکربندی غیرمجاز

یک اسکریپت بسازید که کاربران، اسکریپت‌ها یا scheduler جدید را بررسی کند:

TEXT
/system script
add name=sec-audit source={
    :local userCount [/user print count-only]
    :local scriptCount [/system script print count-only]
    :local schedCount [/system scheduler print count-only]
    /log info message="SEC-AUDIT: users=$userCount scripts=$scriptCount schedulers=$schedCount"
}

/system scheduler add name=sec-audit interval=15m on-event=sec-audit

هشدارهای ایمیل برای رویدادهای بحرانی

TEXT
/system logging action
add name=email-critical target=email email=admin@example.com

/system logging
add topics=critical action=email-critical
add topics=error action=email-critical

چک‌لیست تشخیص نفوذ

  • [ ] سرور syslog از راه دور پیکربندی شده
  • [ ] موضوعات account و system به syslog ارسال می‌شوند
  • [ ] قوانین drop فایروال log=yes دارند
  • [ ] هشدارهای ایمیل برای رویدادهای بحرانی
  • [ ] بررسی منظم لاگ برنامه‌ریزی شده