mercredi 28 octobre 2020

Best Way of Generating Random Domain Names

I need to make some request to as much websites as I could, so I have a small function that generates random domain names, (I need them as 'brute force' for making requests to this domains), this is my function:

from itertools import product
from string import ascii_lowercase

def _create_domain(self):
    return [''.join(i) for i in product(ascii_lowercase, repeat = 5)]

This function returns an array of all posible 5-letter combinations, and then I use that random words to create an url. Actually the majority of this 'words' isn't real domain names ['aaaaa', 'aaaab' ....] so it's a huge waste of time make requests to all this words, but I can't think of a better way of doing this, do you think there's a more optimal way?




Aucun commentaire:

Enregistrer un commentaire