php waf 检测返回,WAF指纹探测及识别技术(2)

二、WAF识别工具

一些WAF可以自定义返回的消息内容,或者全部返回自定义的404页面或200页面,有一些工具会协助作为WAF设备的识别。

Wafw00f

用python编写的一个小工具,开源地址:

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

Wafw00f用来判断WAF设备的函数如下:

AdminFolder = '/Admin_Files/'

xssstring = ''

dirtravstring = '../../../../etc/passwd'

cleanhtmlstring = '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的检测规则如下:

def isf5asm(self):

# credit goes to W3AF

return self.matchcookie('^TS[a-zA-Z0-9]{3,6}=')

基于响应头的检测

Profense在响应头会包含'server','profense'的信息。

def isprofense(self):

"""

Checks for server headers containing "profense"

"""

return self.matchheader(('server','profense'))

sqlmap

Sqlmap是一款检测和利用SQLi漏洞工具,也是基于python编写,业内认同率较高,sqlmap用来探测WAF类型想比较Wafw00f来说还多一些。

参考:

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

Sqlmap用来探测每种WAF设备都是一个python文件,同样是从cookie信息或者返回头信息进行判断。

以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

貌似必须是或自己修改的类似动态参数才能使用。

xenoitx

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

【编辑推荐】

【责任编辑:蓝雨泪 TEL:(010)68476606】

内容导航

第 1 页:WAF指纹

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值