Esempio n. 1
0
 def __init__(self, *args, **kwargs):
     super(HttpRequestHandler, self).__init__()
     self.api = api.Api()
     self.base_handler = base.BaseHandler(kwargs['base_dir'], kwargs['db_name'])
     self.logger = logging.getLogger(__name__ + '.' + self.__class__.__name__)
     self.graylogs = graylog.Graylog()
     self.logger.info("graylogs init")
Esempio n. 2
0
    def __init__(self):
        base_dir = TannerConfig.get('EMULATORS', 'root_dir')
        db_name = TannerConfig.get('SQLI', 'db_name')

        self.session_manager = session_manager.SessionManager()
        self.dorks = dorks_manager.DorksManager()
        self.base_handler = base.BaseHandler(base_dir, db_name)
        self.logger = logging.getLogger(__name__)
        self.redis_client = None
Esempio n. 3
0
    def setUp(self):
        self.loop = asyncio.new_event_loop()
        asyncio.set_event_loop(self.loop)
        self.session = mock.Mock()
        self.session.associate_db = mock.Mock()
        self.data = mock.Mock()
        with mock.patch("tanner.emulators.lfi.LfiEmulator", mock.Mock(), create=True):
            self.handler = base.BaseHandler("/tmp/", "test.db", self.loop)

        def mock_lfi_scan(value):
            return dict(name="lfi", order=0)

        self.handler.emulators["lfi"].scan = mock_lfi_scan
        self.detection = None
Esempio n. 4
0
    def setUp(self):
        self.loop = asyncio.new_event_loop()
        asyncio.set_event_loop(None)
        self.session = mock.Mock()
        self.session.associate_db = mock.Mock()
        self.data = mock.Mock()
        with mock.patch('tanner.emulators.lfi.LfiEmulator',
                        mock.Mock(),
                        create=True):
            self.handler = base.BaseHandler('/tmp/', 'test.db', self.loop)

        def mock_lfi_scan(value):
            return dict(name='lfi', order=0)

        self.handler.emulators['lfi'].scan = mock_lfi_scan
Esempio n. 5
0
    def __init__(self):
        base_dir = TannerConfig.get('EMULATORS', 'root_dir')
        db_name = TannerConfig.get('SQLI', 'db_name')

        self.session_manager = session_manager.SessionManager()
        self.dorks = dorks_manager.DorksManager()
        self.base_handler = base.BaseHandler(base_dir, db_name)
        self.logger = logging.getLogger(__name__)
        self.redis_client = None

        if TannerConfig.get('HPFEEDS', 'enabled') is True:
            self.hpf = hpfeeds_report()
            self.hpf.connect()

            if self.hpf.connected() is False:
                self.logger.warning('hpfeeds not connected - no hpfeeds messages will be created')
Esempio n. 6
0
    def __init__(self):
        base_dir = TannerConfig.get("EMULATORS", "root_dir")
        db_name = TannerConfig.get("SQLI", "db_name")

        self.session_manager = session_manager.SessionManager()
        self.delete_timeout = TannerConfig.get("SESSIONS", "delete_timeout")

        self.dorks = dorks_manager.DorksManager()
        self.base_handler = base.BaseHandler(base_dir, db_name)
        self.logger = logging.getLogger(__name__)
        self.redis_client = None

        if TannerConfig.get("HPFEEDS", "enabled") is True:
            self.hpf = hpfeeds_report()
            self.hpf.connect()

            if self.hpf.connected() is False:
                self.logger.warning(
                    "hpfeeds not connected - no hpfeeds messages will be created"
                )