#!/usr/bin/env python ''' Copyright (C) 2020, WAFW00F Developers. See the LICENSE file for copying permission. ''' NAME = 'FirePass (F5 Networks)' def is_waf(self): # 定义两个不同的检测模式。 schema1 = [ # 检查是否存在以'VHOST'开头的 Cookie。 self.matchCookie('^VHOST'), # 检查响应头中的'Location'字段是否为'/my.logon.php3'。 self.matchHeader(('Location', r'\/my\.logon\.php3')) ] schema2 = [ # 检查是否存在以'F5_fire'开头并后跟任意字符的 Cookie。 self.matchCookie(r'^F5_fire.+?'), # 检查是否存在以'F5_passid_shrinked'开头的 Cookie。 self.matchCookie('^F5_passid_shrinked') ] # 如果 schema1 中的所有条件都满足,则认为检测到了 WAF。 if all(i for i in schema1): return True # 如果 schema2 中的所有条件都满足,则认为检测到了 WAF。 if all(i for i in schema2): return True return False