import string
import random
flag="REDACTED"
def makerando():
i=random.randint(0,3)
res=""
for _ in range(i):
res += random.choice(string.printable[:62])
return res
def tagmaker(flag_idx):
prefix = makerando()
suffix = makerando()
payload = "%s-flag-%s-%s" % (prefix, flag_idx, suffix)
return '' % (random.choice(["class","id"]), payload)
def fakemaker(flag_idx):
prefix = makerando()
suffix = makerando()
payload = "%s-flag-%s-%s" % (prefix, flag_idx, suffix)
return '' % (random.choice(["class","id"]), payload, makerando())
tags=[]
for i in range(len(flag)):
flag_ltr = flag[i]
ctr = ord(flag_ltr)
for _ in range(ctr):
tags.append(tagmaker(i))
for _ in range(random.randint(5,25)):
tags.append(fakemaker(i))
random.shuffle(tags)
page="".join(tags)
f=file("index.html", "a")
f.write(page)
f.close()