Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const request = require('request');
- const fs = require('fs');
- const timer = 1000;
- const domains = [
- 'http://elsia.us/pages/Nostale/FR//register/',
- 'http://185.13.36.13/FR//register/'
- ];
- const default_options = {
- method: 'GET',
- url: null,
- qs: {
- tac: 'tac',
- kid: '',
- username: null,
- password: null,
- email: null
- }
- };
- domains.forEach((domain) => setInterval(() => regRequest(domain), timer));
- function randomMinMax(min, max) {
- return Math.floor(Math.random() * (max - min + 1) + min);
- }
- function randomString(min_char = 0, max_char) {
- let text = '';
- const possible = 'abcdefghijklmnopqrstuvwxyz';
- const count = max_char ? randomMinMax(min_char, max_char) : min_char;
- for (let i = 0; i < count; ++i)
- text += possible.charAt(Math.floor(Math.random() * possible.length));
- return text;
- }
- function genRandomMail(username) {
- return `${username || randomString(6, 12)}@` +
- `${randomString(6, 12)}.${randomString(2, 3)}`;
- }
- let accounts = [];
- let counter = 1;
- function addAccount(account) {
- if (accounts.length > 500) {
- fs.readdir("./accounts", (err, files) => {
- const fileName = `${Number(files[files.length - 1]) + 1}`;
- fs.writeFile(`./accounts/${fileName}`, JSON.stringify(accounts), (err) => {
- if (!err) {
- accounts = [];
- return;
- }
- });
- });
- }
- accounts.push(account);
- }
- function regRequest(url) {
- const username = randomString(6, 12);
- const password = randomString(6, 12);
- const email = genRandomMail(username);
- /* Setup options */
- default_options.url = url;
- default_options.qs.username = username;
- default_options.qs.password = password;
- default_options.qs.email = email;
- /* Make the request (would be better with Async/Await but flemme) */
- request(default_options, (err, response, body) => {
- if (err || response.statusCode !== 200 || !body || !body.includes('reg=success')) {
- const error = err || response.statusMessage || 'Unknown error';
- return console.error(`Could not create account (${url}): ${error}`);
- }
- console.log(`[${++counter}]\t${username}:${password}:${email}`);
- addAccount({
- url: url,
- username: username,
- password: password,
- email: email
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement