这个漏洞对于动易网站管理系统来说,就是致命的了。 此漏洞存在于User目录下的User_saveflash.asp文件中,其第6~22行代码如下所示。 Dim act, ObjInstalled_FSO, color_name, Create_1, imgurl, SaveFileName, dirMonth objName_FSO = Application("objName_FSO") ObjInstalled_FSO = IsObjInstalled(objName_FSO) If ObjInstalled_FSO = True Then Set fso = Server.CreateObject(objName_FSO) Else Response.Write "&&SendFlag=保存 >>> NO" Response.end End If act = trim(request("act")) //这里是关键 If act="" Then Call Main() Else Call CoverColorFile() //如果act不为空,则调用CoverColorFile()函数 End If set fso = Nothing 下面我们一起来看看函数CoverColorFile()的代码。 Sub CoverColorFile() //此函数用于生成图像BMP文件 Dim whichfile, head, Colortxt, i, rline, badwords //注意whichfile变量 Response.Expires = -9999 Response.AddHeader "Pragma","no-cache" Response.AddHeader "cache-ctrol","no-cache" Response.ContentType = "Image/bmp" //输出图像文件头 head = ChrB(66) & ChrB(77) & ChrB(118) & ChrB(250) &...
这个漏洞对于动易网站管理系统来说,就是致命的了。 此漏洞存在于User目录下的User_saveflash.asp文件中,其第6~22行代码如下所示。 Dim act, ObjInstalled_FSO, color_name, Create_1, imgurl, SaveFileName, dirMonth objName_FSO = Application("objName_FSO") ObjInstalled_FSO = IsObjInstalled(objName_FSO) If ObjInstalled_FSO = True Then Set fso = Server.CreateObject(objName_FSO) Else Response.Write "&&SendFlag=保存 >>> NO" Response.end End If act = trim(request("act")) //这里是关键 If act="" Then Call Main() Else Call CoverColorFile() //如果act不为空,则调用CoverColorFile()函数 End If set fso = Nothing 下面我们一起来看看函数CoverColorFile()的代码。 Sub CoverColorFile() //此函数用于生成图像BMP文件 Dim whichfile, head, Colortxt, i, rline, badwords //注意whichfile变量 Response.Expires = -9999 Response.AddHeader "Pragma","no-cache" Response.AddHeader "cache-ctrol","no-cache" Response.ContentType = "Image/bmp" //输出图像文件头 head = ChrB(66) & ChrB(77) & ChrB(118) & ChrB(250) & ChrB(1) & ChrB(0) & ChrB(0) & ChrB(0) &_ ChrB(0) & ChrB(0) & ChrB(54) & ChrB(0) & ChrB(0) & ChrB(0) & ChrB(40) & ChrB(0) &_ ChrB(0) & ChrB(0) & ChrB(172) & ChrB(0) & ChrB(0) & ChrB(0) & ChrB(130) & ChrB(0) &_ ChrB(0) & ChrB(0) & ChrB(1) & ChrB(0) & ChrB(24) & ChrB(0) & ChrB(0) & ChrB(0) &_ ChrB(0) & ChrB(0) & ChrB(64) & ChrB(250) & ChrB(1) & ChrB(0) & ChrB(0) & ChrB(0) &_ ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) &_ ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) Response.BinaryWrite head whichfile=trim(request("color_url")) // whichfile由用户提交的color_url而来 Set Colortxt = fso.OpenTextFile(server.mappath(whichfile),1) //以只读方式打开用户提交的变量whichfile,这里取得的是文件 rline = Colortxt.ReadLine //读取文件一行 badwords = split(rline,"|") //以“|”作分隔 Colortxt.Close fso.deleteFile(server.mappath(whichfile)) //这句就是漏洞了,此句的作用是删除文件。由于whichfile由用户提交而来,又没有经过任何安全处理,所以便构成漏洞了。如果我们让 color_url=../conn.asp,那么就直接删除conn.asp文件了,同样,我们可以让color_url为站内任一文件,最后,我们可以删除全站的文件。 for i=0 to UBound(badwords) Response.BinaryWrite to3(badwords(i)) next End Sub 有了上面的漏洞 动易网站管理系统 好不要从外部接收数据,要么就删除代码:fso.deleteFile(server.mappath(whichfile))