#!/usr/bin/env python ''' Copyright (C) 2020, WAFW00F Developers. See the LICENSE file for copying permission. ''' NAME = 'Sabre Firewall (Sabre)' def is_waf(self): # 定义两个不同的检测模式。 schema1 = [ # 检查响应内容中是否包含'dxsupport.sabre.com'。 self.matchContent(r'dxsupport\.sabre\.com') ] schema2 = [ # 检查响应内容中是否包含'Application Firewall Error'。 self.matchContent(r'<title>Application Firewall Error'), # 检查响应内容中是否包含'add some important details to the email for us to investigate'。 self.matchContent(r'add some important details to the email for us to investigate') ] # 如果 schema1 中的任何一个条件为真,则认为检测到了 WAF。 if any(i for i in schema1): return True # 如果 schema2 中的所有条件都为真,则认为检测到了 WAF。 if all(i for i in schema2): return True return False