自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

WAF指紋探測及識別技術(shù)

安全 應(yīng)用安全
Web應(yīng)用防護(hù)系統(tǒng)(也稱:網(wǎng)站應(yīng)用級入侵防御系統(tǒng)。英文:Web Application Firewall,簡稱: WAF)。利用國際上公認(rèn)的一種說法:Web應(yīng)用防火墻是通過執(zhí)行一系列針對HTTP/HTTPS的安全策略來專門為Web應(yīng)用提供保護(hù)的一款產(chǎn)品。本文介紹了常見的WAF指紋識別的一些技術(shù)。

Web應(yīng)用防護(hù)系統(tǒng)(也稱:網(wǎng)站應(yīng)用級入侵防御系統(tǒng)。英文:Web Application Firewall,簡稱: WAF)。利用國際上公認(rèn)的一種說法:Web應(yīng)用防火墻是通過執(zhí)行一系列針對HTTP/HTTPS的安全策略來專門為Web應(yīng)用提供保護(hù)的一款產(chǎn)品。本文介紹了常見的WAF指紋識別的一些技術(shù),詳見如下: 

一、WAF指紋

Cookie值

Citrix Netscaler

“Citrix Netscaler”會在HTTP返回頭部Cookie位置加入“ns_af”的值,可以以此判斷為Citrix Netscaler的WAF,國內(nèi)此類WAF很少(這貨居然是searchsecurity認(rèn)定的2013最好的防火墻)。

一個惡意的請求示例:

GET / HTTP/1.1
Host: target.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: ASPSESSIONIDAQQSDCSC=HGJHINLDNMNFHABGPPBNGFKC; ns_af=31+LrS3EeEOBbxBV7AWDFIEhrn8A000;ns_af_.target.br_%2F_wat=QVNQU0VTU0lPTklEQVFRU0RDU0Nf?6IgJizHRbTRNuNoOpbBOiKRET2gA&
Connection: keep-alive
Cache-Control: max-age=0

F5 BIG IP ASM

F5 BiG IP ASM會在Cookie中加入“TS+隨機(jī)字符串”的Cookie信息,一個非惡意的請求如下:
GET / HTTP/1.1
Host: www.target.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: target_cem_tl=40FC2190D3B2D4E60AB22C0F9EF155D5; s_fid=77F8544DA30373AC-31AE8C79E13D7394; s_vnum=1388516400627%26vn%3D1; s_nr=1385938565978-New; s_nr2=1385938565979-New; s_lv=1385938565980; s_vi=[CS]v1|294DCEC0051D2761-40000143E003E9DC[CE]; fe_typo_user=7a64cc46ca253f9889675f9b9b79eb66; TSe3b54b=36f2896d9de8a61cf27aea24f35f8ee1abd1a43de557a25c529fe828; TS65374d=041365b3e678cba0e338668580430c26abd1a43de557a25c529fe8285a5ab5a8e5d0f299
Connection: keep-alive
Cache-Control: max-age=0

HTTP響應(yīng)

Mod_Security

Mod_Security是為Apache設(shè)計的開源Web防護(hù)模塊,一個惡意的請求Mod_Security會在響應(yīng)頭返回“406 Not acceptable”的信息。

請求:

GET /<script>alert(1);</script>HTTP/1.1
Host: www.target.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive

響應(yīng):

HTTP/1.1 406 Not Acceptable
Date: Thu, 05 Dec 2013 03:33:03 GMT
Server: Apache
Content-Length: 226
Keep-Alive: timeout=10, max=30
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
<head><title>Not Acceptable!</title></head><body><h1>Not Acceptable!</h1><p>An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.</p></body></html>

WebKnight

WebKnight是用來設(shè)計在IIS下面使用的WAF設(shè)備,較為常見。WebKnight會對惡意的請求返回“999 No Hacking”的信息。

請求:

GET /?PageID=99<script>alert(1);</script>HTTP/1.1
Host: www.aqtronix.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive

響應(yīng):

HTTP/1.1 999 No Hacking
Server: WWW Server/1.1
Date: Thu, 05 Dec 2013 03:14:23 GMT
Content-Type: text/html; charset=windows-1252
Content-Length: 1160
Pragma: no-cache
Cache-control: no-cache
Expires: Thu, 05 Dec 2013 03:14:23 GMT

F5 BIG IP

F5 BIG IP會對惡意請求返回“419 Unknown”的信息,如下:

GET /<script> HTTP/1.0
HTTP/1.1 419 Unknown
Cache-Control: no-cache
Content-Type: text/html; charset=iso-8859-15
Pragma: no-cache
Content-Length: 8140
Date: Mon, 25 Nov 2013 15:22:44 GMT
Connection: keep-alive
Vary: Accept-Encoding

dotDefender

dotDefender用來防護(hù).net的程序,也比較出名,會對惡意請求返回“dotDefender Blocked Your Request”的信息。

請求:

GET /---HTTP/1.1
Host: www.acc.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cache-Control: max-age=0

響應(yīng):

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: text/html
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Thu, 05 Dec 2013 03:40:14 GMT
Content-Length: 2616
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>dotDefender Blocked Your Request</title>

特定資源文件

部分特定WAF在返回的告警頁面含特定的CSS或者JS文件,可以作為判斷的依據(jù),這類情況在WAF類里比較少,實際也可以歸并到HTTP響應(yīng)中。

