程远ing 2024-06-18 22:54 北京
TLG潜龙会正式成立:攻防共创新境界,技术聚能共前行
TLG潜龙会官方公众号
0) {
_stack.info = _stack.info.replace(new RegExp(_stack.file.split("?")[0], "gi"), "__FILE__")
}
if (_.BadJs.ignorePath) {
_stack.info = _stack.info.replace(/http(s)?\:[^:\n]*\//ig, "").replace(/\n/gi, "");
}
return _stack;
}
window.addEventListener && window.addEventListener('error', _.BadJs.winErr);
window.addEventListener && window.addEventListener('unhandledrejection', _.BadJs.winErr);
return _.BadJs;
})(WX_BJ_REPORT);
window.WX_BJ_REPORT = WX_BJ_REPORT;
function __moonf__() {
if (window.__moonhasinit) return;
window.__moonhasinit = true;
window.__moonclientlog = [];
if (typeof JSON != "object") {
window.JSON = {
stringify: function() { return ""; },
parse: function() { return {}; }
};
}
var moon_init = function() {
(function() {
var inWx = (/MicroMessenger/i).test(navigator.userAgent);
var inMp = (/MPAPP/i).test(navigator.userAgent);
var _idkey = 121261;
var _startKey;
var _limit;
var _badjsId;
var _reportOpt;
var _extInfo;
var MOON_AJAX_NETWORK_OFFSET = 4;
window.__initCatch = function(opt) {
_idkey = opt.idkey;
_startKey = opt.startKey || 0;
_limit = opt.limit;
_badjsId = opt.badjsId;
_reportOpt = opt.reportOpt || "";
_extInfo = opt.extInfo || {};
_extInfo.rate = _extInfo.rate || 0.5;
}
window.__moon_report = function(array, rate_opt) {
var isAcrossOrigin = false;
var href = '';
try {
href = top.location.href;
} catch (e) {
isAcrossOrigin = true;
}
var rate = 0.5;
if (!!_extInfo && !!_extInfo.rate) {
rate = _extInfo.rate;
}
if (!!rate_opt && (typeof rate_opt == 'number')) {
rate = rate_opt;
}
if (
(!(/mp\.weixin\.qq\.com/).test(location.href) && !(/payapp\.weixin\.qq\.com/).test(location.href)) ||
Math.random() > rate ||
!(inWx || inMp) ||
(top != window && !isAcrossOrigin && !(/mp\.weixin\.qq\.com/).test(href))
) {
}
if (isObject(array))
array = [array];
if (!isArray(array) || _idkey == '')
return;
var data = "";
var log = [];
var key = [];
var val = [];
var idkey = [];
if (typeof _limit != "number") {
_limit = Infinity;
}
for (var i = 0; i < array.length; i++) {
var item = array[i] || {};
if (item.offset > _limit) continue;
if (typeof item.offset != "number") continue;
if (item.offset == MOON_AJAX_NETWORK_OFFSET && !!_extInfo && !!_extInfo.network_rate && Math.random() >= _extInfo.network_rate) {
continue;
}
var k = _limit == Infinity ? _startKey : (_startKey + item.offset);
log[i] = (("[moon]" + _idkey + "_" + k + ";") + item.log + ";" + getErrorMessage(item.e || {})) || "";
key[i] = k;
val[i] = 1;
}
for (var j = 0; j < key.length; j++) {
idkey[j] = _idkey + "_" + key[j] + "_" + val[j];
data = data + "&log" + j + "=" + log[j];
}
if (idkey.length > 0) {
sendReport("POST", location.protocol + '//mp.weixin.qq.com/mp/jsmonitor?', "idkey=" + idkey.join(";") + "&r=" + Math.random() + "&lc=" + log.length + data);
var rate = 1;
if (_extInfo && _extInfo.badjs_rate) {
rate = _extInfo.badjs_rate;
}
if (Math.random() < rate) {
data = data.replace(/uin\:(.)*\|biz\:(.)*\|mid\:(.)*\|idx\:(.)*\|sn\:(.)*\|/, '');
if(!!_badjsId){
var _img = new Image();
var _src = 'https://badjs.weixinbridge.com/badjs?id=' + _badjsId + '&level=4&from=' + encodeURIComponent(location.host) + '&msg=' + encodeURIComponent(data);
_img.src = _src.slice(0, 1024);
}
if (typeof WX_BJ_REPORT != "undefined" && WX_BJ_REPORT.BadJs) {
for (var i = 0; i < array.length; i++) {
var item = array[i] || {};
if (item.e) {
WX_BJ_REPORT.BadJs.onError(item.e,{_info:item.log});
} else {
var name = /[^:;]*/.exec(item.log)[0];
WX_BJ_REPORT.BadJs.report(name, item.log, { mid: "mmbizwap:Monitor" });
}
}
}
} else {
for (var i = 0; i < array.length; i++) {
var item = array[i] || {};
if (item.e) {
item.e.BADJS_EXCUTED = true;
}
}
}
}
}
function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
}
function isObject(obj) {
return Object.prototype.toString.call(obj) === '[object Object]';
}
function getErrorMessage(e) {
var stack = e.stack + ' ' + e.toString() || "";
try {
if (!window.testenv_reshost) {
stack = stack.replace(/http(s)?:\/\/res\.wx\.qq\.com/g, "");
} else {
var host = 'http(s)?://' + window.testenv_reshost;
var reg = new RegExp(host, 'g');
stack = stack.replace(reg, "");
}
var reg = /\/([^.]+)\/js\/(\S+?)\.js(\,|:)?/g;
while (reg.test(stack)) {
stack = stack.replace(reg, function(a, b, c, d, e, f) {
return c + d
});
}
} catch (e) {
stack = e.stack ? e.stack : ""
}
var ret = [];
for (o in _reportOpt) {
if (_reportOpt.hasOwnProperty(o)) {
ret.push(o + ":" + _reportOpt[o]);
}
}
ret.push("STK:" + stack.replace(/\n/g, ""));
return ret.join("|");
}
function sendReport(type, url, data) {
if (!/^mp\.weixin\.qq\.com$/.test(location.hostname)) {
var tmp = [];
data = data.replace(location.href, (location.origin || "") + (location.pathname || "")).replace("#wechat_redirect", "").replace("#rd", "").split("&");
for (var i = 0, il = data.length; i < il; i++) {
var a = data[i].split("=");
if (!!a[0] && !!a[1]) {
tmp.push(a[0] + "=" + encodeURIComponent(a[1]));
}
}
var _img = new window.Image();
_img.src = (url + tmp.join("&")).substr(0, 1024);
return;
}
var xmlobj;
if (window.ActiveXObject) {
try {
xmlobj = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlobj = false;
}
}
} else if (window.XMLHttpRequest) {
xmlobj = new XMLHttpRequest();
}
if (!xmlobj) return;
xmlobj.open(type, url, true);
xmlobj.setRequestHeader("cache-control", "no-cache");
xmlobj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
xmlobj.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xmlobj.send(data);
}
})();
};
moon_init();
(!!window.__moon_initcallback) && (window.__moon_initcallback());
}
__moonf__();
if (!!window.addEventListener){
window.addEventListener("load",function(){
var MOON_SCRIPT_ERROR_KEY_OFFSET = 1;
var ns = document.querySelectorAll("[reportloaderror]");
for(var ni=0,nl=ns.length;ni
文章来源: https://mp.weixin.qq.com/s?__biz=MzA5MzE5MDAzOA==&mid=2664217361&idx=3&sn=60acc8b88e413b0586459367b92bc369&chksm=8b59b9e8bc2e30fe576a34ed0af335675b75e16737055c221462896a3b4b630773d968bbd211&scene=58&subscene=0#rd
如有侵权请联系:admin#unsafe.sh