Nessus簡介
Nessus 簡介(轉(zhuǎn)載)2007-03-21 11:13一、Nessus 簡介Nessus 是一個功能強大而又易于使用的遠程安全掃描器,它不僅免費而且更新極快。安全掃描器的功能是對指定網(wǎng)絡(luò)進行安全檢
Nessus 簡介(轉(zhuǎn)載)
2007-03-21 11:13
一、Nessus 簡介
Nessus 是一個功能強大而又易于使用的遠程安全掃描器,它不僅免費而且更新極快。安全掃描器的功能是對指定網(wǎng)絡(luò)進行安全檢查,找出該網(wǎng)絡(luò)是否存在有導致對手攻擊的安全漏洞。該系統(tǒng)被設(shè)計為client/sever模式,服務器端負責進行安全檢查,客戶端用來配置管理服務器端。在服務端還采用了plug-in 的體系,允許用戶加入執(zhí)行特定功能的插件,這插件可以進行更快速和更復雜的安全檢查。在Nessus 中還采用了一個共享的信息接口,稱之知識庫,其中保存了前面進行檢查的結(jié)果。檢查的結(jié)果可以HTML 、純文本、LaTeX (一種文本文件格式)等幾種格式保存。
在未來的新版本中,Nessus 將會支持快速更快的安全檢查,而且這種檢查將會占用更少的帶寬,其中可能會用到集群的技術(shù)以提高系統(tǒng)的運行效率。 Nessus 的優(yōu)點在于:
1、 其采用了基于多種安全漏洞的掃描,避免了掃描不完整的情況。
2、 它是免費的,比起商業(yè)的安全掃描工具如ISS 具有價格優(yōu)勢。
3、 在Nmap 用戶參與的一次關(guān)于最喜歡的安全工具問卷調(diào)查中(評選結(jié)果附后),在與眾多商用系統(tǒng)及開放源代碼的系統(tǒng)競爭中,Nessus 名列榜首。群眾的眼睛是雪亮的:)。
4、 Nessus 擴展性強、容易使用、功能強大,可以掃描出多種安全漏洞。
Nessus 的安全檢查完全是由plug-ins 的插件完成的。到本文完成時為止,Nessus 提供的安全檢查插件已達18類705個,而且這個數(shù)量以后還會增加。比如:在“useless services”類中,“Echo port open”和”Chargen”插件用來測試主機是否易受到已知的echo-chargen 攻擊。在“backdoors”類中,”pc anywhere”插件用來檢查主機是否運行了BO 、PcAnywhere 等后臺程序,可喜的是其中包括了最近肆虐一時的CodeRed 及其變種的檢測。 在Nessus 主頁中不但詳細介紹了各種插件的功能,還提供了解決問題的相關(guān)方案。有關(guān)plug-in 的詳細說明,請看
[url]http://cgi.nessus.org/plugins/dump.php3?viewby=family[/url]
除了這些插件外,Nessus 還為用戶提供了描述攻擊類型的腳本語言,來進行附加的安全測試,這種語言稱為Nessus 攻擊腳本語言(NSSL ),用它來完成插件的編寫。
在客戶端,用戶可以指定運行Nessus 服務的機器、使用的端口掃描器及測試的內(nèi)容及測試的IP 地址范圍。Nessus 本身是工作在多線程基礎(chǔ)上的,所以用戶還可以設(shè)置系統(tǒng)同時工作的線程數(shù)。這樣用戶在遠端就可以設(shè)置Nessus 的工作配置了。安全檢測完成后,服務端將檢測結(jié)果返回到客戶端,客戶端生成直觀的報告。在這個過程當中,由于服務器向客戶端傳送的內(nèi)容是系統(tǒng)的安全弱點,為了防止通信內(nèi)容受到監(jiān)聽,其傳輸過程還可以選擇加密。
二、安裝Nessus
前面講到,Nessus 由客戶端和服務器端兩部分組成。我們先來看服務器端的安裝。
1、 下載與安裝
你可以到[url]http://www.nessus.org/download.html[/url]去下載nessus 的最新版本。Nessus 分為服務器端和客戶端兩部分,而服務器端又分為穩(wěn)定版和實驗版兩種版本,建議你下載穩(wěn)定的版本,如果你不是太急于看到實驗版本中的新功能的話。
同樣,nessus 的客戶端有兩個版本,JAVA 版本及C 版本,JAVA 版本的可以在多個平臺中運行,C 版本的支持Windows ,有了這兩個客戶端的版本你就可以在局域網(wǎng)的任何的一臺機器上進行安全檢查了。
下面我們來看看服務器端的安裝。服務器端共有四個安裝包組成:
· nessus-libraries-x.x.tar.gz
· libnasl-x.x.tar.gz
· nessus-core.x.x.tar.gz
· nessus-plugins.x.x.tar.gz
一定要按照以上的順序安裝各個軟件包。首先用tar –xzvf nessus-* 將這四個軟件包解開。第一個先安裝nessus 的lib 庫:
cd nessus-libaries
./configure
make
,以root 身份執(zhí)行make install。
然后以同樣的方法按照上面的順序安裝其它三個軟件包。
在安裝完畢后,確認在/etc/ld.so.conf文件加入安裝已安裝庫文件的路徑:/usr/local/lib。如果沒有,你只需在該文件中加入這個路徑,然后執(zhí)行l(wèi)dconfig ,這樣nessus 運行的時候就可以找著運行庫了。
2、 創(chuàng)建一個用戶
Nessus 服務端有自己的用戶資料庫,其中對每個用戶都做了約束。用戶可以在整個網(wǎng)絡(luò)范圍內(nèi)通過nessusd 服務端進行安全掃描。
創(chuàng)建用戶的方法如下:
$ nessus-adduser
Addition of a new nessusd user
------------------------------
Login : admin //輸入用戶名
Pass : secret //用戶口令
Authentification type (cipher or plaintext) [cipher] : cipher //選擇認證過程是否加密,
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 的附帶工具,安裝完畢后,在安裝目錄下會產(chǎn)生這個程序。
3、 配置Nessus 服務端程序Nessusd
它的配置文件為nessusd.conf ,位于/usr/local/etc/nessus/目錄下。一般情況下,不建議你改動其中的內(nèi)容,除非你確實有需要。
4、 啟動nessusd
在上面的準備工作完成后,以root 用戶的身份用下面的命令啟動服務端:nessusd –D
三、進行安全掃描
按照上面的方法啟動Nessus 的服務進程后,就可以執(zhí)行客戶端程序進行安全掃描了。
上面就是啟動界面了。首先提示你登錄到nessus 服務器,在Nessus Host后面輸入Nessus 服務器所在的Linux 機器IP 地址,端口號及加密方式不需要做改動。下面輸入用戶名,點擊Log in登錄。一旦登錄成功,Log in的按鈕會變?yōu)長og out,對話框的旁邊還會有connected 的提示。
好了,下面我們通過選擇Plug-in 插件來進行相應的安全掃描:
,如上圖所示,在上半部分的是插件選擇,下面是插件所能檢查的攻擊方法,點擊每個攻擊方法會彈出一個對話框介紹它的危害性及解決方法,如下圖所示:
建議選擇全部的插件以增加安全掃描的完整性。
下面選擇掃描的目標主機,點擊“target selection”
在窗口中輸入目標地址,如上面所輸入的:192.168.6.26,這里作者用的是一個內(nèi)部地址,你還可以用192.168.6.26/24的方式指定掃描
192.168.6.1-192.168.6.255整個網(wǎng)段,抑或用x.y.z 及選中下面的Perform a DNS zone transfer選項一起通過域名系統(tǒng)查找目標的IP ,
最后還有一個可選項是用戶規(guī)則,規(guī)則是用來對用戶所做的掃描操作進行約束,比如我想對除了192.168.6.4這個地址以外的所有192.168.6網(wǎng)段主機進行掃描,那就可以在規(guī)則設(shè)置中輸入:
reject 192.168.6.4
default accept
這一切都OK 后,點擊start 開始進行掃描。
四、掃描結(jié)果
當掃描結(jié)束后,會生成如下形式的報表:
在窗口的左邊列出了所有被掃描的主機,只要用鼠標點擊主機名稱,在窗口右邊就列出了經(jīng)掃描發(fā)現(xiàn)的該主機的安全漏洞。再點擊安全漏洞的小圖標會列出該問題的嚴重等級及問題的產(chǎn)生原因及解決方法。
最后,你還可以將掃描結(jié)果以多種格式存盤,做為參考資料供以后使用
附:排名前50的網(wǎng)絡(luò)安全工具
在2000年的五、六月間,由nmap-hacker 郵件列表中的1200名Nmap 用戶發(fā)起了最佳安全工具的評選活動,每個用戶最多可以選出5個最佳工具。 最后,評選出以下50個最佳的網(wǎng)絡(luò)安全工具。對那些在網(wǎng)絡(luò)安全領(lǐng)域剛?cè)腴T的用戶來說,這個投票結(jié)果對選取何種網(wǎng)絡(luò)安全工具有相當?shù)膮⒖純r值。
二、安裝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.