看2個樣例:

  1. <html>  <body style="margin:0; padding:0">  <center><iframe width="100%" align="center" height="870" frameborder="0" scrolling="no" src="http://safe.webscan.#/stopattack.html"></iframe></center>  </body>  </html> 
  2. HTTP/1.1 405 Not Allowed 
  3. Server: ASERVER/1.2.9-3 
  4. Date: Fri, 27 Dec 2013 14:15:14 GMT 
  5. Content-Type: text/html 
  6. Connection: keep-alive 
  7. X-Powered-By-Anquanbao: MISS from uni-tj-ky-sb3 
  8. Content-Length: 7188 
  9. <div class="wrapper"> 
  10. <div class="titlelogo"></div> 
  11. <div class="err_tips">由于您訪問的URL有可能對網(wǎng)站造成安全威脅,您的訪問被阻斷。</div> 
  12. <div class="feedback"> 
  13. <form action="http://report.anquanbao.com/api.php" method="post"> 
  14. <input type="hidden" name="black_code" value="" class="hidden_rule_id" /> 
  15. <input type="hidden" name="deny_time" value="" class="hidden_intercept_time" /> 
  16. <input type="hidden" name="server_id" value="" class="hidden_server_title" /> 
  17. <input type="hidden" name="deny_url" value="" class="deny_url" /> 
  18. <input type="submit" class="submit_img" value="" /> 
  19. </form> 
  20. </div> 
  21. <div class="detailcontent"> 
  22. <div class="detailupimg"> 
  23. <a href="javascript:;">站長點擊查看詳情</a> 
  24. </div> 
  25. <div class="detaildownimg "> 
  26. <a href="javascript:;">站長點擊查看詳情</a> 
  27. </div> 
  28. <div class="hiddeninfo"> 
  29. 規(guī)則ID:<span class="rule_id">10384</span> 
  30. <span style="margin-left:20px">攔截時間:</span><span class="intercept_time">2013/12/27 22:15:14</span> 
  31. <div class="hiddeninfosecond"> 
  32. <span style="padding-top:20px">ServerName:</span><span class="server_title" style="padding-top:20px">uni-tj-ky-sb3/1.2.9-3</span> 
  33. </div> 
  34. <div class="hiddeninfothird"> 

#p#

二、WAF識別工具

一些WAF可以自定義返回的消息內(nèi)容,或者全部返回自定義的404頁面或200頁面,有一些工具會協(xié)助作為WAF設(shè)備的識別。

Wafw00f

用python編寫的一個小工具,開源地址:

http://code.google.com/p/waffit/source/browse/trunk/wafw00f.py

Wafw00f用來判斷WAF設(shè)備的函數(shù)如下:

AdminFolder = '/Admin_Files/'
xssstring = '<script>alert(1)</script>'
dirtravstring = '../../../../etc/passwd'
cleanhtmlstring = '<invalid>hello'
isaservermatch = 'Forbidden ( The server denied the specified Uniform Resource Locator (URL). Contact the server administrator.  )'

使用“python wafw00f.py -h”可以查看工具的使用方法,運行示例:

python wafw00f.py http://www.victim.org/

基于Cookie的檢測

Wafw00f的探測大部分是基于Cookie的檢測。

F5asm的檢測規(guī)則如下:

def isf5asm(self):
# credit goes to W3AF
return self.matchcookie('^TS[a-zA-Z0-9]{3,6}=')

基于響應(yīng)頭的檢測

Profense在響應(yīng)頭會包含'server','profense'的信息。

def isprofense(self):
"""
Checks for server headers containing "profense"
"""
return self.matchheader(('server','profense'))

sqlmap

Sqlmap是一款檢測和利用SQLi漏洞工具,也是基于python編寫,業(yè)內(nèi)認(rèn)同率較高,sqlmap用來探測WAF類型想比較Wafw00f來說還多一些。

參考:

https://github.com/sqlmapproject/sqlmap/tree/master/waf

Sqlmap用來探測每種WAF設(shè)備都是一個python文件,同樣是從cookie信息或者返回頭信息進(jìn)行判斷。

以Mod_Security為例

#!/usr/bin/env python

"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""

import re

from lib.core.enums import HTTP_HEADER
from lib.core.settings import WAF_ATTACK_VECTORS

__product__ = "ModSecurity: Open Source Web Application Firewall (Trustwave)"

def detect(get_page):
retval = False

for vector in WAF_ATTACK_VECTORS:
page, headers, code = get_page(get=vector)
retval = code == 501 and re.search(r"Reference #[0-9A-Fa-f.]+", page, re.I) is None
retval |= re.search(r"Mod_Security|NOYB", headers.get(HTTP_HEADER.SERVER, ""), re.I) is not None
if retval:
break
return retval

Sqlmap用來探測WAF的命令如下:

python sqlmap.py -u “http://www.victim.org/ex.php?id=1” --identify-waf

貌似必須是或自己修改的類似動態(tài)參數(shù)才能使用。

xenoitx

檢測和利用XSS漏洞的神器,WAF檢測也是其中的功能之一。

責(zé)任編輯:藍(lán)雨淚 來源: FreebuF
相關(guān)推薦

2013-12-18 09:39:37

XSSWAF繞過

2018-04-10 11:17:42

人臉指紋虹膜

2025-02-19 10:54:38

2015-10-22 23:03:59

2014-12-30 13:29:00

指紋識別生物識別身份驗證

2018-03-15 09:16:43

人臉識別屏幕指紋指紋識別

2017-03-16 16:57:56

2015-11-04 15:21:07

2014-07-30 10:24:25

2013-09-11 14:57:15

2020-11-10 15:01:22

人工智能生物識別安全

2014-07-30 09:41:38

2025-03-11 07:30:19

2023-06-29 13:09:36

2016-01-08 15:52:32

2014-12-16 10:23:59

2018-03-01 08:56:20

存儲能力定位

2015-07-06 14:32:10

2017-03-17 19:59:39

2013-01-11 16:23:29

點贊
收藏

51CTO技術(shù)棧公眾號