良精微博再爆IIS解析上传漏洞及修复
By:joken\'s、wdlei
近日,站长下载站上的良精微博程序又更新了。
更新时光为2010年7月13日,更新了皮肤跟修正了上传漏洞,但仍旧存在漏洞问题。
破绽文件:UpFileForm.asp
代码:
html
head
meta equiv ContentType content text/html; charsetutf8
link rel stylesheet href Images/CssAdmin.css
title 文件挑选 /title
/head
body style backgroundcolor:#FFFFFF;
table width 400 border 0 align center cellpadding 12 cellspacing 1 bgcolor #6ab6b6
form action UpFileSave.aspResult request.QueryString( Result ) method post enctype multipart/formdata name formUpload
tr
td bgcolor #eafefe
table width 100 border 0 cellspacing 0 cellpadding 0
tr
td width 60 height 30 nowrap 取舍文件: /td
td input name FromFile type file class textfield id FromFile size 41 /td
/tr
tr
td height 30 上传地位: /td
td select name SaveToPath class textfield
option value ../uploadfile/PicFiles/ selected 图片文件 /uploadfile/PicFiles /option
option value ../uploadfile/DownFiles/ 下载文件 /uploadfile/DownFiles /option
option value ../uploadfile/OtherFiles/ 其余文件 /uploadfile/OtherFiles /option
/select /td
/tr
tr
td height 36 colspan 2 align center valign bottom input name reset type reset class button value 重置
input name Submit type submit class button value 上传 /td
/tr
/table
/td
/tr
/form
/table
/body
/html
能够自行定义上传目录。
持续往下看代码,来到action的文件中看下
../UpFileSave.asp
保存目录代码局部:
SaveToPathUpload.form( SaveToPath ) \'文件保留目录,此目录必需为程序可读写
if SaveToPath then
SaveToPath ../
end if
\'在目录后加(/)
if right(SaveToPath,1) / then
SaveToPathSaveToPath /
end if
for each FormName in Upload.file \'列出所有上传了的文件
set fileUpload.file(FormName) \'天生一个文件对象
if file.Filesize 100 then
response.write 请先抉择你要上传的文件, a href# onclickhistory.go(1) 返回 /a !
response.end
end if
FileExtlcase(File.FileExt)
if CheckFileExt(FileEXT)false then
response.write 文件格局不容许上传, a href# onclickhistory.go(1) 返回 /a !
response.end
end if
randomize timer
RanNumint(9000.rnd)+1000
FilenameSaveToPath . . _ . . _ . &fileExt
阅读(106) | 评论(0) | 转发(0) |