1. 程式人生 > >檔案上傳細解

檔案上傳細解

直接看漏洞程式碼

<%
dim file,filename,houzui
file = Request.Form("file")
response.write "檔名:"&file
response.write "<br>"
houzui=mid(file,InStrRev(file, ".")) '獲取檔案字尾
response.write "字尾名:"&houzui
response.write "<br>"
if houzui=".gif" or houzui=".jpg" or houzui=".bmp" then
'允許上傳的檔案型別
response.write "圖片上傳成功"
else
response.write "不允許上傳" & houzui & "的格式"
end if
%>

大體內容就是上傳一個檔案然後輸出檔名、字尾名、判斷是不是可上傳格式

利用Burp工具來實現0x00的截斷,
上傳test.asp_(空格).jpg隨後修改20 改成00
字尾就是.asp