python版本:3.9.6
代碼如下:
#!/usr/bin/python3
# -*- coding:UTF-8 -*-
import requests
url = 'http://localhost/sql/lab-1/index.php?id=1' #測驗url
try:
sq=requests.get(url,timeout=3) #發出get請求,連接時間超過3秒時退出
test=sq.headers['Content-Length'] #輸出所得到的Content-Length值
url1 = 'http://localhost/sql/lab-1/index.php?id=1+and+1=1' #恒真式
sq1=requests.get(url1,timeout=3)
test1=sq1.headers['Content-Length']
url2 = 'http://localhost/sql/lab-1/index.php?id=1+and+1=2' #恒假式
sq2=requests.get(url1,timeout=3)
test2=sq2.headers['Content-Length']
if test == test1 and test1 != test2 : #通過比較回傳值來判斷是否有注入點,類似于burp的字典爆破分析
print(url+'(存在注入漏洞)')
else :
print(url+'(未發現注入漏洞)')
except:
pass
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/297087.html
標籤:其他
