def Start(self): self.LoadInterfaces() self.Log = LogHandler(self) self.Syslog = SyslogHandler(self) self.Automate = Automate(self) self.DNSCache = DNSCache(self) self.TLSRelay = TLSRelay(self) self.UDPRelay = UDPRelay(self) self.DNSRelay = DNSRelay(self) ListFile = ListFiles() ListFile.CombineDomains() ListFile.CombineKeywords() self.LoadKeywords() self.LoadTLDs() self.LoadSignatures() Sniffer = DNSSniffer(self) # setting from_proxy arg to True to have the sniffer sleep for 5 seconds while settings can initialize threading.Thread(target=Sniffer.Start, args=(True,)).start() threading.Thread(target=self.DNSRelay.Start).start() loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) asyncio.run(self.RecurringTasks())
def load_dns_signature_bitmap(): ListFile = ListFiles(Log=Log) ListFile.combine_domains() wl_exceptions = load_configuration( 'whitelist')['whitelist']['exception'] bl_exceptions = load_configuration( 'blacklist')['blacklist']['exception'] return load_dns_bitmap(Log, bl_exc=bl_exceptions, wl_exc=wl_exceptions)
def load_signatures(cls): ListFile = ListFiles(Log=Log) ListFile.combine_domains() cls._keywords = load_keywords(Log=Log) whitelists = load_configuration('whitelist') wl_exceptions = whitelists['whitelist']['exception'] blacklists = load_configuration('blacklist') bl_exceptions = blacklists['blacklist']['exception'] return load_dns_bitmap(Log, bl_exc=bl_exceptions, wl_exc=wl_exceptions)
def Start(self): ListFile = ListFiles() ListFile.CombineLists() self.ProxyDB() self.LoadIPTables() self.LoadKeywords() self.LoadTLDs() self.LoadSignatures() threading.Thread(target=self.CustomLists).start() threading.Thread(target=self.CheckLogging).start() threading.Thread(target=self.Proxy).start()
def Start(self): ListFile = ListFiles() ListFile.CombineLists() DNSRelay = DNSR(self) self.ProxyDB() self.LoadKeywords() self.LoadTLDs() self.LoadSignatures() threading.Thread(target=DNSRelay.Start).start() threading.Thread(target=self.Proxy).start() loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) asyncio.run(self.Main())
def Start(self): self.LoadInterfaces() self.Log = LogHandler(self) self.Syslog = SyslogHandler(self) self.Automate = Automate(self) ListFile = ListFiles() ListFile.CombineIPs() self.Timer = TM() self.LoadSignatures() Sniffer = IPSniffer(self) # True boolean notifies thread that it was the initial start and to minimize sleep time threading.Thread(target=Sniffer.Start, args=(True, )).start() loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) asyncio.run(self.Main())
def _import_signatures(self): list_files = ListFiles(Log=Log) list_files.combine_ips() list_files.combine_geolocation() # self.IPProxy.cat_signatures = load_signatures(Log, mod='ip') self.IPProxy.cat_signatures = load_ip_bitmap(Log) self.IPProxy.geo_signatures = load_geo_bitmap(Log)
def load_ip_signature_bitmaps(): list_files = ListFiles(Log=Log) list_files.combine_ips() list_files.combine_geolocation() ip_category_signatures = load_ip_bitmap(Log) geolocation_signatures = load_geo_bitmap(Log) return ip_category_signatures, geolocation_signatures