Guest User

Pirate Domain Spoof Logic

a guest
Oct 27th, 2021
55
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script noab="true">
  2. // These two flags only get set to true here, perhaps they have some impact elsewhere, can't tell
  3. var noab = false;
  4. var organic = false;
  5. // Haven't been able to determine what this is because our test URL does not have "ls" in it
  6. let indexPage = window.location.hash.substr(1);
  7. console.log('hash', window.location)
  8. if (indexPage == 'ls') {
  9. window['ls'] = true;
  10. }
  11. var article_link = '/team/MTMwMC4w';
  12. var URL_FRAGMENTS = [
  13. 'pushState',
  14. 'location',
  15. 'indexOf',
  16. 'href',
  17. '?utm_source=google&utm_medium=organic',
  18. '/reader/',
  19. 'replaceState',
  20. 'random'
  21. ];
  22. console.log(URL_FRAGMENTS);
  23. // This runs some type of slot machine bit where it rotates the same
  24. // array values in a cycle for an arbitrary amount of times
  25. // looks like just filler confusing type code
  26. (function(SELF_CALL_URL_FRAGMENTS, INCREMENTED_NUMBER) {
  27. console.log('selfcall', SELF_CALL_URL_FRAGMENTS, INCREMENTED_NUMBER)
  28. var reference_iterator = 0;
  29. var URL_FRAGMENT_ROTATOR = function(INCREMENTED_NUMBER_ARG) {
  30. while (--INCREMENTED_NUMBER_ARG) {
  31. reference_iterator++;
  32. SELF_CALL_URL_FRAGMENTS['push'](SELF_CALL_URL_FRAGMENTS['shift']());
  33. console.log('SELF CALL ITERATE',`Ref Iter ${reference_iterator}`, SELF_CALL_URL_FRAGMENTS);
  34. }
  35. };
  36. URL_FRAGMENT_ROTATOR(++INCREMENTED_NUMBER);
  37. })(URL_FRAGMENTS, 382);
  38. // This uses the arbitrary number to then select just any single piece from URL_FRAGMENTS
  39. // They toss the numbers in hex to be extra covert but that's about it.
  40. // I converted all the hex values to int
  41. var SINGLE_URL_FRAGMENT_FETCHER = function(SEQUENCE_NUMBER, _0x7ec0eb) {
  42. // console.log('RANDO', SEQUENCE_NUMBER, _0x7ec0eb);
  43. SEQUENCE_NUMBER = SEQUENCE_NUMBER - 466;
  44. var SELECTED_FRAGMENT = URL_FRAGMENTS[SEQUENCE_NUMBER];
  45. // console.log('RANDO SEQ', SELECTED_FRAGMENT);
  46. return SELECTED_FRAGMENT;
  47. };
  48.  
  49. // Goofy remap of a function to be CrAzY RaNDom
  50. var FRAG_FETCH = SINGLE_URL_FRAGMENT_FETCHER;
  51. // Map of converted hex values to url fragment
  52. /*
  53. * 466 - replaceState()
  54. * 467 - "random"
  55. * 468 - pushState()
  56. * 469 - location
  57. * 470 - indexOf
  58. * 471 - href
  59. * 472 - ?utm_source=google&utm_medium=organic
  60. * 473 - /reader/
  61. */
  62. // Rolls the dice, 90% chance to append utm_source google to the url, sets organic flag to true
  63. Math.random() * 100 < 90 && ((article_link += '?utm_source=google&utm_medium=organic'), (organic = true));
  64. console.log('article link', article_link);
  65. // capability testing
  66. history['pushState'] && history['replaceState'] &&
  67. // Multiple calls, runs replaceState to set article link
  68. // to /team/MTMwMC4w?utm_source=google&utm_medium=organic?utm_source=google&utm_medium=organic
  69. // Then checks if we're still in /reader/
  70. // Then sets "noab" to true, presumably no adblock?\
  71. // Not sure what allowedNumberOfEboundDynamicAdds means
  72. (history.replaceState({}, null, article_link),
  73. document['location']['href'].indexOf('reader') < 0 &&
  74. (noab = true, (allowedNumberOfEboundDynamicAdds = 0)));
  75. // probably a trigger for the rest of the page to set behavior
  76. window['reader'] = true;
  77. // remove self
  78. setTimeout(function() {
  79. let elNoab = document.querySelector('script[noab="true"]');
  80. // more random stuff, select parent then drop back down to the child
  81. elNoab.parentElement.removeChild(elNoab);
  82. }, 500);
  83. </script>
RAW Paste Data