Skip to content

Commit

Permalink
update for 360 waf via issue #296
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekultek committed Jul 16, 2019
1 parent 86084a3 commit 2d788df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion content/plugins/360.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import re

from lib.settings import HTTP_HEADER

__product__ = "360 Web Application Firewall (360)"

Expand All @@ -10,7 +11,8 @@ def detect(content, **kwargs):
status = kwargs.get("status", None)
detection_schema = (
re.compile(r".wzws.waf.cgi.", re.I),
re.compile(r"wangzhan\.360\.cn", re.I)
re.compile(r"wangzhan\.360\.cn", re.I),
re.compile(r"qianxin.waf", re.I), re.compile(r"360wzws")
)
for detection in detection_schema:
if status == 493:
Expand All @@ -20,3 +22,5 @@ def detect(content, **kwargs):
return True
if detection.search(headers.get("X-Powered-By-360wzb", "")) is not None:
return True
if detection.search(headers.get(HTTP_HEADER.SERVER, "")) is not None:
return True
4 changes: 2 additions & 2 deletions content/plugins/greywizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def detect(content, **kwargs):
for detection in detection_schema:
if detection.search(content) is not None:
return True
gw_server = headers.get(HTTP_HEADER.GW_SERVER, None)
server = headers.get(HTTP_HEADER.SERVER, None)
gw_server = headers.get(HTTP_HEADER.GW_SERVER, "")
server = headers.get(HTTP_HEADER.SERVER, "")
if gw_server is not None:
if detection.search(server) is not None:
return True
Expand Down
4 changes: 3 additions & 1 deletion content/tampers/randomwildcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def tamper(payload, **kwargs):
wildcard = ["*", "?"]
safe_chars = string.punctuation
safe_chars = string.punctuation + " "
retval = ""
for char in list(payload):
if not any(p == char for p in safe_chars):
Expand All @@ -20,3 +20,5 @@ def tamper(payload, **kwargs):
else:
retval += char
return retval

print tamper(__example_payload__)

0 comments on commit 2d788df

Please sign in to comment.