0

I was trying to check whether the output is good enough and random enough based on the Combined.txt file variables. After checking, I found out that there is a double variable in my code. For example, https://web.login-group.claim.claim.com. There are 2 claim words in a single domain name. It should've been just one 1 claim instead of 2.

Here is the code:

These are a few examples of variables that I used

Example ['login', 'confirm', 'signup', 'confirmation', 'enroll', 'mobile', 'access',
'claim', 'service', 'group', 'recovery', 'support', 'find', 'confirmation']

with open("dictionaries/Combined.txt") as i:
    Test = [line.rstrip() for line in i]

delimiters = ['', '-', '.']
web = 'web'
HTTP = ['http://', 'https://']
suffix = ['odoo', 'info', 'com']
output = []

for i in range(100):
    for subdomain_count in [2, 3, 4]:
        http = random.choice(HTTP)
        data = [web] + random.choices(Test, k=subdomain_count)
        random.shuffle(data)
        delims = (random.choices(delimiters, k=subdomain_count) +
            ['.' + random.choice(suffix)])
        address = ''.join([a+b for a, b in zip(data, delims)])
        webs = http + ''.join([address])
        output.append(webs)

for o in output:
    print(o)

Thank you!

Tsukuru
  • 65
  • 7

0 Answers0