From ae972de8fc5b569492be503c0d004e8c63c1f574 Mon Sep 17 00:00:00 2001 From: Syed Afzal Date: Sun, 1 Oct 2017 22:15:02 +0530 Subject: [PATCH] Added identification for waf NAXSI --- lib/core/enums.py | 1 + waf/naxsi.py | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 waf/naxsi.py diff --git a/lib/core/enums.py b/lib/core/enums.py index 9596fa00a..74c4b7ef4 100644 --- a/lib/core/enums.py +++ b/lib/core/enums.py @@ -184,6 +184,7 @@ class HTTP_HEADER: USER_AGENT = "User-Agent" VIA = "Via" X_POWERED_BY = "X-Powered-By" + X_DATA_ORIGIN = "X-Data-Origin" class EXPECTED: BOOL = "bool" diff --git a/waf/naxsi.py b/waf/naxsi.py new file mode 100644 index 000000000..e6967ac73 --- /dev/null +++ b/waf/naxsi.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +""" +Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/) +See the file 'doc/COPYING' for copying permission +""" + +import re + +from lib.core.enums import HTTP_HEADER +from lib.core.settings import WAF_ATTACK_VECTORS + +__product__ = "NAXSI (NBS System)" + +def detect(get_page): + retval = False + + for vector in WAF_ATTACK_VECTORS: + _, headers, _ = get_page(get=vector) + retval = re.search(r"naxsi/waf", headers.get(HTTP_HEADER.X_DATA_ORIGIN, ""), re.I) is not None + if retval: + break + + return retval \ No newline at end of file