Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae972de

Browse files
committed
Added identification for waf NAXSI
1 parent 62519ee commit ae972de

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

lib/core/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ class HTTP_HEADER:
184184
USER_AGENT = "User-Agent"
185185
VIA = "Via"
186186
X_POWERED_BY = "X-Powered-By"
187+
X_DATA_ORIGIN = "X-Data-Origin"
187188

188189
class EXPECTED:
189190
BOOL = "bool"

waf/naxsi.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
5+
See the file 'doc/COPYING' for copying permission
6+
"""
7+
8+
import re
9+
10+
from lib.core.enums import HTTP_HEADER
11+
from lib.core.settings import WAF_ATTACK_VECTORS
12+
13+
__product__ = "NAXSI (NBS System)"
14+
15+
def detect(get_page):
16+
retval = False
17+
18+
for vector in WAF_ATTACK_VECTORS:
19+
_, headers, _ = get_page(get=vector)
20+
retval = re.search(r"naxsi/waf", headers.get(HTTP_HEADER.X_DATA_ORIGIN, ""), re.I) is not None
21+
if retval:
22+
break
23+
24+
return retval

0 commit comments

Comments
 (0)