天天看點

網絡測試工具tomahawk之一 安裝篇

 tomahawk是一款用于測試入侵防禦系統(IPS)的工具,工作在OSI模型的第二層,隻能測試網橋型網絡裝置。它通過分析截獲的網絡資料封包件(需要有一個完整的TCP連接配接,包括三次握手包和四次分手包),分辨出其中的Client和Server端,再通過指定的兩個網卡發送出去,不同于TCPReplay的是,它對接收到的包進行分析,對于順序發送的資料包隻有前一個接收到,後一個才會發送,這樣保證了對捕獲資料包的真實回放。運作環境為Linux,用C編寫。

下載下傳和英文介紹文章可以從以下兩個站點獲得:

1.http://www.tomahawktesttool.org/ --介紹的比較詳細,以前還有一些典型的測試工具包

2.http://tomahawk.sourceforge.net/ --sf主站

      第一次接觸tomahawk緣于一次IPS産品測試,以前的對此類産品的測試方法是通過掃描,即在産品未接入的情況下,使用掃描器(如X-Scan)對計算機進行一次掃描記錄結果,再将産品以串聯方式接入重新掃描,通過比較兩次的掃描結果和察看産品的相應報警日志以判斷産品是否具備阻斷攻擊的功能。這種方法通過人工完成,隻能定性的判斷IPS的阻斷功能具備與否,更無法産生大流量的網絡資料。實驗室還有一台Smartbits 6000C,倒是可以産生大流量,可是其軟體websuite隻能産品20種左右的攻擊包,而且其價格昂貴,趕的上一輛寶馬了。于是在網上查了一下,發現了這個東西,下載下傳下來安裝了一下,由于它提供的攻擊樣本包不多,當初也沒有多注意,隻是把其當成了一種備用的測試工具。

      真正發現其好處又是另一次産品測試,這次送檢的是TippingPoint公司 的IPS,當時他們提供了一個測試工具就是tomahawk,聽說我以前用過這個,我們互相都有點驚訝,這個工具原來就是他們公司開發的一個開源軟體,找到了鼻祖,他們又提供了幾百個錄制的攻擊包,在使用tomahawk測試他們産品的時候才發現了這個工具的精妙。

       好了,廢話說到這裡,這一篇先來看看安裝:

       安裝環境為Linux redhat 9.0,其介紹上說需要三塊網卡,其中兩塊為千兆,可以産生300M左右的流量,另外一塊用于遠端管理使用,其實兩塊也是可以的,軟體方面gcc不用說了,還需要 libnet-1.0.2a.tar.gz、libpcap-0.8.1.tar.gz兩個庫,

       1.将tomahawk1.0.tar.gz、libnet-1.0.2a.tar.gz、libpcap-0.8.1.tar.gz三個檔案拷入同一檔案夾中,使用tar xzvf *分别解壓,

       2.進入    Libnet 目錄

網絡測試工具tomahawk之一 安裝篇

 chmod 777 configure

網絡測試工具tomahawk之一 安裝篇

 ./configure

網絡測試工具tomahawk之一 安裝篇

 make

     3.進入    libpcap目錄

網絡測試工具tomahawk之一 安裝篇

 chmod  777  configure

網絡測試工具tomahawk之一 安裝篇

 ./configure

網絡測試工具tomahawk之一 安裝篇

 make

      4.進入    tomahawk

網絡測試工具tomahawk之一 安裝篇

make

網絡測試工具tomahawk之一 安裝篇

make install --該指令将tomahawk拷入/usr/local/bin,以便以後在任何目錄下都可以運作。

如果tomahawk的make不成功,需察看Makefile檔案中Libnet 和libpcap的路徑設定是否正确,如下:

網絡測試工具tomahawk之一 安裝篇

PCAPDIR         =  .. / libpcap

網絡測試工具tomahawk之一 安裝篇

PCAPINCS     =   - I$(PCAPDIR)

網絡測試工具tomahawk之一 安裝篇

PCAPLIBS     =  $(PCAPDIR) / libpcap.a

網絡測試工具tomahawk之一 安裝篇

PCAPDEP         =  $(PCAPDIR) / pcap.h $(PCAPDIR) / libpcap.a

網絡測試工具tomahawk之一 安裝篇
網絡測試工具tomahawk之一 安裝篇

LNETDIR         =  .. / Libnet

網絡測試工具tomahawk之一 安裝篇

LNETINCS     =   - I$(LNETDIR) / include

網絡測試工具tomahawk之一 安裝篇

LNETLIBS     =  $(LNETDIR) / lib / libnet.a

網絡測試工具tomahawk之一 安裝篇

LNETDEP         =  $(LNETDIR) / include / libnet.h $(LNETDIR) / libnet.a

 在tomahawk目錄下運作

網絡測試工具tomahawk之一 安裝篇

tomahawk  - l  1   - f test.pcap 

如果結果為

網絡測試工具tomahawk之一 安裝篇

Beginning test

