当前位置: 首页 > 图文教程 > 网络安全 > 安全基础 > 网络安全讲座之:IDS系统(6)

安全基础
硬盘双击无法打开的问题该怎么办?
XP每次启动后都检测硬盘?
检查电脑是否中病毒和木马的顺序
机器中QQ木马病毒的异常现象
免费的P2P终结者对付无节制的P2P下载
有效控制局域网里的P2P下载
出游拍摄,MP4突然断电该怎么办?
IE浏览网页弹出窗口的应对办法
打开U盘最安全的操作
IE 浏览器被6700.cn强制设置主页的解决
狼牙抓鸡器(又称狼牙全自动抓鸡器)简介
禁用移动硬盘插到USB口自动播放功能
Wsyscheck进程工具清除IE截取器病毒
命令行法检测局域网ARP病毒电脑
Ping命令你真的知道怎么用吗?
无线网卡标准设置不当引起不能上网
不登录Hotmail接收Hotmail邮件到Gmail
清除病毒和木马之后Windows桌面找不到?
记事本也能杀毒,你相信吗?
为什么有时ADSL虚拟拨号时会失败

安全基础 中的 网络安全讲座之:IDS系统(6)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-28   浏览: 82 ::
收藏到网摘: n/a

基于内核的入侵检测

  基于内核的入侵检测是一种相当巧妙的新型的Linux入侵检测系统。现在最主要的基于内核的入侵检测系统叫做LIDS。

  什么是LIDS?LIDS是一种基于Linux内核的入侵检测和预防系统。

  LIDS的保护目的是防止超级用户root的篡改系统重要部分的。LIDS主要的特点是提高系统的安全性,防止直接的端口连接或者是存储器连接,防止原始磁碟的使用,同时还要保护系统日志文件。LIDS当然也会适当制止一些特定的系统操作,譬如:安装sniffer、修改防火墙的配置文件。

  LIDS文档工程

  LIDS比安装PortSentry和LogCheck要复杂一点,但是很幸运的是,在LIDS的主页上面有详细的安装和配置手册。

  安装LIDS

  首先,在安装之前,我们需要大部分最新的LIDS软件包(我使用的是0.9)和适当的内核版本。我现在使用的是从Red Hat主页上下载的2.2.14-12版本的内核,因为其中包含一些安全补丁。同时你也需要你使用的内核的一些源代码。

  现在的LIDS主要是适用于2.2.14版本的内核。我安装的在2.2.14的内核的Red Hat Linux 6.2上面安装了LIDS。在安装LIDS之前,我在ftp.redhat.com下载了最新的内核版本,并且依照http://www.redhat.com/support/docs/howto/kernel-upgrade/kernel-upgrade.html 安装了这个内核。

  接着的事情就是升级内核源代码。这里我们是这样做的:

  rpm -Uhv kernel-source-2.2.14-12.i386.rpm然后就是编译和安装lidsadm这个程序:

  cd /usr/local/src/security/lids-0.9/lidsadm-0.9make

  make install

  生成一个RipeMD-160口令,这个以后将会在安装进内核的:

  lidsadm -P输入口令是"anypass",得到秘钥"d502d92bfead11d1ef17887c9db07a78108859e8"。接着,我把Redhat的配置文件拷贝到我的结构体系中,在/usr/src/linux目录下面:

  cd /usr/src/linux/configs/

  cp kernel-2.2.12-i686.config ..

  下面我们就使用下面的命令来安装LIDS:

  cd /usr/src

  patch -p0 同时我们应该注意到Red Hat所提供的内核和Linus发布的标准的2.2.14版本的内核有一些细微的差别,因为其中包含一些修改过的驱动程序。同样lids-0.9-2.2.14-redhat.patch文件也是和LIDS发布的标准的lids-0.9-2.2.14.patch有一些细微的差别,不过可能后者并不是特别适合于Red Hat系统。

  最后,就是配置、编译和安装内核了:

  cd /usr/src/linuxmake menuconfig

  make dep; make clean

  make

  install; make modules; make modules_install

  下面的脚本展示了在配置内核的过程中我设置的LIDS配置选项:

  [*] Linux Intrusion Detection System support (EXPERIMENTAL)--- LIDS features

  [ ] Hang up console when raising a securit alert

  [*] Security alert when execing unprotected programs before sealing

  [ ] Do not execute unprotected programs before sealing LIDS

  [*] Enable init children lock feature

  [*] Try not to flood logs

  (60) Authorised time between two identic logs (seconds)

  [*] Allow switching LIDS protections

  RipeMD-160 encrypted password: d502d92bfead11d1ef17887c9db07a78108859e8

  (3) Number of attempts to submit password

  (3) Time to wait after a fail (seconds)

  [*] Allow remote users to switch LIDS protections

  [ ] Allow any program to switch LIDS protections

  [*] Allow reloading config. file

  [ ] Hide some known processes

  [*] Port Scanner Detector in kernel

  [ ] Send security alerts through network

  --- Special authorizations

  [ ] Allow some known processes to access /dev/mem (xfree, etc.)

  [ ] Allow some known processes to access raw disk devices

  [ ] Allow some known processes to access io ports

  [ ] Allow some known processes to change routes

  --- Special UPS

  [*] Allow some known processes to unmount devices

  Allowed processes: "/etc/rc.d/init.d/halt;/etc/rc.d/init.d/netfs"

  [*] Unmounting capability is inherited

  [*] Allow some known processes to kill init children

  Allowed processes: "/etc/rc.d/init.d/halt"

  [*] Killing capability is inherited

  看得出,我没有使用UPS,同时运行的是一个需要能够远程访问的服务器,我就按照上面的文件进行了配置,但是在实际