def generate_random_url(self,): """Return a URL generated at random with the saved Canarytoken. The random URL is also saved into the Canarydrop.""" sites = get_all_canary_sites() path_elements = get_all_canary_path_elements() pages = get_all_canary_pages() generated_url = sites[random.randint(0,len(sites)-1)]+'/' path = [] for count in range(0,random.randint(1,4)): if len(path_elements) == 0: break elem = path_elements[random.randint(0,len(path_elements)-1)] path.append(elem) path_elements.remove(elem) path.append(self._drop['canarytoken']) path.append(pages[random.randint(0,len(pages)-1)]) generated_url += '/'.join(path) self._drop['generated_url'] = generated_url return self._drop['generated_url']
def generate_random_url(self, ): """Return a URL generated at random with the saved Canarytoken. The random URL is also saved into the Canarydrop.""" sites = get_all_canary_sites() path_elements = get_all_canary_path_elements() pages = get_all_canary_pages() generated_url = sites[random.randint(0, len(sites) - 1)] + '/' path = [] for count in range(0, random.randint(1, 4)): if len(path_elements) == 0: break elem = path_elements[random.randint(0, len(path_elements) - 1)] path.append(elem) path_elements.remove(elem) path.append(self._drop['canarytoken']) path.append(pages[random.randint(0, len(pages) - 1)]) generated_url += '/'.join(path) self._drop['generated_url'] = generated_url return self._drop['generated_url']
def get_url_components(self,): return (get_all_canary_sites(), get_all_canary_path_elements(), get_all_canary_pages())