歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> WEB安全工具

WEB安全工具

日期:2017/2/27 14:16:14   编辑:更多Linux

作者:Gary Bahadur 編譯:nixe0n 隨著INTERNET的普及,現在的WEB站點將面對更多的安全威脅。本文將介紹一些Linux環境下的一些幫助系統管理員抵御網絡攻擊的自由安全工具。 現在,有大量的自由軟件可以幫助我們加強WEB服務器的安全。然而,在商業領域,只有Cybercop ( www.nai.com)、ISS ( www.iss.net)、Retina ( www.eeye.com)等幾種相關產品。 加強WEB服務器的安全主要從三個方面入手。1).其所處的網絡;2).運行的操作系統;3).服務器上運行的應用程序。本文我將詳細介紹一些工具,你可以使用這些工具來加強自己WEB服務器的安全。 對於WEB服務器的測試最好能夠采用結構化的方式。如果你是管理的是一個小網絡,你可能對於每台服務器使用的操作系統和運行的程序有比較清楚的了解。但是對於一個大型網絡,要對每台服務器都有清楚的了解是非常困難的。在這種情況下,可以采取以下四個步驟,進行了解: 指紋特征分析:掃描主機的操作系統、運行的應用程序和提供的服務。 缺陷分析:分析操作系統、應用程序、系統服務的潛在安全缺陷。 入侵測試:嘗試利用上一步發現的缺陷進行攻擊。 加固系統:修補上一步發現的缺陷,盡量減小系統的脆弱性。 本文將集中討論前兩步。 指紋特征分析 在網絡安全規劃中,指紋特征分析總是首先要做的。也就是說,在進行實際的測試之前,你不許知道測試目標使用的操作系統、運行的應用程序和提供的服務。這些細節可以幫助你發現潛在的安全缺陷。要知道這些細節,首先要判斷系統的操作系統和打開的端口。 判斷操作系統 nmap是一個偉大的端口掃描和操作系統檢測工具,使用nmap可以非常有效地發現檢測目標使用的操作系統: #nmap -sT -O 192.168.1.1 Starting nmap V. 2.54BETA5 ( www.insecure.org/nmap/ ) TCP Sequence Prediction: Class=truly random Difficulty=9999999 (Good lUCk!) Remote operating system guess: Linux 2.0.32-34 從輸出可以看出目標使用Linux操作系統。nmap是通過分析收到的報文議判斷操作系統的類型的。 端口掃描 然後,我們進行端口掃描來判斷目標打開的端口。如果可以和系統的某個服務建立連接,那麼在端口上監聽的服務進程就存在安全缺陷就可能被利用。 #nmap -sT 192.168.1.1 Starting nmap V. 2.54BETA5 ( www.insecure.org/nmap/ ) Intesting ports on 192.168.1.1 (206.135.57.167): (The 1529 ports scanned but not shown below are in state: closed) Port State Service 19/tcp open chargen 21/tcp open FTP 23/tcp open telnet 25/tcp open smtp 37/tcp open time 79/tcp open finger 80/tcp filtered http 113/tcp open auth


443/tcp filtered https 1723/tcp filtered pptp Nmap run completed -- 1 IP address (1 host up) scanned in 12 seconds 掃描完畢TCP端口之後,我們還要找出打開的UDP端口: #nmap -sU 192.168.1.1 Starting nmap V. 2.54BETA5 ( www.insecure.org/nmap/ ) Port State Service 37/udp open time 53/udp open domain 67/udp open bootps 69/udp open tftp 94/udp open objcall 111/udp open sunrpc 從端口掃描結果反縣可以發現系統巡行ftp、http、auth、https、pptp、telnet、chargen、smtp、finger、time、domain、bootps、tftp、objcall、sunrpc。現在,我們把注意力轉到Linux操作系統和檢測目標提供的這些服務中存在的安全缺陷。完成了以上的信息收集,下面我們還需要判斷WEB服務器是否能夠正常提供服務。 netcat netcat(nc)是一個簡單的UNIX網絡工具,它可以使用TCP或者UDP協議通過網絡連接讀寫數據。它被設計為一個穩定的後端(back-end)工具,能夠直接由其它程序和腳本輕松驅動。同時,它還是一個具有豐富功能的網絡調試和探測工具,它能夠建立你需要的幾乎所有類型的連接,還有幾個很有意思的內置功能。現在,我們使用nc建立到WEB服務器的連接,並發出一個Html頭請求: #nc 192.168.1.2 80 GET HEAD/HTTP1.0 HTTP/1.1 400 Bad Request Server: Microsoft-IIS/4.0 Date: Wed, 06 Dec 2000 00:45:56 GMT Content-Type: text/html Set-Cookie: ASPSESSIONIDQGGQQQPO=MJMCGMIAPIHOGLBNLFJPKCAH; path=/ Cache-control: Private 通過收到的信息,我們可以確定測試目標使用的WEB服務器是Microsoft IIS4。現在,我們能夠把我們的安全規劃限制在操作系統、WEB服務器版本、以及服務器上的應用程序了。 從上面的掃描中,我們可以看到服務器中還有其它的一些端口也打開了。這些打開的端口可能有許多缺陷。在服務器中,打開的端口應該有嚴格的限制,否則對帶來很多安全缺陷。在知道了上面這些信息之後,我們可以進入下一步進行缺陷分析了。 缺陷分析 缺陷分析可以集中於兩個方面:操作系統和應用程序。不過,這裡我們只關心應用程序,也就是WEB服務器軟件。 缺陷掃描 有些缺陷掃描程序能夠綜合已知的WEB安全缺陷。下面我們就使用這類程序對網站進行缺陷掃描。 whisker whisker是一個非常好的WEB服務器缺陷掃描軟件。它能夠進行大量的缺陷掃描,而且升級非常頻繁,能夠很快地加入對新缺陷的檢查。 #./whisker.pl -h 192.168.1.2 -i -v -- whisker / v1.4.0 / rain forest puppy / www.wiretrip.net -- - Loaded script database of 1968 lines = - = - = - = - = - = = Host: 192.168.1.2 + 404 Object Not Found: HEAD / = Server: Microsoft-IIS/4.0 - Appending ::\, %2E, or 0x81 to URLs may give script source - Also try +.htr and %20%20.htw tricks - Security settings on Directories can be bypassed if you use 8.3 names + 404 Object Not Found: GET /cfdocs/

