示例#1
0
    def generate_random_hostname(self, with_random=False, nxdomain=False):
        """Return a hostname generated at random with the saved Canarytoken.
           The random hostname is also saved into the Canarydrop."""
        if nxdomain:
            domains = get_all_canary_nxdomains()
        else:
            domains = get_all_canary_domains()

        if with_random:
            generated_hostname = str(random.randint(1,2**24))+'.'
        else:
            generated_hostname = ''

        generated_hostname += self._drop['canarytoken']+'.'+\
                              domains[random.randint(0,len(domains)-1)]
        return generated_hostname
示例#2
0
    def generate_random_hostname(self, with_random=False, nxdomain=False):
        """Return a hostname generated at random with the saved Canarytoken.
           The random hostname is also saved into the Canarydrop."""
        if nxdomain:
            domains = get_all_canary_nxdomains()
        else:
            domains = get_all_canary_domains()

        if with_random:
            generated_hostname = str(random.randint(1, 2**24)) + '.'
        else:
            generated_hostname = ''

        generated_hostname += self._drop['canarytoken']+'.'+\
                              domains[random.randint(0,len(domains)-1)]
        return generated_hostname