Skip to content

Commit

Permalink
add plugin: Trustwave ModSecurity
Browse files Browse the repository at this point in the history
  • Loading branch information
akun committed Apr 17, 2015
1 parent 0593ad2 commit f8938ed
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
16 changes: 0 additions & 16 deletions wafw00f/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,21 +338,6 @@ def iswebknight(self):
break
return detected

def ismodsecurity(self):
detected = False
for attack in self.attacks:
r = attack(self)
if r is None:
return
response, responsebody = r
if response.status == 501:
detected = True
break
# the following based on nmap's http-waf-fingerprint.nse
if self.matchheader(('server', '(mod_security|Mod_Security|NOYB)')):
return True
return detected

def matchcookie(self, match):
"""
a convenience function which calls matchheader
Expand Down Expand Up @@ -398,7 +383,6 @@ def ismodsecuritypositive(self):

wafdetections = dict()
# easy ones
wafdetections['Trustwave ModSecurity'] = ismodsecurity
wafdetections['F5 FirePass'] = isf5firepass
wafdetections['F5 Trafficshield'] = isf5trafficshield
wafdetections['F5 BIG-IP LTM'] = isf5bigipltm
Expand Down
20 changes: 20 additions & 0 deletions wafw00f/plugins/modsecurity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python


NAME = 'Trustwave ModSecurity'


def is_waf(self):
detected = False
for attack in self.attacks:
r = attack(self)
if r is None:
return
response, responsebody = r
if response.status == 501:
detected = True
break
# the following based on nmap's http-waf-fingerprint.nse
if self.matchheader(('server', '(mod_security|Mod_Security|NOYB)')):
return True
return detected

0 comments on commit f8938ed

Please sign in to comment.