User Tools

Site Tools


сервис_snort

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
сервис_snort [2021/02/10 14:49]
val [Debian/Ubuntu]
сервис_snort [2024/05/11 15:45]
val [alert_unified2 to syslog]
Line 5: Line 5:
   * [[https://​www.snort.org/​downloads/​community/​community-rules.tar.gz|!!!Открытые правила для тестирования!!!]]   * [[https://​www.snort.org/​downloads/​community/​community-rules.tar.gz|!!!Открытые правила для тестирования!!!]]
   * [[http://​www.openinfosecfoundation.org//​Альтернативное решение]]   * [[http://​www.openinfosecfoundation.org//​Альтернативное решение]]
 +  * [[https://​upcloud.com/​resources/​tutorials/​installing-snort-on-debian|How to install Snort on Debian]]
 ===== Установка,​ настройка,​ запуск сервиса ===== ===== Установка,​ настройка,​ запуск сервиса =====
  
Line 10: Line 11:
 <​code>​ <​code>​
 root@server:​~#​ apt install snort root@server:​~#​ apt install snort
 +
 +!!! В визарде все по умолчанию ("не понимает"​ интерфейс bond1)
  
 root@server:​~#​ cat /​etc/​snort/​snort.debian.conf root@server:​~#​ cat /​etc/​snort/​snort.debian.conf
 </​code><​code>​ </​code><​code>​
 ... ...
-DEBIAN_SNORT_INTERFACE="​eth2"+#DEBIAN_SNORT_INTERFACE="​eth0"​ 
 +#​DEBIAN_SNORT_INTERFACE="​bond1"
 DEBIAN_SNORT_HOME_NET="​192.168.0.0/​16"​ DEBIAN_SNORT_HOME_NET="​192.168.0.0/​16"​
 #​DEBIAN_SNORT_HOME_NET="​any"​ #​DEBIAN_SNORT_HOME_NET="​any"​
 ... ...
-</​code><​code>​+</​code>​ 
 + 
 +  * [[https://​serverfault.com/​questions/​554713/​snort-not-detecting-outgoing-traffic|Snort not detecting outgoing traffic]] 
 +  * [[https://​forum.netgate.com/​topic/​55909/​snort-enable_xff|inside of ssl termination proxies we need to get X-Forwarded-For]] 
 +  * [[http://​manual-snort-org.s3-website-us-east-1.amazonaws.com/​node17.html|2.2 Preprocessors (snort_manual)]] 
 + 
 +<​code>​
 root@server:​~#​ cat /​etc/​snort/​snort.conf root@server:​~#​ cat /​etc/​snort/​snort.conf
 </​code><​code>​ </​code><​code>​
 +...
 +# Configure IP / TCP checksum mode
 +config checksum_mode:​ none
 +...
 +preprocessor http_inspect_server:​ server default \
 +...
 +    enable_xff \
 +    webroot no
 ... ...
 ####################################################################​ ####################################################################​
Line 30: Line 48:
 root@server:​~#​ snort -T -S HOME_NET=[192.168.0.0/​16] -c /​etc/​snort/​snort.conf root@server:​~#​ snort -T -S HOME_NET=[192.168.0.0/​16] -c /​etc/​snort/​snort.conf
  
-root@server:​~#​ service snort stop +root@server:​~#​ service snort restart
- +
-root@server:​~#​ snort -A console -i eth2 -S HOME_NET=[192.168.0.0/​16] -c /​etc/​snort/​snort.conf +
- +
-root@server:​~#​ service snort start+
 </​code>​ </​code>​
  
Line 41: Line 55:
 ==== Debian/​Ubuntu ==== ==== Debian/​Ubuntu ====
 <​code>​ <​code>​
 +# less /​etc/​snort/​rules/​web-iis.rules
 +
 # tail -f /​var/​log/​auth.log | grep Red # tail -f /​var/​log/​auth.log | grep Red
 +
 +# u2spewfoo /​var/​log/​snort/​snort.alert
 </​code>​ </​code>​
  
 ==== Пример атаки с isp.un ==== ==== Пример атаки с isp.un ====
 <​code>​ <​code>​
-isp.un$ wget http://server.corpX.un/root.exe+isp.un$ wget http://192.168.X.10/root.exe 
 +</​code>​ 
 + 
 +===== Копирование alert_unified2 в syslog ===== 
 +<​code>​ 
 +# stdbuf -i0 -o0 u2spewfoo <(tail -c +1 -f /​var/​log/​snort/​snort.alert) | logger -t snort -p auth.info 
 + 
 +# cat /​etc/​systemd/​system/​snort-alert-unified2-syslog.service 
 +</​code><​code>​ 
 +[Unit] 
 +Description=Send snort alert_unified2 to syslog 
 +After=snort.service 
 + 
 +[Service] 
 +ExecStart=/​bin/​bash -c '/​usr/​bin/​stdbuf -i0 -o0 /​usr/​sbin/​u2spewfoo <​(/​usr/​bin/​tail -c +1 -f /​var/​log/​snort/​snort.alert) | /​usr/​bin/​logger -t snort -p auth.info'​ 
 + 
 +[Install] 
 +WantedBy=multi-user.target
 </​code>​ </​code>​
  
сервис_snort.txt · Last modified: 2024/05/11 16:43 by val