You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MiaCTFer/client-1/webinfo/wafw00f/plugins/securesphere.py

26 lines
1003 B

2 months ago
#!/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 = [
# 检查响应内容中是否包含<title>或<h2>标签内的'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