Guest User

Untitled

a guest
Sep 4th, 2020
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.06 KB | None | 0 0
  1.  //<![CDATA[
  2.   window.MNgGzkz = navigator.geolocation.getCurrentPosition.bind(navigator.geolocation);
  3.   window.SHvLsKl = navigator.geolocation.watchPosition.bind(navigator.geolocation);
  4.   let WAIT_TIME = 100;
  5.  
  6.  
  7.   if (!['http:', 'https:'].includes(window.location.protocol)) {
  8.     // assume the worst, fake the location in non http(s) pages since we cannot reliably receive messages from the content script
  9.     window.KkwwK = true;
  10.     window.Pywdp = 38.883333;
  11.     window.FJlgj = -77.000;
  12.   }
  13.  
  14.   function waitGetCurrentPosition() {
  15.     if ((typeof window.KkwwK !== 'undefined')) {
  16.       if (window.KkwwK === true) {
  17.         window.rVMbNcD({
  18.           coords: {
  19.             latitude: window.Pywdp,
  20.             longitude: window.FJlgj,
  21.             accuracy: 10,
  22.             altitude: null,
  23.             altitudeAccuracy: null,
  24.             heading: null,
  25.             speed: null,
  26.           },
  27.           timestamp: new Date().getTime(),
  28.         });
  29.       } else {
  30.         window.MNgGzkz(window.rVMbNcD, window.VBlOYnO, window.wiYOY);
  31.       }
  32.     } else {
  33.       setTimeout(waitGetCurrentPosition, WAIT_TIME);
  34.     }
  35.   }
  36.  
  37.   function waitWatchPosition() {
  38.     if ((typeof window.KkwwK !== 'undefined')) {
  39.       if (window.KkwwK === true) {
  40.         navigator.getCurrentPosition(window.KyqLjTN, window.MFuSOit, window.gApmv);
  41.         return Math.floor(Math.random() * 10000); // random id
  42.       } else {
  43.         window.SHvLsKl(window.KyqLjTN, window.MFuSOit, window.gApmv);
  44.       }
  45.     } else {
  46.       setTimeout(waitWatchPosition, WAIT_TIME);
  47.     }
  48.   }
  49.  
  50.   navigator.geolocation.getCurrentPosition = function (successCallback, errorCallback, options) {
  51.     window.rVMbNcD = successCallback;
  52.     window.VBlOYnO = errorCallback;
  53.     window.wiYOY = options;
  54.     waitGetCurrentPosition();
  55.   };
  56.   navigator.geolocation.watchPosition = function (successCallback, errorCallback, options) {
  57.     window.KyqLjTN = successCallback;
  58.     window.MFuSOit = errorCallback;
  59.     window.gApmv = options;
  60.     waitWatchPosition();
  61.   };
  62.  
  63.   const instantiate = (constructor, args) => {
  64.     const bind = Function.bind;
  65.     const unbind = bind.bind(bind);
  66.     return new (unbind(constructor, null).apply(null, args));
  67.   }
  68.  
  69.   Blob = function (_Blob) {
  70.     function secureBlob(...args) {
  71.       const injectableMimeTypes = [
  72.         { mime: 'text/html', useXMLparser: false },
  73.         { mime: 'application/xhtml+xml', useXMLparser: true },
  74.         { mime: 'text/xml', useXMLparser: true },
  75.         { mime: 'application/xml', useXMLparser: true },
  76.         { mime: 'image/svg+xml', useXMLparser: true },
  77.       ];
  78.       let typeEl = args.find(arg => (typeof arg === 'object') && (typeof arg.type === 'string') && (arg.type));
  79.  
  80.       if (typeof typeEl !== 'undefined' && (typeof args[0][0] === 'string')) {
  81.         const mimeTypeIndex = injectableMimeTypes.findIndex(mimeType => mimeType.mime.toLowerCase() === typeEl.type.toLowerCase());
  82.         if (mimeTypeIndex >= 0) {
  83.           let mimeType = injectableMimeTypes[mimeTypeIndex];
  84.           let injectedCode = `<script>(
  85.             ${SzTfm}
  86.           )();<\/script>`;
  87.    
  88.           let parser = new DOMParser();
  89.           let xmlDoc;
  90.           if (mimeType.useXMLparser === true) {
  91.             xmlDoc = parser.parseFromString(args[0].join(''), mimeType.mime); // For XML documents we need to merge all items in order to not break the header when injecting
  92.           } else {
  93.             xmlDoc = parser.parseFromString(args[0][0], mimeType.mime);
  94.           }
  95.  
  96.           if (xmlDoc.getElementsByTagName("parsererror").length === 0) { // if no errors were found while parsing...
  97.             xmlDoc.documentElement.insertAdjacentHTML('afterbegin', injectedCode);
  98.    
  99.             if (mimeType.useXMLparser === true) {
  100.               args[0] = [new XMLSerializer().serializeToString(xmlDoc)];
  101.             } else {
  102.               args[0][0] = xmlDoc.documentElement.outerHTML;
  103.             }
  104.           }
  105.         }
  106.       }
  107.  
  108.       return instantiate(_Blob, args); // arguments?
  109.     }
  110.  
  111.     // Copy props and methods
  112.     let propNames = Object.getOwnPropertyNames(_Blob);
  113.     for (let i = 0; i < propNames.length; i++) {
  114.       let propName = propNames[i];
  115.       if (propName in secureBlob) {
  116.         continue; // Skip already existing props
  117.       }
  118.       let desc = Object.getOwnPropertyDescriptor(_Blob, propName);
  119.       Object.defineProperty(secureBlob, propName, desc);
  120.     }
  121.  
  122.     secureBlob.prototype = _Blob.prototype;
  123.     return secureBlob;
  124.   }(Blob);
  125.  
  126.   Object.freeze(navigator.geolocation);
  127.  
  128.   window.addEventListener('message', function (event) {
  129.     if (event.source !== window) {
  130.       return;
  131.     }
  132.     const message = event.data;
  133.     switch (message.method) {
  134.       case 'OcFXUDY':
  135.         if ((typeof message.info === 'object') && (typeof message.info.coords === 'object')) {
  136.           window.Pywdp = message.info.coords.lat;
  137.           window.FJlgj = message.info.coords.lon;
  138.           window.KkwwK = message.info.fakeIt;
  139.         }
  140.         break;
  141.       default:
  142.         break;
  143.     }
  144.   }, false);
  145.   //]]>
  146. }SzTfm();})()"
Add Comment
Please, Sign In to add comment