<commit_before>#!/usr/bin/env python


NAME = 'NinjaFirewall (NinTechNet)'


def is_waf(self):
    for attack in self.attacks:
        r = attack(self)
        if r is None:
            return
        _, page = r
        # Sites without modified block page return both, so checking for all
        # of them works.
        if all(i in page for i in (b'For security reasons, it was blocked and logged',
            b'<title>NinjaFirewall: 403 Forbidden')):
            return True
    return False<commit_msg>Added ninja plugin<commit_after>#!/usr/bin/env python
'''
Copyright (C) 2019, WAFW00F Developers.
See the LICENSE file for copying permission.
'''

NAME = 'NinjaFirewall (NinTechNet)'


def is_waf(self):
    schemes = [
        self.matchContent(r'<title>NinjaFirewall.+?\d{3}.forbidden'),
        self.matchContent(r'For.security.reasons?.+?it.was.blocked.and.logged')
    ]
    if any(i for i in schemes):
        return True
    return False
{'fraction_non_alphanumeric': 0.11029411764705882, 'fraction_numerical': 0.01050420168067227, 'mean_word_length': 2.6374045801526718, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4859546', 'n_tokens_mistral': 324, 'n_tokens_neox': 304, 'n_words': 89}