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

Skip to content

Commit abd7608

Browse files
committed
Adding a new WAF script (varnish.py)
1 parent 3ff01f5 commit abd7608

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

doc/THANKS.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Andres Tarasco Acuna, <[email protected]>
66
Santiago Accurso, <[email protected]>
77
* for reporting a bug
88

9+
Syed Afzal, <[email protected]>
10+
* for contributing a WAF script varnish.py
11+
912
Zaki Akhmad, <[email protected]>
1013
* for suggesting a couple of features
1114

@@ -303,7 +306,7 @@ Michael Majchrowicz, <[email protected]>
303306
* for suggesting a lot of ideas and features
304307

305308
Ahmad Maulana, <[email protected]>
306-
* for contributing one tamper script, halfversionedmorekeywords.py
309+
* for contributing a tamper script halfversionedmorekeywords.py
307310

308311
Ferruh Mavituna, <[email protected]>
309312
* for exchanging ideas on the implementation of a couple of features

waf/varnish.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
Copyright (c) 2006-2013 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__ = "Varnish FireWall (OWASP) "
14+
15+
def detect(get_page):
16+
retval = False
17+
18+
for vector in WAF_ATTACK_VECTORS:
19+
page, headers, code = get_page(get=vector)
20+
retval = headers.get("X-Varnish") is not None
21+
retval |= re.search(r"varnish\Z", headers.get(HTTP_HEADER.VIA, ""), re.I) is not None
22+
if retval:
23+
break
24+
25+
return retval

0 commit comments

Comments
 (0)