<commit_before># -*- coding: utf-8 -*-
"""
This is part of WebScout software
Docs EN: http://hack4sec.pro/wiki/index.php/WebScout_en
Docs RU: http://hack4sec.pro/wiki/index.php/WebScout
License: MIT
Copyright (c) <NAME> <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en)

Common class for DnsBrute modules
"""

import time
import socket

import dns.query
import dns.message

from classes.Roller import Roller
from classes.Registry import Registry
from classes.kernel.WSCounter import WSCounter
from classes.kernel.WSModule import WSModule
from classes.kernel.WSException import WSException
from classes.models.HostsModel import HostsModel
from classes.models.IpsModel import IpsModel
from classes.jobs.DnsBruteJob import DnsBruteJob
from classes.threads.DnsBruteThread import DnsBruteThread


class DnsBruteModules(WSModule):
    logger_enable = True
    logger_name = 'dns'
    logger_have_items = False
    """ Common class for DnsBrute modules """
    def validate_main(self):
        """ Check users params """
        if self.options['protocol'].value not in ['tcp', 'udp', 'auto']:
            raise WSException(
                "Protocol mast be 'tcp', 'udp' or 'auto', but it is '{0}'"
                .format(self.options['protocol'].value)
            )

    def load_objects(self, queue):
        """ Method for prepare test objects, here abstract """
        pass

    def brute_action(self):
        """ Action brute of module """
        self.enable_logger()
        self.validate_main()
        self.pre_start_inf()

        q = DnsBruteJob()<commit_msg>dns brute modules check msymbol in host template<commit_after># -*- coding: utf-8 -*-
"""
This is part of WebScout software
Docs EN: http://hack4sec.pro/wiki/index.php/WebScout_en
Docs RU: http://hack4sec.pro/wiki/index.php/WebScout
License: MIT
Copyright (c) <NAME> <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en)

Common class for DnsBrute modules
"""

import time
import socket

import dns.query
import dns.message

from classes.Roller import Roller
from classes.Registry import Registry
from classes.kernel.WSCounter import WSCounter
from classes.kernel.WSModule import WSModule
from classes.kernel.WSException import WSException
from classes.models.HostsModel import HostsModel
from classes.models.IpsModel import IpsModel
from classes.jobs.DnsBruteJob import DnsBruteJob
from classes.threads.DnsBruteThread import DnsBruteThread


class DnsBruteModules(WSModule):
    logger_enable = True
    logger_name = 'dns'
    logger_have_items = False
    """ Common class for DnsBrute modules """
    def validate_main(self):
        """ Check users params """
        if self.options['protocol'].value not in ['tcp', 'udp', 'auto']:
            raise WSException(
                "Protocol mast be 'tcp', 'udp' or 'auto', but it is '{0}'"
                .format(self.options['protocol'].value)
            )

        if not self.options['host'].value.count(self.options['msymbol'].value):
            raise WSException(
                "Host template must contains msymbol ({0}), but it not ({1})"
                .format(self.options['msymbol'].value, self.options['host'].value)
            )

    def load_objects(self, queue):
        """ Method for prepare test objects, here abstract """
        pass

    def brute_action(self):
        """ Action brute of module """
        self.enable_logger()
        self.validate_main()
        self.pre_start_inf()

        q = DnsBruteJob()
{'fraction_non_alphanumeric': 0.11293103448275862, 'fraction_numerical': 0.0028735632183908046, 'mean_word_length': 3.1589008363201914, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2212108', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1030, 'n_words': 291}