Nessus簡(jiǎn)介
Nessus 簡(jiǎn)介(轉(zhuǎn)載)2007-03-21 11:13一、Nessus 簡(jiǎn)介Nessus 是一個(gè)功能強(qiáng)大而又易于使用的遠(yuǎn)程安全掃描器,它不僅免費(fèi)而且更新極快。安全掃描器的功能是對(duì)指定網(wǎng)絡(luò)進(jìn)行安全檢
Nessus 簡(jiǎn)介(轉(zhuǎn)載)
2007-03-21 11:13
一、Nessus 簡(jiǎn)介
Nessus 是一個(gè)功能強(qiáng)大而又易于使用的遠(yuǎn)程安全掃描器,它不僅免費(fèi)而且更新極快。安全掃描器的功能是對(duì)指定網(wǎng)絡(luò)進(jìn)行安全檢查,找出該網(wǎng)絡(luò)是否存在有導(dǎo)致對(duì)手攻擊的安全漏洞。該系統(tǒng)被設(shè)計(jì)為client/sever模式,服務(wù)器端負(fù)責(zé)進(jìn)行安全檢查,客戶端用來(lái)配置管理服務(wù)器端。在服務(wù)端還采用了plug-in 的體系,允許用戶加入執(zhí)行特定功能的插件,這插件可以進(jìn)行更快速和更復(fù)雜的安全檢查。在Nessus 中還采用了一個(gè)共享的信息接口,稱之知識(shí)庫(kù),其中保存了前面進(jìn)行檢查的結(jié)果。檢查的結(jié)果可以HTML 、純文本、LaTeX (一種文本文件格式)等幾種格式保存。
在未來(lái)的新版本中,Nessus 將會(huì)支持快速更快的安全檢查,而且這種檢查將會(huì)占用更少的帶寬,其中可能會(huì)用到集群的技術(shù)以提高系統(tǒng)的運(yùn)行效率。 Nessus 的優(yōu)點(diǎn)在于:
1、 其采用了基于多種安全漏洞的掃描,避免了掃描不完整的情況。
2、 它是免費(fèi)的,比起商業(yè)的安全掃描工具如ISS 具有價(jià)格優(yōu)勢(shì)。
3、 在Nmap 用戶參與的一次關(guān)于最喜歡的安全工具問卷調(diào)查中(評(píng)選結(jié)果附后),在與眾多商用系統(tǒng)及開放源代碼的系統(tǒng)競(jìng)爭(zhēng)中,Nessus 名列榜首。群眾的眼睛是雪亮的:)。
4、 Nessus 擴(kuò)展性強(qiáng)、容易使用、功能強(qiáng)大,可以掃描出多種安全漏洞。
Nessus 的安全檢查完全是由plug-ins 的插件完成的。到本文完成時(shí)為止,Nessus 提供的安全檢查插件已達(dá)18類705個(gè),而且這個(gè)數(shù)量以后還會(huì)增加。比如:在“useless services”類中,“Echo port open”和”Chargen”插件用來(lái)測(cè)試主機(jī)是否易受到已知的echo-chargen 攻擊。在“backdoors”類中,”pc anywhere”插件用來(lái)檢查主機(jī)是否運(yùn)行了BO 、PcAnywhere 等后臺(tái)程序,可喜的是其中包括了最近肆虐一時(shí)的CodeRed 及其變種的檢測(cè)。 在Nessus 主頁(yè)中不但詳細(xì)介紹了各種插件的功能,還提供了解決問題的相關(guān)方案。有關(guān)plug-in 的詳細(xì)說明,請(qǐng)看
[url]http://cgi.nessus.org/plugins/dump.php3?viewby=family[/url]
除了這些插件外,Nessus 還為用戶提供了描述攻擊類型的腳本語(yǔ)言,來(lái)進(jìn)行附加的安全測(cè)試,這種語(yǔ)言稱為Nessus 攻擊腳本語(yǔ)言(NSSL ),用它來(lái)完成插件的編寫。
在客戶端,用戶可以指定運(yùn)行Nessus 服務(wù)的機(jī)器、使用的端口掃描器及測(cè)試的內(nèi)容及測(cè)試的IP 地址范圍。Nessus 本身是工作在多線程基礎(chǔ)上的,所以用戶還可以設(shè)置系統(tǒng)同時(shí)工作的線程數(shù)。這樣用戶在遠(yuǎn)端就可以設(shè)置Nessus 的工作配置了。安全檢測(cè)完成后,服務(wù)端將檢測(cè)結(jié)果返回到客戶端,客戶端生成直觀的報(bào)告。在這個(gè)過程當(dāng)中,由于服務(wù)器向客戶端傳送的內(nèi)容是系統(tǒng)的安全弱點(diǎn),為了防止通信內(nèi)容受到監(jiān)聽,其傳輸過程還可以選擇加密。
二、安裝Nessus
前面講到,Nessus 由客戶端和服務(wù)器端兩部分組成。我們先來(lái)看服務(wù)器端的安裝。
1、 下載與安裝
你可以到[url]http://www.nessus.org/download.html[/url]去下載nessus 的最新版本。Nessus 分為服務(wù)器端和客戶端兩部分,而服務(wù)器端又分為穩(wěn)定版和實(shí)驗(yàn)版兩種版本,建議你下載穩(wěn)定的版本,如果你不是太急于看到實(shí)驗(yàn)版本中的新功能的話。
同樣,nessus 的客戶端有兩個(gè)版本,JAVA 版本及C 版本,JAVA 版本的可以在多個(gè)平臺(tái)中運(yùn)行,C 版本的支持Windows ,有了這兩個(gè)客戶端的版本你就可以在局域網(wǎng)的任何的一臺(tái)機(jī)器上進(jìn)行安全檢查了。
下面我們來(lái)看看服務(wù)器端的安裝。服務(wù)器端共有四個(gè)安裝包組成:
· nessus-libraries-x.x.tar.gz
· libnasl-x.x.tar.gz
· nessus-core.x.x.tar.gz
· nessus-plugins.x.x.tar.gz
一定要按照以上的順序安裝各個(gè)軟件包。首先用tar –xzvf nessus-* 將這四個(gè)軟件包解開。第一個(gè)先安裝nessus 的lib 庫(kù):
cd nessus-libaries
./configure
make
,以root 身份執(zhí)行make install。
然后以同樣的方法按照上面的順序安裝其它三個(gè)軟件包。
在安裝完畢后,確認(rèn)在/etc/ld.so.conf文件加入安裝已安裝庫(kù)文件的路徑:/usr/local/lib。如果沒有,你只需在該文件中加入這個(gè)路徑,然后執(zhí)行l(wèi)dconfig ,這樣nessus 運(yùn)行的時(shí)候就可以找著運(yùn)行庫(kù)了。
2、 創(chuàng)建一個(gè)用戶
Nessus 服務(wù)端有自己的用戶資料庫(kù),其中對(duì)每個(gè)用戶都做了約束。用戶可以在整個(gè)網(wǎng)絡(luò)范圍內(nèi)通過nessusd 服務(wù)端進(jìn)行安全掃描。
創(chuàng)建用戶的方法如下:
$ nessus-adduser
Addition of a new nessusd user
------------------------------
Login : admin //輸入用戶名
Pass : secret //用戶口令
Authentification type (cipher or plaintext) [cipher] : cipher //選擇認(rèn)證過程是否加密,
Now enter the rules for this user, and hit ctrl-D once you are done :
(the user can have an empty rule set)
^D
Login : admin
Pssword : secret
Authentification : cipher
Rules :
Is that ok (y/n) ? [y] y
user added.
Nessus-adduser 是Nessusd 的附帶工具,安裝完畢后,在安裝目錄下會(huì)產(chǎn)生這個(gè)程序。
3、 配置Nessus 服務(wù)端程序Nessusd
它的配置文件為nessusd.conf ,位于/usr/local/etc/nessus/目錄下。一般情況下,不建議你改動(dòng)其中的內(nèi)容,除非你確實(shí)有需要。
4、 啟動(dòng)nessusd
在上面的準(zhǔn)備工作完成后,以root 用戶的身份用下面的命令啟動(dòng)服務(wù)端:nessusd –D
三、進(jìn)行安全掃描
按照上面的方法啟動(dòng)Nessus 的服務(wù)進(jìn)程后,就可以執(zhí)行客戶端程序進(jìn)行安全掃描了。
上面就是啟動(dòng)界面了。首先提示你登錄到nessus 服務(wù)器,在Nessus Host后面輸入Nessus 服務(wù)器所在的Linux 機(jī)器IP 地址,端口號(hào)及加密方式不需要做改動(dòng)。下面輸入用戶名,點(diǎn)擊Log in登錄。一旦登錄成功,Log in的按鈕會(huì)變?yōu)長(zhǎng)og out,對(duì)話框的旁邊還會(huì)有connected 的提示。
好了,下面我們通過選擇Plug-in 插件來(lái)進(jìn)行相應(yīng)的安全掃描:
,如上圖所示,在上半部分的是插件選擇,下面是插件所能檢查的攻擊方法,點(diǎn)擊每個(gè)攻擊方法會(huì)彈出一個(gè)對(duì)話框介紹它的危害性及解決方法,如下圖所示:
建議選擇全部的插件以增加安全掃描的完整性。
下面選擇掃描的目標(biāo)主機(jī),點(diǎn)擊“target selection”
在窗口中輸入目標(biāo)地址,如上面所輸入的:192.168.6.26,這里作者用的是一個(gè)內(nèi)部地址,你還可以用192.168.6.26/24的方式指定掃描
192.168.6.1-192.168.6.255整個(gè)網(wǎng)段,抑或用x.y.z 及選中下面的Perform a DNS zone transfer選項(xiàng)一起通過域名系統(tǒng)查找目標(biāo)的IP ,
最后還有一個(gè)可選項(xiàng)是用戶規(guī)則,規(guī)則是用來(lái)對(duì)用戶所做的掃描操作進(jìn)行約束,比如我想對(duì)除了192.168.6.4這個(gè)地址以外的所有192.168.6網(wǎng)段主機(jī)進(jìn)行掃描,那就可以在規(guī)則設(shè)置中輸入:
reject 192.168.6.4
default accept
這一切都OK 后,點(diǎn)擊start 開始進(jìn)行掃描。
四、掃描結(jié)果
當(dāng)掃描結(jié)束后,會(huì)生成如下形式的報(bào)表:
在窗口的左邊列出了所有被掃描的主機(jī),只要用鼠標(biāo)點(diǎn)擊主機(jī)名稱,在窗口右邊就列出了經(jīng)掃描發(fā)現(xiàn)的該主機(jī)的安全漏洞。再點(diǎn)擊安全漏洞的小圖標(biāo)會(huì)列出該問題的嚴(yán)重等級(jí)及問題的產(chǎn)生原因及解決方法。
最后,你還可以將掃描結(jié)果以多種格式存盤,做為參考資料供以后使用
附:排名前50的網(wǎng)絡(luò)安全工具
在2000年的五、六月間,由nmap-hacker 郵件列表中的1200名Nmap 用戶發(fā)起了最佳安全工具的評(píng)選活動(dòng),每個(gè)用戶最多可以選出5個(gè)最佳工具。 最后,評(píng)選出以下50個(gè)最佳的網(wǎng)絡(luò)安全工具。對(duì)那些在網(wǎng)絡(luò)安全領(lǐng)域剛?cè)腴T的用戶來(lái)說,這個(gè)投票結(jié)果對(duì)選取何種網(wǎng)絡(luò)安全工具有相當(dāng)?shù)膮⒖純r(jià)值。
二、安裝nessusd
In this "How To" I'll attempt to guide you through how to uninstall nessus 2.2.8 and install the latest version in the 2.2.x branch. This how to is provided mainly for users who are less familiar with Linux. I do encourage you to read the whole procedure to make sure you understand what you're about to do. If you have the ability to test this in a lab environment, please do so. I'd hate to see you mess up your production server(s).
Update Nessus from 2.2.8 to the latest version in the 2.2.x series.
At the time of this writing, the Nessus 2.2.x branch is version 2.2.11.
I kept running into problems with Nessus freezing when scanning a large number of hosts or a subnet. After many hours of troubleshooting this problem as well as countless Google searches I decided that an upgrade of nessus was in order. I've read many reports that upgrading the latest version will fix it. I'm happy to report that
,nessus no longer freezes up on me when scanning large subnets. w00t!
I was unable to locate any third party apt repositories that had the latest version of nessus. We'll have to resort to installing from source. I'll do my best to keep all the files in the same locations as the Debian installer. As far as I can tell, there is no easy way to use the nessus installer and change the locations of the various components.
This how to is tested in a freshly installed OSSIM vmware install using the 1.0.4 ISO installer. Immediately following the install, apt-get update && apt-get dist-upgrade was run. A reboot to get to the newly installed kernel was in order. The OSSIM update script was also run to get the installer to the latest version 1.0.5p1
1. Backup the nessusd init script which is provided by debian.
cp /etc/init.d/nessusd /root/nessusd.init
2. Stop and remove the old version of nessus
/etc/init.d/nessusd stop
apt-get --purge remove libnasl2 libnessus2 nessus nessusd nessus-plugins
3. In order to compile source code, we'll have to install some tools. We can remove these later after we're done with our install. Removing them later is optional but recommended.
apt-get install build-essential sharutils flex bison libssl-dev
4. Go to and download the latest source for the 2.2.x branch.
Download all of the following components. Save them to some temp directory on your server.
libnasl-2.2.11.tar.gz (359 KB)
nessus-core-2.2.11.tar.gz (664 KB)
nessus-libraries-2.2.11.tar.gz (418 KB)
nessus-plugins-2.2.11.tar.gz (7468 KB)
nessus-plugins-GPL-2.2.11.tar.gz (1071 KB)
Unless you have a direct feed, be sure to register for the delayed plugins. You'll need it later.
5. Extract the nessus-libraries and change to that directory.
tar xof nessus-libraries-2.2.11.tar.gz && cd nessus-libraries
,6. Configure, make and make install the libraries.
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --sharedstatedir=/var/lib && make && make install
7. Extract the libnasl and change to that directory.
tar xof libnasl-2.2.11.tar.gz && cd libnasl
8. Configure, make and make install the libnasl.
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --sharedstatedir=/var/lib && make && make install
9. Extract the nessus-core and change to that directory.
tar xof nessus-core-2.2.11.tar.gz && cd nessus-core
10. Configure the nessus core without gtk, make and make install nessus-core
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --sharedstatedir=/var/lib --libdir=/var/lib --disable-gtk && make && make install
11. Extract the nessus-plugins and change to that directory.
tar xof nessus-plugins-2.2.11.tar.gz
tar xof nessus-plugins-GPL-2.2.11.tar.gz && cd nessus-plugins
12. Configure the nessus-plugins
./configure --prefix=/usr --sysconfdir=/etc
--sharedstatedir=/var/lib --libdir=/var/lib --localstatedir=/var/lib
13. Edit the makefile in order to avoid an error when you run make install Edit Makefile line 26
for scripts in scripts/*.nasl scripts/*.nbin; do
for scripts in scripts/*.nasl; do
If you don't edit the Makefile, you'll receive the following error when running make install.
/usr/bin/install: cannot stat `scripts/*.nbin': No such file or directory make: *** [install-nasl] Error 1
14. make && make install the nessus-plugins
make && make install
15. Add /usr/lib to ld.so.conf
echo "/usr/lib" >> /etc/ld.so.conf
ldconfig
16. Register nessus to get the latest plugins.
/usr/bin/nessus-fetch --register S0M3-C0D3-FR0M-T3NA-BL3!
,17. Create a nessusd certifcate.
/usr/sbin/nessus-mkcert
You can take the defaults or fill in the blanks. Your choice.
18. Remove the old ossim user that is left over from the previous install. /usr/sbin/nessus-rmuser
ossim
19. Create a nessus userid and password for ossim to use.
/usr/sbin/nessus-adduser
Name the user ossim and set a password.
Note: You may want to use the password in the /etc/ossim/ossim_setup.conf file. If you run the reconfigure script, the nessus user password will be overwritten.
20. Update the OSSIM configuration via the web interface
Configuration --> Main --> Nessus
Update the nessus_user and nessus_pass with the values from the previous step if you decided to change the password.
21. Copy the backup nessusd init.d script back
cp /root/nessusd.init /etc/init.d/nessusd
22. Edit /etc/init.d/nessusd file to update a couple of paths
I couldn't get all of the files to install in the exact location as before. I've spent too much time on trying to get all of the files back to their original location than if I would just edit a couple of lines in the init file.
Change
PIDFILE=/var/run/nessusd.pid to
PIDFILE=/var/lib/nessus/nessusd.pid
PRIVCERTDIR=/var/lib/nessus/private/CA/ to
PRIVCERTDIR=/var/lib/nessus/CA/
23. Start nessusd
/etc/init.d/nessusd start
24. Update OSSIM's database with the latest nessus plugin IDs.
/usr/share/ossim/scripts/update_nessus_ids.pl
25. If you no longer need the packages we installed earlier, remove them. apt-get remove build-essential sharutils flex bison libssl-dev
,26. If you are using the delayed feed like me, it's not a bad idea to set an entry in cron to download the latest plugins. You'll also want to have it run the update_nessus_ids script after nessus has loaded the new plugins. I do this on a weekly basis. For more information on how to use cron, please see the following site. Of course you could also check out your local cron man page.
I was able to successfully follow these instructions in both a lab environment and in my production environment too.