daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Jan 28th, 2016 140 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var config = require('./config.js');
  2. var random = require('./random.js');
  3. var Browser = require('zombie');
  4. var browser = new Browser();
  5. var deathbycaptcha = require('deathbycaptcha4');
  6. var request = require('request');
  7. var fs = require('fs');
  8. var robot = require("robotjs");
  9. var Chance = require('chance'),
  10.     chance = new Chance();
  11. var proxyType = process.argv[2];
  12. var medium = process.argv[3];
  13. var server = process.argv[4].toLowerCase();
  14. var dbcReady = false;
  15. var httpsProxies = [];
  16.  
  17. var socket =
  18. require('socket.io-client')('http://89.2.60.104:1332/');
  19. socket.on('connect', function(){
  20.   socket.emit('authenticate', 'account_creator', '0oiqejgoijqhn#qwflkjhn');
  21.   console.log('Connected to master bot');
  22. });
  23. socket.on('startWork', function(){
  24.   doTheWork();
  25. });
  26. socket.on('giveData', function(type, dataArray) {
  27.   switch (type) {
  28.     case 'dbc_acc':
  29.       deathbycaptcha.credentials({
  30.         username: dataArray[0].split(':')[0],
  31.         password: dataArray[0].split(':')[1]
  32.       });
  33.       dbcReady = true;
  34.       break;
  35.     case 'https_proxies':
  36.       for (var i = 0; i < dataArray.length; i++) {
  37.         httpsProxies.push(dataArray[i]);
  38.       }
  39.       break;
  40.   }
  41.   doTheWork();
  42. })
  43. socket.on('disconnect', function(){});
  44.  
  45. function doTheWork() {
  46.   console.log('doing the work ...')
  47.   if (!dbcReady) {
  48.     socket.emit('getData', 'dbc_acc', 1);
  49.     return;
  50.   }
  51.   if (httpsProxies.length == 0 && proxyType != 'NOPROXY') {
  52.     socket.emit('getData', 'https_proxies', 1);
  53.     return;
  54.   }
  55.  
  56.   switch (medium) {
  57.     case 'LOL':
  58.     robot.setMouseDelay(25);
  59.     robot.setKeyboardDelay(35);
  60.  
  61.     var screenSize = robot.getScreenSize();
  62.     console.log(screenSize);
  63.     var height = screenSize.height;
  64.     var width = screenSize.width;
  65.     var offset = 20;
  66.  
  67.     robot.keyTap('left', 'alt');
  68.     robot.moveMouse(1419, 42+offset);
  69.     robot.mouseClick();
  70.     robot.moveMouse(1227, 131+offset);
  71.     robot.mouseClick();
  72.  
  73.     // configs
  74.     var urlSignupPage = 'https://signup.' + server + '.leagueoflegends.com/en/signup/index?realm_key=' + server;
  75.  
  76.     // google chrome should be started, no tabs opened
  77.     // lets open the signup page
  78.     robot.moveMouse(442, 43+offset);
  79.     robot.mouseClick();
  80.     robot.keyTap('a', 'control');
  81.     robot.typeString(urlSignupPage);
  82.     robot.keyTap('enter');
  83.  
  84.     // at this point the page starts the load, and we need to wait for full load
  85.     var pageLoaded = false;
  86.     while (!pageLoaded) {
  87.       var pixel = robot.getPixelColor(74, 12+offset);
  88.       //console.log(pixel);
  89.       if (pixel == '1d87da') pageLoaded = true;
  90.     }
  91.  
  92.     // acc info
  93.     var info = {
  94.       name: random.name(),
  95.       pw: random.password(),
  96.       emailPrefix: random.emailPrefix(),
  97.       emailSuffix: random.emailSuffix(),
  98.       birthday: random.birthday()
  99.     }
  100.     console.log(info);
  101.     var pw = random.password();
  102.     robot.moveMouse(1125, 288+offset);
  103.     robot.mouseClick();
  104.     robot.typeString(info.name);
  105.     robot.keyTap('tab');
  106.  
  107.     robot.typeString(info.pw);
  108.     robot.keyTap('tab');
  109.     robot.typeString(info.pw);
  110.     robot.keyTap('tab');
  111.     robot.typeString(info.emailPrefix);
  112.     robot.keyTap('@', 'shift');
  113.     robot.typeString(info.emailSuffix);
  114.     robot.keyTap('tab');
  115.     if (server == 'na') {
  116.       robot.keyTap('down');
  117.       robot.keyTap('up');
  118.       for (var i = 1; i <= info.birthday.getUTCMonth(); i++) {
  119.         robot.keyTap('down');
  120.       }
  121.       robot.keyTap('tab');
  122.       robot.typeString(info.birthday.getUTCDate());
  123.       robot.keyTap('tab');
  124.     } else {
  125.       robot.typeString(info.birthday.getUTCDate());
  126.       robot.keyTap('tab');
  127.       robot.keyTap('down');
  128.       robot.keyTap('up');
  129.       for (var i = 1; i <= info.birthday.getUTCMonth(); i++) {
  130.         robot.keyTap('down');
  131.       }
  132.       robot.keyTap('tab');
  133.     }
  134.  
  135.     robot.typeString(info.birthday.getUTCFullYear());
  136.     robot.keyTap('tab');
  137.     robot.moveMouse(851, 572+offset);
  138.     robot.mouseClick();
  139.     robot.moveMouse(851, 595+offset);
  140.     robot.mouseClick();
  141.     robot.moveMouse(869, 694+offset);
  142.     robot.mouseClick();
  143.  
  144.     // at this point the user manually fills captcha and submit form, we wait
  145.     var pageLoaded = false;
  146.     while (!pageLoaded) {
  147.       var pixel = robot.getPixelColor(1015, 358+offset);
  148.       //console.log(pixel);
  149.       if (pixel == 'd3683b') pageLoaded = true;
  150.     }
  151.  
  152.     // at this point the user manually reloads page until the username displays
  153.     // var pageLoaded = false;
  154.     // while (!pageLoaded) {
  155.     //   var pixel = robot.getPixelColor(833, 841+offset);
  156.     //   //console.log(pixel);
  157.     //   if (pixel == 'ad8f4e') pageLoaded = true;
  158.     // }
  159.  
  160.     robot.keyTap('w','control');
  161.     robot.keyTap('right', 'alt');
  162.  
  163.     // here the account is created !! sending to master bot
  164.     socket.emit('newData', 'lol_acc_' + server, JSON.stringify([info.name + ':' + info.pw]));
  165.  
  166.     setTimeout(function() {
  167.       process.exit();
  168.     }, 1000);
  169.  
  170.       // console.log(urlSignupPage);
  171.       // loadSignupPageLOL(urlSignupPage, function(signupInfo) {
  172.       //   console.log(signupInfo);
  173.       //   generateRecaptchaGoogle(function(captcha) {
  174.       //     console.log(captcha);
  175.       //     crackRecaptchaGoogle(captcha, function(captchaResult) {
  176.       //       console.log(captchaResult);
  177.       //       setTimeout(fillTheSignupFormLOL(signupInfo, captcha, captchaResult), chance.integer({min: 1000, max: 2000}));
  178.       //     });
  179.       //   });
  180.       // });
  181.       break;
  182.     case 'GMX':
  183.       var urlSignupPage = 'https://service.gmx.com/registration.html';
  184.       loadSignupPageGMX(urlSignupPage, function(signupInfo) {
  185.         console.log(signupInfo);
  186.       });
  187.       break;
  188.   }
  189. }
  190.  
  191. function loadSignupPageGMX(url, callback) {
  192.   var j = request.jar();
  193.   request({
  194.     url: url,
  195.     headers: random.headers(),
  196.     jar: j,
  197.     proxy: 'http://' + httpsProxies[0],
  198.     timeout: 15000
  199.   }, function (err, response, body) {
  200.     if(err) {
  201.       console.log(err);
  202.       console.log('Error while fetching signup page');
  203.       process.exit(code=0);
  204.     }
  205.     var result = {jar: j};
  206.     return callback(result);
  207.   });
  208. }
  209.  
  210. function loadSignupPageLOL(url, callback) {
  211.   var j = request.jar();
  212.   var requestConfig = {
  213.     url: url,
  214.     headers: random.headers(),
  215.     jar: j,
  216.     timeout: 15000
  217.   };
  218.   if (proxyType != 'NOPROXY')
  219.     requestConfig.proxy = 'http://' + httpsProxies[0];
  220.   request(requestConfig, function (err, response, body) {
  221.     if(err) {
  222.       console.log(err);
  223.       console.log('Error while fetching signup page');
  224.       process.exit(code=0);
  225.     }
  226.     var result = {jar: j};
  227.     // parsing token key
  228.     if(body.indexOf('data[_Token][key]')>=0){
  229.       var tempBody = body.substr(body.indexOf('data[_Token][key]')+26);
  230.       tempBody = tempBody.substr(0, tempBody.indexOf('"'));
  231.       result.tokenKey = tempBody;
  232.     }
  233.     // parsing token fields
  234.     if(body.indexOf('data[_Token][fields]')>=0){
  235.       var tempBody = body.substr(body.indexOf('data[_Token][fields]')+29);
  236.       tempBody = tempBody.substr(0, tempBody.indexOf('"'));
  237.       result.tokenFields = tempBody;
  238.     }
  239.     return callback(result);
  240.   });
  241. }
  242.  
  243. function generateRecaptchaGoogle(callback) {
  244.   var url = 'https://www.google.com/recaptcha/api/challenge?k=6LfIGv0SAAAAAMlOtNMMbb6PA6VQAMQcJ_cD4fRm';
  245.   request({url: url, headers: random.headers()}, function (err, response, body) {
  246.     if (err) console.log(err);
  247.     // parsing the challengeId
  248.     var captcha = {
  249.       challengeId: body.substring(body.indexOf('challenge : \'') + 13).substring(0, body.substring(body.indexOf('challenge : \'') + 13).indexOf('\''))
  250.     };
  251.     captcha.challengeUrl = 'https://www.google.com/recaptcha/api/image?c=' + captcha.challengeId;
  252.     request(captcha.challengeUrl).pipe(fs.createWriteStream('captcha.png'));
  253.     return callback(captcha);
  254.   });
  255. }
  256.  
  257. function crackRecaptchaGoogle(captcha, callback) {
  258.   deathbycaptcha.decodeUrl(captcha.challengeUrl, 1000, function(err, captchaResult) {
  259.     return callback(captchaResult);
  260.   });
  261. }
  262.  
  263. function fillTheSignupFormLOL(signupInfo, captcha, captchaResult, callback) {
  264.   var password = random.password();
  265.   var form = {
  266.     '_method': 'POST',
  267.     'data[_Token][key]': signupInfo.tokenKey,
  268.     'data[PvpnetAccount][name]': random.name(),
  269.     'data[PvpnetAccount][password]': password,
  270.     'data[PvpnetAccount][confirm_password]': password,
  271.     'data[PvpnetAccount][email_address]': random.emailAddress(),
  272.     'data[PvpnetAccount][date_of_birth_day]': ('0' + random.birthday().getUTCDate()).slice(-2),
  273.     'data[PvpnetAccount][date_of_birth_month]': ('0' + (random.birthday().getUTCMonth()+1)).slice(-2),
  274.     'data[PvpnetAccount][date_of_birth_year]': random.birthday().getUTCFullYear(),
  275.     'data[PvpnetAccount][realm]': server,
  276.     'data[PvpnetAccount][tou_agree]': 1,
  277.     'data[PvpnetAccount][newsletter]': 1,
  278.     'recaptcha_challenge_field': captcha.challengeId,
  279.     'recaptcha_response_field': captchaResult.text,
  280.     'data[_Token][fields]': signupInfo.tokenFields
  281.   }
  282.   console.log(form);
  283.   var requestConfig = {
  284.     url:'https://signup.' + server + '.leagueoflegends.com/en/signup/index?realm_key=' + server,
  285.     headers: random.headers(),
  286.     form: form,
  287.     jar: signupInfo.jar,
  288.     followAllRedirects: true,
  289.     timeout: 15000
  290.   };
  291.   if (proxyType != 'NOPROXY')
  292.     requestConfig.proxy = 'http://' + httpsProxies[0];
  293.   request.post(requestConfig, function(err,httpResponse,body){
  294.     if(err) {
  295.       console.log(err);
  296.       console.log('Error while submitting form');
  297.       process.exit(code=0);
  298.       return;
  299.     }
  300.  
  301.     if(body){
  302.       if(body.indexOf('<li class="error">User name already in use</li>')>=0){
  303.         console.log('User name already in use');
  304.         process.exit(code=0);
  305.       } else if(body.indexOf('<span class="error">The reCaptcha code was incorrect</span>')>=0){
  306.         deathbycaptcha.report(captcha.id, function(err, results) {
  307.           if(err) console.log(err);
  308.           console.log('The reCaptcha code was incorrect');
  309.           process.exit(code=0);
  310.         });
  311.       } else {
  312.         fs.writeFile("result.html", body, function(err) {
  313.           if(body.indexOf('<h4>Your League of Legends Username is: </h4><p class="username">' + form['data[PvpnetAccount][name]'])>=0) {
  314.             console.log('Account created: ' + form['data[PvpnetAccount][name]'] + ' ' + form['data[PvpnetAccount][password]']);
  315.             socket.emit('newData', 'lol_acc_' + server, JSON.stringify([form['data[PvpnetAccount][name]'] + ':' + form['data[PvpnetAccount][password]']]));
  316.             setTimeout(function(){process.exit(code=0)},2500);
  317.           } else {
  318.             console.log('Undetected error');
  319.             process.exit(code=0);
  320.           }
  321.         });
  322.       }
  323.     }
  324.   });
  325. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top