#!/usr/bin/env python ''' Copyright (C) 2020, WAFW00F Developers. See the LICENSE file for copying permission. ''' NAME = 'OnMessage Shield (BlackBaud)' def is_waf(self): # 定义用于检测是否存在特定 Web 应用防火墙(WAF)的方案列表。 schemes = [ # 检查响应头中的'X-Engine'字段是否为'onMessage Shield'。 self.matchHeader(('X-Engine', 'onMessage Shield')), # 检查响应内容中是否包含'Blackbaud K-12 conducts routine maintenance'。 self.matchContent(r'Blackbaud K\-12 conducts routine maintenance'), # 检查响应内容中是否包含'onMessage SHEILD'。 self.matchContent(r'onMessage SHEILD'), # 检查响应内容中是否包含'maintenance.blackbaud.com'。 self.matchContent(r'maintenance\.blackbaud\.com'), # 检查响应内容中是否包含'status.blackbaud.com'。 self.matchContent(r'status\.blackbaud\.com') ] # 如果方案列表中的任何一个条件为真,则认为检测到了 WAF。 if any(i for i in schemes): return True else: return False