Beispiel #1
0
    def get_domains(self, validate=False):

        u_utils = UrlUtils()
        for url in self.urls:
            domain = u_utils.getDomain(url)
            if domain not in self.domains:
                if validate:
                    tv = TargetValidator(self.keywords,self.urls,self.domains)
                    if tv.keywords_at_URL_and_domain(domain,url):
                        self.domains.append(domain)
                else:
                    self.domains.append(domain)

        return True
Beispiel #2
0
    def get_ips(self, validate=False):

        hosts = []
        u_utils = UrlUtils()
        for url in self.urls:
            host = u_utils.getHost(url)
            ip = u_utils.getIP(url)
            domain = u_utils.getDomain(url)
            if host not in hosts:
                if validate:
                    tv = TargetValidator(self.keywords,self.urls,self.domains)
                    if tv.keywords_at_URL_and_domain(domain,url):
                        hosts.append(host)
                        self.hosts_and_ips.append("{0}:{1}".format(host,ip))
                else:
                    hosts.append(host)
                    self.hosts_and_ips.append("{0}:{1}".format(host,ip))

        return True