IPS
snort IPS Mode

1. NFQUEUE
- iptables 와 연동

2. AFPACKET
- module로 실행 
- 가상인터페이스


[root@localhost ~]# vim /etc/snort/snort.conf
153 # Configure DAQ related options for inline operation. For more information, see README.daq

기존 설정파일에서 아래처럼 변경 후 저장
155  config daq: afpacket
156 # config daq_dir: <dir>
157  config daq_mode: inline

rules 설정
- IDS 테스트
> alert
[root@localhost ~]# vim /etc/snort/rules/local.rules
alert icmp any any -> 192.168.0.100 any (sid:1000000; msg:"icmp echo test";)


> Q : 인라인 모드로 설정
[root@localhost ~]# snort -i eth0:eth1 -c /etc/snort/snort.conf  -v -Q

[root@localhost doc]# tail -f /var/log/snort/alert


- IPS 테스트
> drop
drop icmp any any -> 192.168.0.100 any (sid:1000000; msg:"icmp echo drop test";)


[root@localhost doc]# tail -f /var/log/snort/alert

◆◆◆◆

- 제대로 DROP이 안돼서 gns 스탑
- zebra, ospfd, iptables 전부 stop
- IPS 서버 장치번호 각 연결할 서버들과 번호를 맟춤 ( ex vmnet9, vmnet4)
- 아래 경로로가서 eth 장치들 숨김파일로 설정


[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# ls
ifcfg-eth0      ifdown       ifdown-post    ifup-bnep  ifup-plusb     init.ipv6-global
ifcfg-eth0:100  ifdown-bnep  ifdown-ppp     ifup-eth   ifup-post      net.hotplug
ifcfg-eth0:150  ifdown-eth   ifdown-routes  ifup-ib    ifup-ppp       network-functions
ifcfg-eth0:200  ifdown-ib    ifdown-sit     ifup-ippp  ifup-routes    network-functions-ipv6
ifcfg-eth0~     ifdown-ippp  ifdown-tunnel  ifup-ipv6  ifup-sit
ifcfg-eth1      ifdown-ipv6  ifup           ifup-isdn  ifup-tunnel
ifcfg-lo        ifdown-isdn  ifup-aliases   ifup-plip  ifup-wireless

[root@localhost network-scripts]# mv ifcfg-eth0:100 .ifcfg-eth0:100
[root@localhost network-scripts]# mv ifcfg-eth0:150 .ifcfg-eth0:150
[root@localhost network-scripts]# mv ifcfg-eth0:200 .ifcfg-eth0:200


[root@localhost network-scripts]# vim ifcfg-eth0
> 10.10.10.254 로 변경
[root@localhost network-scripts]# vim ifcfg-eth1
> 192.168.0.254 로 변경

다 설정 후 통진 되는지 확인 후 다시 snort 실행하면 drop설정이 적용되는데 다 막아주지는 못함... 

◆◆◆◆◆◆◆◆◆
9.22 다시 원래대로 라우터 형태로 되돌려 놓음
그리고

firewall Server에 yum으로 받기
[root@localhost network-scripts]# yum install libnetfilter_queue libnetfilter_queue-devel libmnl

daq-2.0.6 이랑 snort-2.9.9.0 다시 설치

'정보보안 > 공부 기록' 카테고리의 다른 글

리눅스 백도어  (0) 2023.01.01
리눅스 명령어  (0) 2023.01.01
IDS  (0) 2023.01.01
TCP-flag mask comp  (0) 2023.01.01
Iptables limit & Log  (0) 2023.01.01

+ Recent posts