#!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'SecureSphere (Imperva Inc.)'
def is_waf(self):
# 定义用于检测是否存在特定 Web 应用防火墙(WAF)的方案列表。
schemes = [
# 检查响应内容中是否包含
或标签内的'Error'字样。
self.matchContent(r'<(title|h2)>Error'),
# 检查响应内容中是否包含'The incident ID is'。
self.matchContent(r'The incident ID is'),
# 检查响应内容中是否包含"This page can't be displayed"。
self.matchContent(r"This page can't be displayed"),
# 检查响应内容中是否包含'Contact support for additional information'。
self.matchContent(r'Contact support for additional information')
]
# 如果方案列表中的所有条件都为真,则认为检测到了 WAF。
if all(i for i in schemes):
return True
else:
return False