shushangbuchanshou
shushangbuchanshou
采纳率0%
2018-05-14 08:30 阅读 1.6k

网站访问一段的js,js的内容如下,大概是什么意思,有没有遇到类似的问题

5

访问路径为192.168.2.2/cookie/flash.js,Ip为所属局域网地址,查资料为网站劫持,网站引入的几个外置服务都会出现这么一段js的引用?这段js大概是什么意思?

var url = "";

var timeinterval=0;
var f_crc = 0;
var custom_cookie;

function setTimeVal(ACtime, crc)
{
var now=new Date().getTime();//毫秒
timeinterval = Math.round((now - ACtime)/1000);

timeinterval = timeinterval % (24 * 3600); //对一天的时间进行取余

f_crc = crc;

}

function setURL(ip)
{
url = "http://"+ip+":89/cookie/flashcookie.html";
}

function loadPage()
{
location.replace(location.href.split("#")[0]);
}

function upload_custom()
{
if(url == ""){
loadPage();
return;
}

custom_cookie = "fc=0&f=" + f_crc;

var params=custom_cookie+"&bt=0"+"&interval="+timeinterval;
var script = document.createElement("script");
script.type = "text/javascript";
var done = false;
script.onload = script.onreadystatechange = function(){
    if ( !done && (!this.readyState ||
            this.readyState === "loaded" || this.readyState === "complete") ) {
        done = true;
        this.onload = this.onreadystatechange = null;
        loadPage();
        return;
    }
};
script.src = url +"?"+params+"&"+Math.random();
document.getElementsByTagName("head")[0].appendChild(script);

}

////add by yxf@2014/08/27
/**
*@描 述:增加UA判断,排除移动终端上报cookies值和时间间隔值
*@返回值:

  •  true, 允许上报; false,不允许上报
    

    */
    function IsCanReport2Ac(){

    var strUseAgent = navigator.userAgent.toLowerCase();

    //非windows nt
    var isWinNt = strUseAgent.indexOf("windows nt") > -1;
    if (!isWinNt){ return false;}

    //移动终端
    var isMobile = strUseAgent.indexOf("mobile") > -1;
    if (isMobile){ return false;}

    //为Android
    var isAndroid = strUseAgent.indexOf("android") > -1;
    if (isAndroid){ return false;}

    //为ios
    var isIOS = !!strUseAgent.match(/(i[^;]+;( u;)? cpu.+mac os x/);
    if (isIOS){ return false;}

    //为Symbian
    var isSymbian = strUseAgent.indexOf("symbian") > -1;
    if (isSymbian){ return false;}

    //为iPhone
    var isIPhone = strUseAgent.indexOf("iphone") > -1;
    if (isIPhone){ return false;}

    //为ipad
    var isIPad = strUseAgent.indexOf("ipad") > -1;
    if (isIPad){ return false;}

    //为ipod
    var isIPod = strUseAgent.indexOf("ipod") > -1;
    if (isIPod){ return false;}

    return true;
    }
    ////end by yxf

function supFlash()
{

if (false === IsCanReport2Ac()){

    return;
}

var flash = 0;
var judgeIE = !-[1,];
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("taobrowser") > 0 || ua.indexOf("lbbrowser") > 0) {
    //loadPage();
    upload_custom();
    return;
}
var isIE = judgeIE || ua.indexOf("msie") > 0 || ua.indexOf("trident/7.0") > 0;
if(isIE){
    try{
        var swf1 = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
        flash = 1;
    }
    catch(e){
        flash = 0;
    }
}
else {
    try{
        var swf2 = navigator.plugins['Shockwave Flash'];
        if(swf2 == undefined){
            flash = 0;
        }
        else {
            flash = 1;
        }
    }
    catch(e){
        flash = 0;
    }
}

if(flash === 0)
{
    //loadPage();
    upload_custom();
    return;
}   

}

function jsSetCookie(cookie)
{
if(cookie == ""){
loadPage();
return;
}

if(url == ""){
    loadPage();
    return;
}

var ua = navigator.userAgent.toLowerCase();
plugins=window.navigator.plugins;
browserType=1;
for(i=0;i<plugins.length;i++){
    if(plugins[i].filename=="pepflashplayer.dll"){
        browserType=0;
    }
}
if (browserType == 0 && ua.indexOf("metasr") > 0){
    browserType=2;
}
params=cookie+"&bt="+browserType+"&interval="+timeinterval; 
var script = document.createElement("script");
script.type = "text/javascript";
var done = false;
script.onload = script.onreadystatechange = function(){
    if ( !done && (!this.readyState ||
            this.readyState === "loaded" || this.readyState === "complete") ) {
        done = true;
        this.onload = this.onreadystatechange = null;
        loadPage();
        return;
    }
};
script.src = url +"?"+params+"&"+Math.random();
document.getElementsByTagName("head")[0].appendChild(script);

}

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • caozhy 从今以后生命中的每一秒都属于我爱的人 2018-05-14 15:44

    看到了有ua判断,是否有flash的判断和设置cookie的代码,不知道说的“上报”是什么意思,但是明显针对pc+flash的环境和别的环境走了不同的逻辑
    pepflashplayer.dll是一个不明的dll,具体的逻辑可能在这个其中。

    点赞 评论 复制链接分享

相关推荐