+ 403 Access Forbidden: GET /scripts/ + 403 Access Forbidden: GET /scripts/cfcache.map + 404 Object Not Found: GET /cfcache.map + 404 Object Not Found: GET /cfide/Administrator/startstop.html + 404 Object Not Found: GET /cfappman/index.cfm + 404 Object Not Found: GET /cgi-bin/ + 404 Object Not Found: GET /whisker.ida + 404 Object Not Found: GET /whisker.idc + 404 Object Not Found: GET /whisker.idq + 404 Object Not Found: GET /whisker.htw + 404 Object Not Found: GET /whisker.htr + 403 Access Forbidden: GET /scripts/cpshost.dll + 404 Object Not Found: GET /samples/search/queryhit.htm + 404 Object Not Found: GET /adsamples/config/site.csc + 403 Access Forbidden: GET /scripts/counter.exe + 404 Object Not Found: GET /scripts/repost.asp + 404 Object Not Found: GET /scripts/postinfo.asp + 403 Access Forbidden: GET /scripts/fpadmcgi.exe + 403 Access Forbidden: GET /scripts/samples/ + 403 Access Forbidden: GET /scripts/samples/search/webhits.exe + 403 Access Forbidden: GET /scripts/iisadmin/ + 403 Access Forbidden: GET /scripts/iisadmin/ism.dll + 404 Object Not Found: GET /msadc/ + 404 Object Not Found: GET /Sites/ + 404 Object Not Found: GET /SiteServer/Publishing/viewcode.asp + 404 Object Not Found: GET /advworks/equipment/catalog_type.asp + 404 Object Not Found: GET /iisadmpwd/aeXP4b.htr + 403 Access Forbidden: HEAD /scripts/samples/details.idc + 403 Access Forbidden: HEAD /scripts/samples/ctguestb.idc + 200 OK: HEAD /scripts/tools/newdsn.exe - this can be used to make DSNs, useful in use with our ODBC exploit - and the RDS exploit (with msadcs.dll) + 403 Access Forbidden: GET /scripts/iisadmin/bdir.htr + 404 Object Not Found: HEAD /carbo.dll + 403 Access Forbidden: HEAD /scripts/proxy/ + 403 Access Forbidden: HEAD /scripts/proxy/w3proxy.dll + 404 Object Not Found: HEAD /prd.i/pgen/ + 404 Object Not Found: HEAD /cgi-win/ + 403 Access Forbidden: HEAD /scripts/nlog-smb.cgi + 403 Access Forbidden: HEAD /scripts/wwwboard/ + 404 Object Not Found: HEAD /wwwboard/ + 403 Access Forbidden: HEAD /sc



+ 403 Access Forbidden: HEAD /scripts/samples/ctguestb.idc + 200 OK: HEAD /scripts/tools/newdsn.exe - this can be used to make DSNs, useful in use with our ODBC exploit - and the RDS exploit (with msadcs.dll) + 403 Access Forbidden: GET /scripts/iisadmin/bdir.htr + 404 Object Not Found: HEAD /carbo.dll + 403 Access Forbidden: HEAD /scripts/proxy/ + 403 Access Forbidden: HEAD /scripts/proxy/w3proxy.dll + 404 Object Not Found: HEAD /prd.i/pgen/ + 404 Object Not Found: HEAD /cgi-win/ + 403 Access Forbidden: HEAD /scripts/nlog-smb.cgi + 403 Access Forbidden: HEAD /scripts/wwwboard/ + 404 Object Not Found: HEAD /wwwboard/ + 403 Access Forbidden: HEAD /sc



+ 403 Access Forbidden: HEAD /scripts/wwwboard/ + 404 Object Not Found: HEAD /wwwboard/ + 403 Access Forbidden: HEAD /sc



Copyright © Linux教程網 All Rights Reserved