# Path: lib/settings.py
# def get_top_domains(dbname):


import threading
import requests
import re
import lib.utils as utils
from lib.logger import *
from datetime import datetime
from lib.config import *
from lib.settings import homenet, lock, top_domains
            response = requests.get(homenet.fg_intel_domains, headers=headers, verify=False)
            rjson = response.json()
            for threat in rjson.keys():
                set1 = set(homenet.bad_domains[threat])
                set2 = set(rjson[threat])
                homenet.bad_domains[threat] = list(set1 | set2)
        except Exception as e:
            log.debug('FG-ERROR: There was an error while downloading the domain blacklist - ' + str(e))

        # Downloading the list of default user names and passwords
        try:
            response = requests.get(homenet.fg_intel_creds, headers=headers, verify=False)
            fout = open('/tmp/default_creds.csv', 'w')
            fout.write(response.text)
            fout.close()
        except Exception as e:
            log.debug('FG-ERROR: There was an error while downloading the list of default credentials - ' + str(e))


class CheckVirusTotalIntel(threading.Thread):
    def __init__(self, threadID):
        threading.Thread.__init__(self)
        self.threadID = threadID

    def run(self):

        while 1:
            dns_lookup_list = {}
            file_lookup_list = {}
            if homenet.vt_api_key:

# Path: lib/settings.py
# def get_top_domains(dbname):


# Path: lib/intel.py
import threading
import requests
import re
import lib.utils as utils
from lib.logger import *
from datetime import datetime
from lib.config import *
from lib.settings import homenet, lock, top_domains

            response = requests.get(homenet.fg_intel_domains, headers=headers, verify=False)
            rjson = response.json()
            for threat in rjson.keys():
                set1 = set(homenet.bad_domains[threat])
                set2 = set(rjson[threat])
                homenet.bad_domains[threat] = list(set1 | set2)
        except Exception as e:
            log.debug('FG-ERROR: There was an error while downloading the domain blacklist - ' + str(e))

        # Downloading the list of default user names and passwords
        try:
            response = requests.get(homenet.fg_intel_creds, headers=headers, verify=False)
            fout = open('/tmp/default_creds.csv', 'w')
            fout.write(response.text)
            fout.close()
        except Exception as e:
            log.debug('FG-ERROR: There was an error while downloading the list of default credentials - ' + str(e))


class CheckVirusTotalIntel(threading.Thread):
    def __init__(self, threadID):
        threading.Thread.__init__(self)
        self.threadID = threadID

    def run(self):

        while 1:
            dns_lookup_list = {}
            file_lookup_list = {}
            if homenet.vt_api_key:

                with lock: