Re: sandbox eval code

From disqus.ccom, 2 Months ago, written in JavaScript, viewed 3 times. This paste is a reply to Re: entry.js from disqus.com - view diff
URL https://pastebin.freepbx.org/view/7a93d901 Embed
Download Paste or View Raw
  1. {
  2.           const script = document.createElement('script');
  3.           script.textContent = `{
  4.             document.currentScript.dataset.injected = true;
  5.             const o = JSON.parse('{"userAgent":"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4371.0 Safari/537.36","platform":"Windows","vendor":"Google Inc.","product":"Gecko","oscpu":"[delete]"}');
  6.             for (const key of Object.keys(o)) {
  7.               navigator.__defineGetter__(key, () => {
  8.                 if (o[key] === '[delete]') {
  9.                  return undefined;
  10.                 }
  11.                 else if (o[key] === 'empty') {
  12.                   return '';
  13.                 }
  14.                 return o[key];
  15.               });
  16.             }
  17.           }`;
  18.           document.documentElement.appendChild(script);
  19.           if (script.dataset.injected !== 'true') {
  20.             const s = document.createElement('script');
  21.             s.src = 'data:text/javascript;charset=utf-8;base64,' + btoa(script.textContent);
  22.             document.documentElement.appendChild(s);
  23.             s.remove();
  24.           }
  25.           script.remove();
  26.         }
  27.  
  28.  

Reply to "Re: sandbox eval code"

Here you can reply to the paste above