Nessus是目前比较流行的网络漏洞扫描与分析工具,由美国的Tenable Network Security,Inc公司出品。本文将介绍如何在RHEL5下搭建Nessus漏洞检测系统,以提高企业网络的安全性。
一.安装Nessus漏洞检测系统:
1.所用软件包:
Nessus-3.2.1-es5.i386.rpm
NessusClient-3.2.1-es5.i386.rpm
软件包下载地址:http://www.nessus.org/download/
2.安装服务器端软件包:
[root@linux5234 ~]# mount /dev/hdc /media/
mount: block device /dev/hdc is write-protected, mounting read-only
[root@linux5234 ~]# cd /media/5
[root@linux5234 5]# ls
NessusClient-3.2.1-es5.i386.rpm
mount: block device /dev/hdc is write-protected, mounting read-only
[root@linux5234 ~]# cd /media/5
[root@linux5234 5]# ls
NessusClient-3.2.1-es5.i386.rpm
Nessus-3.2.0-es5.i386.rpm
[root@linux5234 5]# rpm -ivh Nessus-3.2.0-es5.i386.rpm
Preparing... ########################################### [100%]
1:Nessus ########################################### [100%]
nessusd (Nessus) 3.2.0. for Linux
(C) 1998 - 2008 Tenable Network Security, Inc.
Processing the Nessus plugins...
[##################################################]
[root@linux5234 5]# rpm -ivh Nessus-3.2.0-es5.i386.rpm
Preparing... ########################################### [100%]
1:Nessus ########################################### [100%]
nessusd (Nessus) 3.2.0. for Linux
(C) 1998 - 2008 Tenable Network Security, Inc.
Processing the Nessus plugins...
[##################################################]
3.安装客户端软件包:
[root@localhost ~]# mount /dev/cdrom /media/
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@localhost ~]# cd /media/5
[root@localhost 5]# ls
NessusClient-3.2.1-es5.i386.rpm
Nessus-3.2.0-es5.i386.rpm
[root@localhost 5]# rpm -ivh NessusClient-3.2.1-es5.i386.rpm
Preparing... ########################################### [100%]
1:NessusClient ########################################### [100%]
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@localhost ~]# cd /media/5
[root@localhost 5]# ls
NessusClient-3.2.1-es5.i386.rpm
Nessus-3.2.0-es5.i386.rpm
[root@localhost 5]# rpm -ivh NessusClient-3.2.1-es5.i386.rpm
Preparing... ########################################### [100%]
1:NessusClient ########################################### [100%]
4.分别在服务器端和客户端添加执行程序的路径、帮助文件路径,这样我们就不必输入nessus相关命令的绝对路径来执行程序命令:
#export PATH=/opt/nessus/sbin:/opt/nessus/bin:$PATH
#export MANPATH=/opt/nessus/man:'manpath'
#vi /root/.bash_profile
export PATH=/opt/nessus/sbin:/opt/nessus/bin:$PATH
export MANPATH=/opt/nessus/man:'manpath'
#export MANPATH=/opt/nessus/man:'manpath'
#vi /root/.bash_profile
export PATH=/opt/nessus/sbin:/opt/nessus/bin:$PATH
export MANPATH=/opt/nessus/man:'manpath'
二.配置NessusD服务端:
1.在服务器端启动nessusd服务:
[root@linux5234 ~]# service nessusd start
2.在服务器端添加扫描的用户:
[root@linux5234 ~]# nessus-adduser
Using /var/tmp as a temporary file holder
Add a new nessusd user
----------------------
Login : scaner //输入设置的用户名
Authentication (pass/cert) [pass] : //直接回车,使用密码验证方式
Login password : //输入设置的密码
Login password (again) : //重复输入密码
User rules
----------
nessusd has a rules system which allows you to restrict the hosts
that scaner has the right to test. For instance, you may want
him to be able to scan his own host only.
Please see the nessus-adduser(8) man page for the rules syntax
Enter the rules for this user, and hit ctrl-D once you are done :
(the user can have an empty rules set)
accept 192.168.0.0/24 //设置允许扫描的网段
default deny //设置默认策略为拒绝,回车后按Ctrl+D组合键提交
Login : scaner
Password : ***********
DN :
Rules :
accept 192.168.0.0/24
default deny
Is that ok ? (y/n) [y]
user added.
Using /var/tmp as a temporary file holder
Add a new nessusd user
----------------------
Login : scaner //输入设置的用户名
Authentication (pass/cert) [pass] : //直接回车,使用密码验证方式
Login password : //输入设置的密码
Login password (again) : //重复输入密码
User rules
----------
nessusd has a rules system which allows you to restrict the hosts
that scaner has the right to test. For instance, you may want
him to be able to scan his own host only.
Please see the nessus-adduser(8) man page for the rules syntax
Enter the rules for this user, and hit ctrl-D once you are done :
(the user can have an empty rules set)
accept 192.168.0.0/24 //设置允许扫描的网段
default deny //设置默认策略为拒绝,回车后按Ctrl+D组合键提交
Login : scaner
Password : ***********
DN :
Rules :
accept 192.168.0.0/24
default deny
Is that ok ? (y/n) [y]
user added.
【注意】管理所添加的扫描用户的方法:
nessus-rmuser脚本可以删除指定的扫描用户
nessus-chpasswd脚本用于修改密码
三.使用NessusClient用户端:
1.运行Nessus用户端程序:
Nessus用户端需要在Linux系统图形模式中运行,执行“NessusClinet &”,打开NessusClient用户端软件:
[root@localhost 5]# NessusClient &
2.连接NessusD服务端:
单击NessusClient用户端界面的“Connect”,在弹出的对话框点击左下方的“+”号按扭,设置好连接名称、需要登录的Nessus服务器地址,以及使用的扫描用户名和密码,然后单击“Save”保存:
在“Connection Manager”连接管理器中,选择上一步创建的“New Connection”,然后点击“Connect”进行连接:
3.添加扫描目标:
在“Scan”选项卡中,单击“Network(s) to scan”栏下方的“+”号按钮,设置需要扫描的主机或网络地址,本次扫描为一段范围内的主机,单击“Save”保存:
4.开始漏洞扫描:
返回到“Ssan”选项卡,从左侧列表中选择刚设置的扫描目标,在右侧列表中选择“Default scan policy”默认扫描策略,然后单击下方的“Scan Now”按钮,执行漏洞扫描:
5.获取及分析漏洞检测报告:
扫描结束后,点击“Report”选项卡查看漏洞检测结果。针对目标主机的每一项扫描内容,都可以获取摘要信息、具体描述、风险、建议解决办法等数据。以橙色、红色标示出来扫描结果项表示风险较高的安全隐患。Nessus会根据已知的风险评估给出相应的解决办法,我们依此进行处理,解除隐患。
另外,单击右侧的“Export”按钮将检测结果导出为Html文件保存,以方便在浏览器中查看:
本文转自 kk5234 51CTO博客,原文链接:http://blog.51cto.com/kk5234/402772,如需转载请自行联系原作者