網絡測試工具tomahawk之一 安裝篇
網絡測試工具tomahawk之一 安裝篇

Completed  1  loop of trace test.pcap (hid:  1 )

網絡測試工具tomahawk之一 安裝篇
網絡測試工具tomahawk之一 安裝篇

Finished  1  loops of trace test.pcap Completed:  1 , Timed  out :  0

網絡測試工具tomahawk之一 安裝篇

Retrans:  0

網絡測試工具tomahawk之一 安裝篇

Sent:  9

網絡測試工具tomahawk之一 安裝篇

Recv:  9

網絡測試工具tomahawk之一 安裝篇

則安裝成功!  

下面介紹幾個常用的參數

-N 5     并發5個

-i eth0 從eth0發client

-j eth1 從eth1發server

-l 5      重複5次

-f  file  pcap封包件

-A 0 不改變PCAP包中的IP位址

-A 1 改變PCAP包中的IP位址

-R 1-1000 限制為1M-1000M的流量, 0.1表示100k

-a 10.0.0.1 以10.0.0.1 攻擊,此時不用使用 -A 1參數了

在實際使用中,往往使用到多個攻擊封包件,僅僅通過檢視sent和recv無法判斷到底哪個攻擊被阻斷,在tomahawk提供的樣本攻擊包中還有一個attack腳本

網絡測試工具tomahawk之一 安裝篇

# !/ bin / bash

網絡測試工具tomahawk之一 安裝篇

if  [ $#  ==   1  ]; then

網絡測試工具tomahawk之一 安裝篇

  loops = $ 1

網絡測試工具tomahawk之一 安裝篇

else

網絡測試工具tomahawk之一 安裝篇

  loops = 1

網絡測試工具tomahawk之一 安裝篇

fi

網絡測試工具tomahawk之一 安裝篇
網絡測試工具tomahawk之一 安裝篇

#export PATH = $PATH:.. / bin

網絡測試工具tomahawk之一 安裝篇

cd  / home / tomahawk / tomahawk / pcap

網絡測試工具tomahawk之一 安裝篇

echo  " running 16 attacks $loops times (each attack) "

網絡測試工具tomahawk之一 安裝篇

tomahawk  - i eth0  - j eth1  - m  200   - r  10   - t  100   - n  2   - a  202 .202.202.202  - l $loops 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.backdoor_novargA_infection 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.ftp_realpath_buffer_overflow_exploit 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.H225_source_address_dialedDigits_length_anomaly 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.http_apache_openSSL_slapper_worm 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.http_code_red_II_worm 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.http_IIS_printer_buffer_overflow 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.http_nimda_attack_cmd_exe 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.http_yahoo_audio_conferencing_activeX_control_buffer_anomaly 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.kazaa_file_download_upload 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.ms_rpc_DCOM_ISystemActivator_overflow 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.ms_sql_slammer_sapphire_worm 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.mySQL_authentication_bypass 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.smb_bugearB_worm_network_propagation 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.smb_SMBdie_exploit 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.smtp_bugbear_worm_email_propagation 

網絡測試工具tomahawk之一 安裝篇

         - f pcap.telnet_SGI_buffer_overflow_exploit  |  grep  ' ^Finish '   |  

網絡測試工具tomahawk之一 安裝篇

        sed  - e  ' s/^F.*trace *// '   - e  ' s/,// '   - e  ' s/Completed/Permitted/g '  

網絡測試工具tomahawk之一 安裝篇

             - e  ' s/Timed *out/Blocked/g '   |  column  - t

運作attack

網絡測試工具tomahawk之一 安裝篇

pcap.ms_sql_slammer_sapphire_worm                                  Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.http_nimda_attack_cmd_exe                                     Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.http_yahoo_audio_conferencing_activeX_control_buffer_anomaly  Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.ms_rpc_DCOM_ISystemActivator_overflow                         Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.H225_source_address_dialedDigits_length_anomaly               Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.http_IIS_printer_buffer_overflow                              Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.mySQL_authentication_bypass                                   Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.http_code_red_II_worm                                         Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.smb_SMBdie_exploit                                            Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.telnet_SGI_buffer_overflow_exploit                            Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.backdoor_novargA_infection                                    Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.ftp_realpath_buffer_overflow_exploit                          Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.smtp_bugbear_worm_email_propagation                           Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.kazaa_file_download_upload                                    Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.smb_bugearB_worm_network_propagation                          Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

pcap.http_apache_openSSL_slapper_worm                              Permitted:   1   Blocked:   0

網絡測試工具tomahawk之一 安裝篇

從上面可以清楚地看到被阻斷的攻擊(Blocked)

------------------

如本文一開始所提到的,tomahawk是一款二層裝置測試工具,在平時的檢測工作中經常會遇到三層的IPS,如現在的防火牆或多或少都帶了一點IPS的功能以保護DMZ區的伺服器不被攻擊。在後面的文章中,将對tomahawk的代碼進行分析和修改,使之可以測試網關類的三層裝置。

------------------

本篇完

繼續閱讀