Пример #1
0
def getMalc0deList():
    rawList = []

    logging.info("Fetching latest Malc0de list.")

    xml = soupParse(baseConfig.malc0deUrl)

    if xml:
        for row in xml('description'):
            rawList.append(row)
        del rawList[0]

        malList = []

        for row in rawList:
            location = re.sub('&', '&',
                              str(row).split()[1]).replace(',', '')
            if location.strip():
                url = 'http://{0}'.format(location)
                if isValidUrl(url):
                    malList.append(url)

        return malList

    else:
        logging.error(
            "Empty Malc0de XML. Potential connection error. Please try again later."
        )
        sys.exit(1)
Пример #2
0
def queryCrimeTracker():
    try:
        ip_list = []

        logging.info('Fetching latest CyberCrime Tracker list.')

        xml = soupParse('https://cybercrime-tracker.net/rss.xml')

        if xml:
            for row in xml('description'):
                ip_addr = re.findall(
                    r'([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})',
                    str(row.text))
                if len(ip_addr) > 0:
                    if ip_addr not in ip_list:
                        ip_list.append(ip_addr[0])

        else:
            logging.error(
                'Empty CyberCrime Tracker XML. Potential connection error. Please try again later.'
            )

    except Exception as e:
        logging.warning(
            'Problem connecting to CyberCrime Tracker. Aborting task.')
        logging.exception(sys.exc_info())
        logging.exception(type(e))
        logging.exception(e.args)
        logging.exception(e)

    return ip_list
Пример #3
0
def getMalc0deList():
    try:
        raw_list = []

        logging.info('Fetching latest Malc0de list.')

        xml = soupParse('http://malc0de.com/rss')

        if xml:
            for row in xml('description'):
                raw_list.append(row)
            del raw_list[0]

            malList = []

            for row in raw_list:
                location = re.sub('&','&',str(row).split()[1]).replace(',','')
                if location.strip():
                    url = 'http://{0}'.format(location)
                    if isValidUrl(url):
                        malList.append(url)

            return malList

        else:
            logging.error('Empty Malc0de XML. Potential connection error. Please try again later.')

    except Exception as e:
        logging.warning('Problem connecting to Malc0de. Aborting task.')
        logging.exception(sys.exc_info())
        logging.exception(type(e))
        logging.exception(e.args)
        logging.exception(e)

    return []
Пример #4
0
def getMinotaurList():
    logging.info("Fetching latest Minotaur list.")

    html = soupParse(baseConfig.minotaurUrl)    

    if html:
        malList = []

        urlTable = html.find("div", {"id": "mtabs-2"}).find("table", {"class": "hometable2"})
        if urlTable:
            for row in urlTable.findAll("tr")[1:]:
                elements = row.findAll('td')
                if len(elements) == 4:
                    url = elements[3].text.strip()
                    if isValidUrl(url):
                        malList.append(url)

            return malList
        else:
            logging.error("Failed to locate Minotaur URL table. Ensure that this is the latest ph0neutria release.")
            sys.exit(1)

    else:
        logging.error("Empty Minotaur XML. Potential connection error. Please try again later.")
        sys.exit(1)
Пример #5
0
def getMalc0deList():
    try:
        raw_list = []

        logging.info('Fetching latest Malc0de list.')

        xml = soupParse('http://malc0de.com/rss')

        if xml:
            for row in xml('description'):
                raw_list.append(row)
            del raw_list[0]

            malList = []

            for row in raw_list:
                location = re.sub('&', '&',
                                  str(row).split()[1]).replace(',', '')
                if location.strip():
                    url = 'http://{0}'.format(location)
                    if isValidUrl(url):
                        malList.append(url)

            return malList

        else:
            logging.error(
                'Empty Malc0de XML. Potential connection error. Please try again later.'
            )

    except Exception as e:
        logging.warning('Problem connecting to Malc0de. Aborting task.')
        logging.exception(sys.exc_info())
        logging.exception(type(e))
        logging.exception(e.args)
        logging.exception(e)

    return []