Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const utils = require("../bin/utils.js");
- const config = utils.config;
- const discord = utils.discord;
- const mysql = utils.mysql;
- const request = utils.request;
- const http = utils.http;
- const https = utils.https;
- //const Agent = utils.Agent;
- var HttpsProxyAgent= utils.HttpsProxyAgent;
- var md5 = utils.md5;
- const randomstring = utils.randomstring;
- var fs = require('fs')
- var good_discs = utils.uniq_fast(config.discordOGTags);
- var shit_tiers = new Array();
- let users = [];
- let emails = [];
- var account_batch = new Array();
- var proxies_tested = new Array();
- let proxies_temp = utils.uniq_fast(utils.replaceAll(fs.readFileSync("proxy.txt", "UTF-8"), '\r' , '').split("\n"));
- for(var i = 0; i < proxies_temp.length; i++) { proxies_temp = utils.shuffleArray(proxies_temp); }
- const proxies_loaded = JSON.parse(JSON.stringify(proxies_temp));
- const reqRegistOptions = {
- "uri": config.registrationUrl,
- "method": "POST",
- "headers": {
- "authority": "discordapp.com",
- "method": "POST",
- "scheme": "https",
- "path": "/api/v6/auth/register",
- "accept-encoding": "gzip, deflate, br",
- "referer": "https://discordapp.com/register",
- "accept": "*/",
- "accept-language": "en-US",
- "content-type": "application/json",
- "origin": "https://discordapp.com",
- "user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
- "x-fingerprint": config.fingerprint,
- "x-super-properties": "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiQ2hyb21lIiwiZGV2aWNlIjoiIiwicmVmZXJyZXIiOiIiLCJyZWZlcnJpbmdfZG9tYWluIjoiIn0=",
- },
- "body": "",
- "json": {},
- "maxRedirects": 20,
- "proxy": "",
- "followRedirect": true,
- "timeout": 70000,
- };
- const reqChangeUsernameOptions = {
- "uri": config.checkUrl,
- "method": "PATCH",
- "headers": {
- "method": "PATCH",
- "content-type": "application/json",
- },
- "proxy": "",
- "followRedirect": false,
- "timeout": 16000,
- }
- const reqCheckOptions = {
- "uri": config.checkUrl,
- "method": "GET",
- "headers": {
- "method": "GET",
- },
- "proxy": "",
- "followRedirect": false,
- "timeout": 20000,
- }
- const twocapInOptions = {
- "method": "POST",
- "url": config["2captchainurl"] + "?key=" + config["2captchaApi"] + "&method=userrecaptcha&googlekey=" + config.discordGoogleKey + "&pageurl=https://discordapp.com/&json=1",
- "headers": {
- "accept": "*/*",
- "authority": "2captcha.com",
- "content-type": "application/json",
- "accept-language": "en-US",
- "method": "POST",
- },
- };
- const twocapOutOptions = {
- "method": "GET",
- "url": config["2captchaouturl"] + "?key=" + config["2captchaApi"] + "&json=1&action=get&id=",
- "headers": {
- "accept": "*/*",
- "authority": "2captcha.com",
- "content-type": "application/json",
- "accept-language": "en-US",
- "method": "GET",
- },
- };
- function CheckAllAccounts() {
- if(haltDbSaves === true || config.farmMode === true) return;
- if(proxies_tested.length > 0) {
- //console.log("CheckAllAccounts");
- //var q = "SELECT * FROM " + config.dbConData["table"] + " WHERE discriminator IS NULL";
- var q = "SELECT * FROM " + config.dbConData["table"] + "";
- //good_discs.forEach(function(disc) { if(typeof(disc) === "string") { if(disc.length === 4) {q += " OR discriminator LIKE '" + disc + "'";}}});
- utils.RunQuery(q).then(data => {
- // do stuff
- let maxr = 9500-(9999-config.accountDiscrimsFreeSlots);
- let data_new = new Array();
- let runs = 0;
- for(var i = 0; i < data.length; i++) {
- if(runs > (Math.round(maxr/2))) continue;
- if(typeof(data[i]) !== "object") continue;
- let val = data[i];
- let ps = true;
- if(typeof(val["discriminator"]) === "string") {
- if(val["username"] === config.discrimForcerUsername && good_discs.includes(val["discriminator"]) === true) {
- if(typeof(val["date_lastchecked"]) === "string") {
- let diff = new Date() - new Date(val["date_lastchecked"]);
- if(diff < 30*60*1000) { ps = false; }
- }
- if(ps === true) { data_new.push(val); runs++; }
- }
- }
- }
- for(var i = 0; i < data.length; i++) {
- if(runs > (Math.round(maxr/4))) continue;
- if(typeof(data[i]) !== "object") continue;
- let val = data[i];
- let ps = true;
- if(typeof(val["discriminator"]) === "string") {
- if((val["username"] !== config.discrimForcerUsername && good_discs.includes(val["discriminator"]) === false) || (val["username"] !== config.discrimForcerUsername && shit_tiers.includes(val["discriminator"]) === true)) {
- if(typeof(val["date_lastchecked"]) === "string") {
- let diff = new Date() - new Date(val["date_lastchecked"]);
- if(diff < 30*60*1000) { ps = false; }
- }
- if(ps === true) { data_new.push(val); runs++; }
- }
- }
- }
- for(var i = 0; i < data.length; i++) {
- if(typeof(data[i]) !== "object") continue;
- let val = data[i];
- let ps = true;
- if(typeof(val["discriminator"]) !== "string") {
- if(typeof(val["date_lastchecked"]) === "string") {
- let diff = new Date() - new Date(val["date_lastchecked"]);
- if(diff < 30*60*1000) { ps = false; }
- }
- if(ps === true) { data_new.push(val); }
- }
- }
- console.log(data.length + " | " + data_new.length + " | " + maxr);
- data = data_new;
- runs = 0;
- for(let i = 0; i < data.length; i++) {
- if(runs > maxr || maxr < 1) continue;
- if(typeof(data[i]) === "object") {
- let val = data[i];
- let docont = false;
- if(typeof(val["discriminator"]) !== "string") {
- docont = true;
- } else {
- if(typeof(val["username"]) === "string") {
- if((val["username"] !== config.discrimForcerUsername && shit_tiers.includes(val["discriminator"]) === true) || (val["username"] !== config.discrimForcerUsername && good_discs.includes(val["discriminator"]) === false) || (val["username"] === config.discrimForcerUsername && good_discs.includes(val["discriminator"]) === true)) {
- docont = true;
- }
- }
- }
- if(typeof(val["date_lastchecked"]) === "string") {
- let diff = new Date() - new Date(val["date_lastchecked"]);
- if(diff < 30*60*1000) {
- docont = false;
- }
- }
- if(docont === true) {
- runs++;
- CheckUser(proxies_tested[Math.floor(Math.random() * proxies_tested.length)], val["token"], val["password"], val["date_changedname"]).then(res => {
- let val2;
- data.forEach(function(vll) {
- if(typeof(vll) === "object") {
- if(vll["email"] === res["email"]) {
- val2 = vll;
- }
- }
- });
- if(typeof(val2) === "object") {
- let f = false;
- if(account_batch.length > 0) {
- account_batch.forEach(function(vl3) {
- if(typeof(vl3) === "object") {
- if(typeof(vl3["email"]) === "string" && typeof(vl3["password"]) === "string") {
- if(vl3["email"] === val2["email"] && vl3["password"] === val2["password"]) {
- f = true;
- }
- }
- }
- });
- }
- if(f === false) {
- let dtlastname = null;
- if(typeof(res["username"]) === "string") {
- if(res["username"] !== val2["username"]) {
- val2["username"] = res["username"];
- }
- }
- if(typeof(res["discriminator"]) === "string") {
- if(res["discriminator"] !== val2["discriminator"]) {
- dtlastname = String(new Date());
- }
- }
- //console.log("Fixed problem!");
- account_batch.push({
- "id": res["id"],
- "discriminator": res["discriminator"],
- "date_lastchecked": new Date(),
- "date_created": val2["date_created"],
- "email": val2["email"],
- "username": val2["username"],
- "password": val2["password"],
- "token": val2["token"],
- "date_changedname": dtlastname,
- });
- //console.log("pushed!");
- }
- }
- }).catch(e => { /* console.error(e); */ });
- }
- }
- }
- });
- }
- }
- function SaveGoodDiscrimsToFile() {
- utils.RunQuery("SELECT * from " + config.dbConData["table"] + " WHERE discriminator IS NOT NULL").then(data => {
- let txtw = "**File containing decent discrims in the database.\nFormat: Discriminator\n\n";
- let txtp = "**File containing decent discrims in the database.\nFormat: Discriminator | Userid | Username | Password | Email | Token | Date Created\n\n";
- let ogs = new Array(new Array(), new Array());
- let rep4s = new Array(new Array(), new Array());
- let rep3s = new Array(new Array(), new Array());
- let rep24s = new Array(new Array(), new Array());
- let rep2s = new Array(new Array(), new Array());
- let others = new Array(new Array(), new Array());
- for(var asd = 0; asd < data.length; asd++) {
- let val = data[asd];
- if(typeof(val) !== "object") continue;
- if(typeof(config.discrimForcerUsername) === "string") { if(config.discrimForcerUsername !== "" && config.discrimForcerUsername.length > 4) { if(val["username"] === config.discrimForcerUsername) continue;}}
- let og = false; // check if is OG
- config.discordOGTags.forEach(function(vlc) {
- if(typeof(vlc) === "string") {
- if(vlc === val["discriminator"]) {
- og = true;
- }
- }
- });
- let disc = val["discriminator"].split("");
- let reps = {};
- let repeats_2 = 0; // amount of times 2 chars are repeated. max 2, 2+2 = 4
- let repeats_3 = false; // If there's a 3number repetition
- let rep_4 = false; // if there's a 4number repetition
- if(og === false) {
- for(var i = 0; i < disc.length; i++) {
- let thisch = disc[i];
- if(typeof(reps[thisch]) === "number") {
- reps[thisch] ++;
- } else {
- reps[thisch] = 1;
- }
- }
- //console.log(reps);
- for(let key in reps) {
- let obj = reps[key];
- if(obj === 4) {
- rep_4 = true;
- } else if(obj === 3) {
- repeats_3 = true;
- } else if(obj === 2) {
- repeats_2++;
- }
- }
- }
- //if(rep_4 === true || og === true || repeats_3 === true || repeats_2 === 2) { console.log("Decent discrim: " + val["discriminator"]); }
- if(og === true) {
- ogs[0].push(val["discriminator"]);
- ogs[1].push(val["discriminator"] + " | " + val["id"] + " | " + val["username"] + " | " + val["password"] + " | " + val["email"] + " | " + val["token"] + " | " + val["date_created"]);
- } else if(rep_4 === true) {
- rep4s[0].push(val["discriminator"]);
- rep4s[1].push(val["discriminator"] + " | " + val["id"] + " | " + val["username"] + " | " + val["password"] + " | " + val["email"] + " | " + val["token"] + " | " + val["date_created"]);
- } else if(repeats_3 === true) {
- rep3s[0].push(val["discriminator"]);
- rep3s[1].push(val["discriminator"] + " | " + val["id"] + " | " + val["username"] + " | " + val["password"] + " | " + val["email"] + " | " + val["token"] + " | " + val["date_created"]);
- } else if(repeats_2 === 2) {
- rep24s[0].push(val["discriminator"]);
- rep24s[1].push(val["discriminator"] + " | " + val["id"] + " | " + val["username"] + " | " + val["password"] + " | " + val["email"] + " | " + val["token"] + " | " + val["date_created"]);
- } else if(repeats_2 === 1) {
- rep2s[0].push(val["discriminator"]);
- rep2s[1].push(val["discriminator"] + " | " + val["id"] + " | " + val["username"] + " | " + val["password"] + " | " + val["email"] + " | " + val["token"] + " | " + val["date_created"]);
- } else {
- others[0].push(val["discriminator"]);
- others[1].push(val["discriminator"] + " | " + val["id"] + " | " + val["username"] + " | " + val["password"] + " | " + val["email"] + " | " + val["token"] + " | " + val["date_created"]);
- }
- }
- let orig = JSON.parse(JSON.stringify(ogs[0]));
- ogs[0] = utils.uniq_fast(ogs[0]);
- for(var i = 0; i < ogs[0].length; i++) {
- if(typeof(ogs[0][i]) === "string") {
- let cc = utils.countInArray(orig, ogs[0][i]);
- if(cc > 1) {
- ogs[0][i] = ogs[0][i] + " (" + cc + ")";
- }
- }
- }
- orig = JSON.parse(JSON.stringify(rep4s[0]));
- rep4s[0] = utils.uniq_fast(rep4s[0]);
- for(var i = 0; i < rep4s[0].length; i++) {
- if(typeof(rep4s[0][i]) === "string") {
- let cc = utils.countInArray(orig, rep4s[0][i]);
- if(cc > 1) {
- rep4s[0][i] = rep4s[0][i] + " (" + cc + ")";
- }
- }
- }
- orig = JSON.parse(JSON.stringify(rep3s[0]));
- rep3s[0] = utils.uniq_fast(rep3s[0]);
- for(var i = 0; i < rep3s[0].length; i++) {
- if(typeof(rep3s[0][i]) === "string") {
- let cc = utils.countInArray(orig, rep3s[0][i]);
- if(cc > 1) {
- rep3s[0][i] = rep3s[0][i] + " (" + cc + ")";
- }
- }
- }
- orig = JSON.parse(JSON.stringify(rep24s[0]));
- rep24s[0] = utils.uniq_fast(rep24s[0]);
- for(var i = 0; i < rep24s[0].length; i++) {
- if(typeof(rep24s[0][i]) === "string") {
- let cc = utils.countInArray(orig, rep24s[0][i]);
- if(cc > 1) {
- rep24s[0][i] = rep24s[0][i] + " (" + cc + ")";
- }
- }
- }
- orig = JSON.parse(JSON.stringify(rep2s[0]));
- rep2s[0] = utils.uniq_fast(rep2s[0]);
- for(var i = 0; i < rep2s[0].length; i++) {
- if(typeof(rep2s[0][i]) === "string") {
- let cc = utils.countInArray(orig, rep2s[0][i]);
- if(cc > 1) {
- rep2s[0][i] = rep2s[0][i] + " (" + cc + ")";
- }
- }
- }
- orig = JSON.parse(JSON.stringify(others[0]));
- others[0] = utils.uniq_fast(others[0]);
- for(var i = 0; i < others[0].length; i++) {
- if(typeof(others[0][i]) === "string") {
- let cc = utils.countInArray(orig, others[0][i]);
- if(cc > 1) {
- others[0][i] = others[0][i] + " (" + cc + ")";
- }
- }
- }
- let good = ogs[0].length+rep4s[0].length+rep3s[0].length+rep24s[0].length+rep2s[0].length;
- let useless = data.length-good;
- txtw += `Total accounts: ${data.length}\nGood accounts: ${good}\nUseless accounts: ${useless}\n\n`;
- txtp += `Total accounts: ${data.length}\nGood accounts: ${good}\nUseless accounts: ${useless}\n\n`;
- if(ogs[0].length > 0) {
- let pct = ogs[0].length/data.length;
- pct = Number((pct).toFixed(6));
- txtw += "\n-------------------\n <OG_TAGS> (" + ogs[0].length + " // " + pct + "%) \n-------------------"; ogs[0].forEach(function(vl) { txtw += "\n" + vl; }); txtw += "\n-------------------\n </OG_TAGS> \n-------------------";
- txtp += "\n-------------------\n <OG_TAGS> (" + ogs[1].length + " // " + pct + "%) \n-------------------"; ogs[1].forEach(function(vl) { txtp += "\n" + vl; }); txtp += "\n-------------------\n </OG_TAGS> \n-------------------";
- }
- if(rep4s[0].length > 0) {
- let pct = rep4s[0].length/data.length;
- pct = Number((pct).toFixed(6));
- txtw += "\n\n\n-------------------\n <REPEAT_4TIMES> (" + rep4s[0].length + " // " + pct + "%) \n-------------------"; rep4s[0].forEach(function(vl) { txtw += "\n" + vl; }); txtw += "\n-------------------\n </REPEAT_4TIMES> \n-------------------";
- txtp += "\n\n\n-------------------\n <REPEAT_4TIMES> (" + rep4s[1].length + " // " + pct + "%) \n-------------------"; rep4s[1].forEach(function(vl) { txtp += "\n" + vl; }); txtp += "\n-------------------\n </REPEAT_4TIMES> \n-------------------";
- }
- if(rep3s[0].length > 0) {
- let pct = rep3s[0].length/data.length;
- pct = Number((pct).toFixed(6));
- txtw += "\n\n\n-------------------\n <REPEAT_3TIMES> (" + rep3s[0].length + " // " + pct + "%) \n-------------------"; rep3s[0].forEach(function(vl) { txtw += "\n" + vl; }); txtw += "\n-------------------\n </REPEAT_3TIMES> \n-------------------";
- txtp += "\n\n\n-------------------\n <REPEAT_3TIMES> (" + rep3s[1].length + " // " + pct + "%) \n-------------------"; rep3s[1].forEach(function(vl) { txtp += "\n" + vl; }); txtp += "\n-------------------\n </REPEAT_3TIMES> \n-------------------";
- }
- if(rep24s[0].length > 0) {
- let pct = rep24s[0].length/data.length;
- pct = Number((pct).toFixed(6));
- txtw += "\n\n\n-------------------\n <REPEAT_2_2TIMES> (" + rep24s[0].length + " // " + pct + "%) \n-------------------"; rep24s[0].forEach(function(vl) { txtw += "\n" + vl; }); txtw += "\n-------------------\n </REPEAT_2_2TIMES> \n-------------------";
- txtp += "\n\n\n-------------------\n <REPEAT_2_2TIMES> (" + rep24s[1].length + " // " + pct + "%) \n-------------------"; rep24s[1].forEach(function(vl) { txtp += "\n" + vl; }); txtp += "\n-------------------\n </REPEAT_2_2TIMES> \n-------------------";
- }
- if(rep2s[0].length > 0) {
- let pct = rep2s[0].length/data.length;
- pct = Number((pct).toFixed(6));
- txtw += "\n\n\n-------------------\n <REPEAT_2TIMES> (" + rep2s[0].length + " // " + pct + "%) \n-------------------"; rep2s[0].forEach(function(vl) { txtw += "\n" + vl; }); txtw += "\n-------------------\n </REPEAT_2TIMES> \n-------------------";
- txtp += "\n\n\n-------------------\n <REPEAT_2TIMES> (" + rep2s[1].length + " // " + pct + "%) \n-------------------"; rep2s[1].forEach(function(vl) { txtp += "\n" + vl; }); txtp += "\n-------------------\n </REPEAT_2TIMES> \n-------------------";
- }
- if(others[0].length > 0) {
- let pct = others[0].length/data.length;
- pct = Number((pct).toFixed(6));
- txtw += "\n\n\n-------------------\n <TRASH> (" + others[0].length + " // " + pct + "%) \n-------------------"; others[0].forEach(function(vl) { txtw += "\n" + vl; }); txtw += "\n-------------------\n </TRASH> \n-------------------";
- txtp += "\n\n\n-------------------\n <TRASH> (" + others[1].length + ") \n-------------------"; others[1].forEach(function(vl) { txtp += "\n" + vl; }); txtp += "\n-------------------\n </TRASH> \n-------------------";
- }
- if(fs.readFileSync("discrims.txt", "UTF-8") !== txtw) {
- fs.writeFileSync("discrims.txt", txtw);
- //console.log("Saved to file (public)!");
- }
- if(fs.readFileSync("discrims_private.txt", "UTF-8") !== txtp) {
- fs.writeFileSync("discrims_private.txt", txtp);
- //console.log("Saved to file (private)!");
- }
- });
- }
- function CheckUser(proxy, token, password, dtlastname) {
- if(config.farmMode === true) return;
- if(!proxy) { return; }
- if(!token) { return; }
- if(!password) { return; }
- return new Promise(function(fulfill, reject) {
- let opts = JSON.parse(JSON.stringify(reqCheckOptions));
- let agent_r = new HttpsProxyAgent("http://" + proxy);
- opts["agent"] = agent_r;
- opts["headers"]["authorization"] = token;
- request(opts, function(error, response, body) {
- try {
- if(error) { reject(error); return; }
- //console.log(body);
- //console.log(typeof(body));
- if(typeof(body) === "string") {
- body = JSON.parse(body);
- }
- if(typeof(body["code"]) === "undefined") {
- if(typeof(body["username"]) === "string") {
- let doname = false;
- if(typeof(config.discrimForcerUsername) === "string") {
- if(config.discrimForcerUsername !== "" && config.discrimForcerUsername.length > 4) {
- if((body["username"] !== config.discrimForcerUsername && shit_tiers.includes(body["discriminator"]) === true) || (body["username"] !== config.discrimForcerUsername && good_discs.includes(body["discriminator"]) !== true) || (body["username"] === config.discrimForcerUsername && good_discs.includes(body["discriminator"]) === true)) {
- doname = true;
- }
- }
- }
- if(typeof(dtlastname) === "string") {
- let diff = new Date() - new Date(dtlastname);
- if(diff < 24*60*60*1000) { doname = false; }
- }
- if(doname === false) { fulfill(body); } else {
- //console.log("changing name lole. curr = " + body["username"]);
- let curr = body["username"];
- let optsChg = JSON.parse(JSON.stringify(reqChangeUsernameOptions));
- optsChg["agent"] = agent_r;
- optsChg["headers"]["authorization"] = token;
- let nm = config.discrimForcerUsername;
- if(body["username"] === nm) {
- let lenusr = utils.getRandomInt(config.usernamelength, config.usernamemaxlen);
- nm = randomstring.generate(
- {
- length:lenusr,
- charset: 'alphanumeric',
- });
- console.log("new gen : " + nm);
- }
- let json_this = {
- "username": nm,
- "password": password,
- };
- optsChg["json"] = json_this;
- request(optsChg, function(error, response, body2) {
- try {
- if(error) { reject(error); return; }
- //console.log(body2);
- if(typeof(body2) === "string") {
- body2 = JSON.parse(body2);
- }
- if(typeof(body2) === "object") {
- if(typeof(body2["code"]) !== "undefined") {
- if(String(body2["code"]) === "40002") {
- if(typeof(body["discriminator"]) !== "undefined") {
- if(config.discordOGTags.includes(body["discriminator"]) === true) {
- console.log("WARNING : OG TAG '" + body["discriminator"] + "' IS STUCK. GO FIX MANUALLY!");
- process.exit();
- }
- }
- }
- }
- if(typeof(body2["username"]) === "string") {
- if(body2["username"] !== curr) {
- body["username"] = body2["username"];
- }
- if(typeof(body2["discriminator"]) !== "undefined") {
- if(body2["discriminator"] !== body["discriminator"]) {
- body["discriminator"] = body2["discriminator"];
- console.log("updated discrim!");
- }
- }
- }
- }
- fulfill(body);
- } catch(e) { /* console.error(e); */ }
- });
- }
- return;
- }
- }
- } catch(e) { /* console.error(e); */ }
- }).catch(e => { console.error(e); });
- });
- }
- function CheckSolveCaptcha(proxy, id) {
- if(!proxy) return;
- if(!id) return;
- return new Promise(function(fulfill, reject) {
- let optsOut = JSON.parse(JSON.stringify(twocapOutOptions));
- let agent_r = new HttpsProxyAgent("http://" + proxy);
- optsOut["agent"] = agent_r;
- optsOut["url"] = optsOut["url"] + id;
- let intCheckCap = setInterval(function() {
- request(optsOut, function(error, response, body) {
- try {
- body = JSON.parse(body);
- //console.log(body);
- if(error) { clearInterval(intCheckCap); reject(error); return; }
- if(typeof(body["status"]) !== "undefined") {
- if(String(body["status"]) === "1") {
- clearInterval(intCheckCap);
- fulfill(body["request"]);
- return;
- }
- }
- } catch(e) { /* */ }
- });
- }, 10000);
- });
- }
- function SubmitCaptcha(proxy, red) {
- if(!proxy) return;
- if(!red) red = false;
- return new Promise(function(fulfill, reject) {
- let optsIn = JSON.parse(JSON.stringify(twocapInOptions));
- let agent_r = new HttpsProxyAgent("http://" + proxy);
- optsIn["agent"] = agent_r;
- //optsIn["url"] += "&proxy=" + proxy + "&proxytype=HTTPS";
- request(optsIn, function(error, response, body) {
- try {
- if(typeof(body) === "string") {
- body = JSON.parse(body);
- }
- if(error) { reject(error); return; }
- if(typeof(body["status"]) !== "undefined") {
- if(String(body["status"]) === "1") {
- fulfill(body["request"]);
- return;
- } else {
- if(body["request"] === "ERROR_NO_SLOT_AVAILABLE" && red === false) {
- SubmitCaptcha(proxy).then(k => {
- setTimeout(function() {
- fulfill(k, true);
- return;
- }, 5000);
- }).catch(e => {});
- }
- }
- }
- } catch(e) {
- if(red === false) {
- SubmitCaptcha(proxy).then(k => {
- setTimeout(function() {
- fulfill(k, true);
- return;
- }, 10000);
- }).catch(e => {});
- }
- }
- reject(body);
- });
- });
- }
- function SolveACaptcha(proxy) {
- return new Promise(function(fulfill, reject) {
- SubmitCaptcha(proxy).then(id => {
- console.log("doit creator> captcha being solved");
- setTimeout(function() {
- CheckSolveCaptcha(proxy, id).then(key => {
- console.log("doit creator> [SUCCESS] solved a captcha");
- fulfill(key);
- }).catch(e => { console.error(e); reject(e); });
- }, 10000);
- }).catch(e => { console.error(e); });
- });
- }
- function testProxy(proxy, url) {
- if(!proxy) return;
- if(!url) url = "http://www.google.com";
- let agent_r = new HttpsProxyAgent("http://" + proxy);
- return new Promise(function(fulfill) {
- // because Promise.all stops all work once a rejection is thrown...
- function reject(data) {
- fulfill({"error": true, "data": data, "proxy": proxy});
- }
- // To prevent infinite runs.
- setTimeout(function() { reject("script timeout"); return; }, 45000);
- request({
- uri: url,
- method: "GET",
- "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36",
- accept: "*/*",
- agent: agent_r,
- timeout: 35000,
- followRedirect: false,
- }, function(error, response, body) {
- //console.log("Error" + error);
- //console.log("Body: " + body);
- if(!error) { if(response) { if(response.statusCode === 200) { fulfill({ "body": body, "proxy": proxy }); return; } } }
- reject(error);
- return;
- });
- });
- }
- function DoAccount(proxy, json) {
- if(config.farmMode === false) return;
- if(!proxy) return;
- if(!json) return;
- let agent_r = new HttpsProxyAgent("http://" + proxy);
- let opts = JSON.parse(JSON.stringify(reqRegistOptions));
- opts["agent"] = agent_r;
- json["invite"] = config.discordInvite;
- if(typeof(config.discordInvite) === "null") {
- json["invite"] = "null";
- }
- opts["json"] = utils.mysql_real_escape_string(json);
- //console.log(json);
- return new Promise(function(fulfill) {
- // because Promise.all stops all work once a rejection is thrown...
- function reject(data) {
- fulfill({"error": true, "data": data, "proxy": proxy, "json": json});
- }
- // To prevent infinite runs.
- let tm = setTimeout(function() { reject("script timeout"); return; }, 110000);
- request(opts, function(error, response, body) {
- //console.log("Error" + error);
- //console.log(body);
- clearTimeout(tm);
- if(!error && response) { /* console.log(`Resp code: ${response.statusCode}`); */ if(response.statusCode === 201 || response.statusCode === 400) { fulfill({ "body": body, "proxy": proxy, "json": json }); return; } }
- reject(error);
- return;
- });
- });
- }
- function startProcess() {
- console.log(` `);
- console.log(`--------------------------------------------------------------------------`);
- console.log(`doit creator> Welcome to the creator! Creating accounts now!`);
- console.log(`Please give this a few minutes to run, accounts will automatically be made and sent to your database.`);
- console.log(`--------------------------------------------------------------------------`);
- console.log(` `);
- console.log(` `);
- console.log(`Status:`);
- console.log(`doit creator> Enabled discrim farm (${good_discs.length})`);
- //console.log(`doit creator> Loading up ${proxies_loaded.length} proxies!`);
- let promises = new Array();
- let runs = 0;
- for(let i = 0; i < proxies_loaded.length; i++) {
- if(typeof(config.testProxyPct) === "number") { if(runs/config.testProxyPct >= config.maxPerBatch) { continue;} }
- runs++;
- // get proxy object
- const proxy = proxies_loaded[i];
- // test the proxy
- promises.push(testProxy(proxy, "https://www.google.com"));
- }
- console.log(`doit creator> Testing ${runs} loaded proxies!`);
- let donep = Promise.all(promises);
- donep.then(data => {
- for(let i = 0; i < data.length; i++) {
- console.log(`${i}/${data.length}`);
- if(typeof(data) !== "object") continue;
- if(typeof(data[i]) !== "object") continue;
- console.log(data[i]);
- if(typeof(data[i]["error"]) === "boolean" && i !== data.length - 1) { if(typeof(data[i]["error"]) === "boolean") { if(data[i]["error"] === true) { /* console.error(data[i]["data"]); */ continue; }}}
- if(typeof(data[i]["error"]) !== "boolean") { if(typeof(data[i]["proxy"]) === "string") { proxies_tested.push(data[i]["proxy"]); }}
- if(i === data.length - 1) {
- setInterval(function() {
- CheckAllAccounts();
- }, 5* 60 * 1000);
- CheckAllAccounts();
- console.log(`doit creator> [NOTE] Found ${proxies_tested.length} active proxies!`);
- if(proxies_tested.length < 10) {
- console.log('[FAILED] exiting, too few proxies. (try http/s)');
- process.exit();
- }
- setTimeout(function() {
- if(config.maxPerBatch > 0 && config.farmMode === true) {
- CreateAccounts();
- } else if(config.farmMode === false) {
- console.log("farmMode is false, not creating accounts.");
- }
- }, 10000);
- }
- }
- });
- }
- let ranOneTime = false;
- let haltDbSaves = false;
- function CreateAccounts() {
- if(ranOneTime === true) return;
- ranOneTime = true;
- console.log("doit creator> [Success] Creating accounts!");
- let discordPromises = new Array();
- for(let i = 0; i < proxies_tested.length; i++) {
- if (config.forceruser === true){
- var user = config.forceduser
- }
- else if (config.genuser === false){
- let users = config.usernames;
- var user = users[i];
- }
- else{
- let lenusr = utils.getRandomInt(config.usernamelength, config.usernamemaxlen);
- var user = randomstring.generate(
- {
- length:lenusr,
- charset: 'alphanumeric',
- });
- }
- let passlen = utils.getRandomInt(config.passwordlen, config.passwordmaxlen);
- let pass = randomstring.generate(
- {
- length:passlen,
- charset: 'alphanumeric',
- });
- if (config.genemails === false){
- let emails = config.emails;
- var mail = emails[i];
- }
- else{
- let maillen = utils.getRandomInt(config.emaillen, config.emailmaxlen);
- var mail = randomstring.generate(
- {
- length:maillen,
- charset: 'alphanumeric',
- capitalization: "lowercase",
- });
- mail = mail + "@" + config.mails[Math.floor(Math.random() * config.mails.length)];
- }
- console.log(`Username: ${user} | Password: ${pass} | Email: ${mail}`);
- discordPromises.push(DoAccount(proxies_tested[i], {
- "fingerprint": config.fingerprint,
- "email": mail,
- "captcha_key": null,
- "username": user,
- "password": pass,
- }));
- }
- let discord_all = Promise.all(discordPromises);
- discord_all.then(data => {
- haltDbSaves = true;
- for(let i = 0; i < data.length; i++) {
- let val = data[i];
- if(typeof(val["body"]) === "object" && typeof(val["json"]) === "object") {
- let json_new = JSON.parse(JSON.stringify(val["json"]));
- if(typeof(val["body"]["token"]) !== "undefined") {
- haltDbSaves = true;
- //console.log(val["proxy"]);
- console.log("Got an account!");
- //console.log(typeof(val["body"]["token"]));
- json_new["token"] = val["body"]["token"];
- json_new["date_created"] = new Date();
- account_batch.push(json_new);
- haltDbSaves = false;
- } else if(typeof(val["body"]["captcha_key"]) === "object" && utils.isArray(val["body"]["captcha_key"]) === true) {
- let need_cap = false;
- val["body"]["captcha_key"].forEach(function(vl) { if(typeof(vl) === "string") { if(vl === "captcha-required") { need_cap = true; }}});
- if(need_cap === true && config.do2captcha === true) {
- if(account_batch.length >= config.maxPerBatch) continue;
- account_batch.push(json_new["username"]);
- //console.log(val["proxy"]);
- console.log("doit creator> Got proxy, sending captcha to indian");
- // do 2captcha shit
- SolveACaptcha(val["proxy"]).then(key => {
- json_new["captcha_key"] = key;
- function DoAccountFinish() {
- DoAccount(val["proxy"], {
- "fingerprint": config.fingerprint,
- "email": json_new["email"],
- "captcha_key": key,
- "username": json_new["username"],
- "password": json_new["password"],
- }).then(vl2 => {
- if(typeof(vl2["error"]) === "boolean") {
- if(vl2["error"] === true) {
- setTimeout(function() {
- //console.log(vl2);
- console.log("doit creator> Failed login with captcha, retrying.");
- DoAccountFinish();
- }, 15000);
- return;
- }
- }
- let tk = vl2["body"]["token"];
- if(tk === undefined) {
- console.log("doit creator> [FAILED] Token not solved captcha.");
- let stp = false;
- if(typeof(vl2["body"]["captcha_key"]) === "object") {
- if(vl2["body"]["captcha_key"][0] === "incorrect-captcha-sol" || vl2["body"]["captcha_key"][0] === "timeout-or-duplicate" || vl2["body"]["captcha_key"][0] === "response-already-used-error" || vl2["body"]["captcha_key"][0] === "invalid-keys") {
- stp = true;
- }
- }
- if(stp === false) {
- //console.log(vl2["body"]);
- DoAccountFinish();
- }
- return;
- }
- haltDbSaves = true;
- console.log("doit creator> adding to db now " + tk + "");
- json_new["token"] = tk;
- json_new["date_created"] = new Date();
- for(var i = 0; i < account_batch.length; i++) {
- if(typeof(account_batch[i]) === "string") {
- if(account_batch[i] === json_new["username"]) {
- account_batch.splice(i,1);
- }
- }
- }
- account_batch.push(json_new);
- console.log("doit creator> created account!");
- console.log(val['discriminator']);
- haltDbSaves = false;
- });
- }
- DoAccountFinish();
- }).catch(e => { });
- }
- } else {
- //console.log(val["proxy"]);
- //console.log(val["body"]);
- }
- }
- }
- setTimeout(function() { haltDbSaves = false; }, 10000);
- });
- }
- setInterval(function() {
- if(haltDbSaves === true) return;
- if(account_batch.length > 0) {
- let toadd = new Array();
- account_batch.forEach(function(vl) {
- if(typeof(vl["token"]) === "string" && typeof(vl["date_created"]) !== "undefined" && typeof(vl["username"]) === "string" && typeof(vl["password"]) === "string" && typeof(vl["email"]) === "string") {
- toadd.push(vl);
- }
- });
- if(toadd.length > 0) {
- let txtf = "REPLACE INTO " + config.dbConData["table"] + " (id, token, username, password, email, date_created, date_lastchecked, date_changedname, discriminator) VALUES";
- for(let i = 0; i < toadd.length; i++) {
- var vl = toadd[i];
- txtf += "(";
- if(typeof(vl["id"]) === "string") {
- txtf += mysql.escape(vl["id"]) + ",";
- } else { txtf += "NULL,"; }
- txtf += mysql.escape(vl["token"]) + ",";
- txtf += mysql.escape(vl["username"]) + ",";
- txtf += mysql.escape(vl["password"]) + ",";
- txtf += mysql.escape(vl["email"]) + ",";
- txtf += mysql.escape(vl["date_created"]) + ",";
- if(typeof(vl["date_lastchecked"]) === "object") {
- txtf += mysql.escape(String(vl["date_lastchecked"])) + ",";
- } else { txtf += "NULL,"; }
- if(typeof(vl["date_changedname"]) === "string") {
- txtf += mysql.escape(String(vl["date_changedname"])) + ","; } else { txtf += "NULL,"; }
- if(typeof(vl["discriminator"]) === "string") {
- txtf += mysql.escape(vl["discriminator"]);
- } else { txtf += "NULL"; }
- if(i === toadd.length - 1) {
- txtf += ");";
- } else { txtf += "),"; }
- for(let a = 0; a < account_batch.length; a++) {
- if(typeof(account_batch[a]) === "object") { if(typeof(account_batch[a]["token"]) === "string") { if(account_batch[a]["token"] === vl["token"]) {
- account_batch.splice(a,1);
- //console.log("removed from account_batch");
- }}}
- }
- }
- //console.log(txtf);
- utils.RunQuery(txtf).then(() => {
- //console.log("Saved into db!");
- setTimeout(function() {
- SaveGoodDiscrimsToFile();
- }, 5000);
- }).catch(e => { console.error(e); account_batch.push(vl); });
- }
- }
- }, 5000);
- for(var i = 1; i < 10000; i++) {
- let disc2 = String(i);
- if(i < 10) { disc2 = "000" + disc2; } else {
- if(i < 100) { disc2 = "00" + disc2; } else {
- if(i < 1000) { disc2 = "0" + disc2; }}}
- if(good_discs.includes(disc2) === true) continue;
- let disc = disc2.split("");
- let reps = {};
- let rep_4 = false;
- for(var asd = 0; asd < disc.length; asd++) {
- let thisch = disc[asd];
- if(typeof(reps[thisch]) === "number") {
- reps[thisch] ++;
- } else {
- reps[thisch] = 1;
- }
- }
- for(let key in reps) {
- let obj = reps[key];
- if(obj === 4) {
- rep_4 = true;
- }
- }
- if(rep_4 === true) {
- good_discs.push(disc2);
- }
- }
- for(var i = 1; i < 10000; i++) {
- let disc2 = String(i);
- if(i < 10) { disc2 = "000" + disc2; } else {
- if(i < 100) { disc2 = "00" + disc2; } else {
- if(i < 1000) { disc2 = "0" + disc2; }}}
- if(good_discs.includes(disc2) === true) continue;
- let disc = disc2.split("");
- let reps = {};
- let finshrow = false;
- let rowchars = 0;
- var prevch = "";
- for(var asd = 0; asd < disc.length; asd++) {
- let thisch = disc[asd];
- if(finshrow === false) {
- if(thisch === prevch) {
- rowchars++;
- } else {
- if(prevch !== "") {
- finshrow = true;
- //console.log("done " + rowchars);
- } else {
- rowchars = 1;
- }
- }
- }
- prevch = thisch;
- if(typeof(reps[thisch]) === "number") {
- reps[thisch] ++;
- } else {
- reps[thisch] = 1;
- }
- }
- if(rowchars >= 3 ) {
- good_discs.push(disc2);
- if(shit_tiers.includes(disc2) === false) shit_tiers.push(disc2);
- }
- }
- for(var i = 1; i < 10000; i++) {
- let disc2 = String(i);
- if(i < 10) { disc2 = "000" + disc2; } else {
- if(i < 100) { disc2 = "00" + disc2; } else {
- if(i < 1000) { disc2 = "0" + disc2; }}}
- if(good_discs.includes(disc2) === true || good_discs.length > config.accountDiscrimsFreeSlots) continue;
- let disc = disc2.split("");
- let reps = {};
- let rep_3 = false;
- let repeats_2 = 0;
- for(var asd = 0; asd < disc.length; asd++) {
- let thisch = disc[asd];
- if(typeof(reps[thisch]) === "number") {
- reps[thisch] ++;
- } else {
- reps[thisch] = 1;
- }
- }
- for(let key in reps) {
- let obj = reps[key];
- if(obj === 3) {
- rep_3 = true;
- } else if(obj === 2) {
- repeats_2++;
- }
- }
- if(rep_3 === true || repeats_2 === 2) {
- good_discs.push(disc2);
- if(shit_tiers.includes(disc2) === false) shit_tiers.push(disc2);
- }
- }
- utils.connection.on('close', function(err) {
- if (err) {
- // Oops! Unexpected closing of connection, lets reconnect back.
- utils.connection = mysql.createConnection(utils.dbConData);
- } else {
- console.log('Connection closed normally.');
- }
- });
- setTimeout(function() {
- CheckAllAccounts();
- setTimeout(function() {
- SaveGoodDiscrimsToFile();
- }, 5000);
- }, 1);
- startProcess();
- utils.connection.connect();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement