Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Discord.WebSocket;
- using HtmlAgilityPack;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Collections.Specialized;
- using System.Diagnostics;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using static System.Net.Mime.MediaTypeNames;
- namespace PlatincreatorAPI
- {
- public class JSonToSendtoCreateAccs
- {
- public string fingerprint { get; set; }
- public string email { get; set; }
- public string username { get; set; }
- public string password { get; set; }
- public object invite { get; set; }
- public bool consent { get; set; }
- public string captcha_key { get; set; }
- }
- public class FingerPRINT
- {
- public long[][] assignments { get; set; }
- public string fingerprint { get; set; }
- }
- public class TwoCaptcha
- {
- #region Consts
- public const string IN_URL = "http://2captcha.com/in.php";
- public const string RES_URL = "http://2captcha.com/res.php";
- #endregion
- #region Public Fields
- /// <summary>
- /// Site key from recaptcha for the site
- /// </summary>
- public string SiteKey;
- /// <summary>
- /// 2captcha API key
- /// </summary>
- public string APIKey;
- /// <summary>
- /// Site URL or domain to send to 2captcha
- /// </summary>
- public string SiteURL;
- /// <summary>
- /// Max amount of poll tries before it is marked as not solved
- /// </summary>
- public int MaxPollTries = 15;
- /// <summary>
- /// Max submit tries before it returns null
- /// </summary>
- public int MaxSubmitTries = 15;
- #endregion
- #region Properties
- /// <summary>
- /// The proxy sent to 2captcha when requesting a captcha to be solved
- /// </summary>
- public WebProxy AccessProxy
- {
- get;
- set;
- }
- #endregion
- #region Constructors
- /// <summary>
- /// Creates a new instance of the 2captcha api without setting a proxy
- /// </summary>
- /// <param name="siteKey">ReCaptcha Site Key</param>
- /// <param name="siteUrl">Url from the site for the site key</param>
- public TwoCaptcha(string apiKey, string siteKey, string siteUrl)
- : this(apiKey, siteKey, siteUrl, null)
- {
- }
- /// <summary>
- /// Creates a new instance of the 2captcha api
- /// </summary>
- /// <param name="apiKey">2captcha API Key</param>
- /// <param name="siteKey">ReCaptcha Site Key</param>
- /// <param name="siteUrl">Url from the site for the site key</param>
- /// <param name="accessProxy">Proxy to send to 2captcha for external use</param>
- public TwoCaptcha(string apiKey, string siteKey, string siteUrl, WebProxy accessProxy)
- {
- SiteKey = siteKey;
- SiteURL = siteUrl;
- APIKey = apiKey;
- AccessProxy = accessProxy;
- }
- #endregion
- #region Public Members
- /// <summary>
- /// Solve a new Google NoCaptcha for the provided site using the provided proxy.
- /// </summary>
- /// <returns>CaptchaResult containing the token required</returns>
- public CaptchaResult SolveCaptcha()
- {
- CaptchaResult captchaId = GetCaptchaID();
- if (captchaId == null)
- return null;
- // Kill me, yeah, I know, wow, thread.sleep in 2016
- Thread.Sleep(5000);
- return PollCaptchaID(captchaId);
- }
- #endregion
- #region Private Members
- private CaptchaResult PollCaptchaID(CaptchaResult captchaId)
- {
- int attemptsMax = MaxPollTries;
- while ((attemptsMax--) > 0)
- {
- try
- {
- using (WebClient wc = new WebClient())
- {
- string resp = wc.DownloadString(string.Format("{0}?key={1}&action=get&id={2}", RES_URL, APIKey, captchaId.ID));
- if (resp.Contains("OK|"))
- {
- captchaId.HasSolved = true;
- captchaId.Response = resp.Split('|')[1];
- return captchaId;
- }
- // apparently will only be sent after 90 seconds is up
- else if (resp == "ERROR_CAPTCHA_UNSOLVABLE")
- {
- return captchaId;
- }
- }
- }
- catch (Exception ex)
- {
- #if DEBUG
- Console.WriteLine("PollCaptchaID {0}: {1}", attemptsMax, ex);
- #endif
- }
- // Change to what you like, 2captcha are pretty slow, so expect some heavy waiting
- Thread.Sleep(5000);
- }
- return captchaId;
- }
- private CaptchaResult GetCaptchaID()
- {
- NameValueCollection nvc = new NameValueCollection();
- string formattedProxy = string.Format("{0}:{1}", AccessProxy.Address.DnsSafeHost, AccessProxy.Address.Port);
- nvc.Add("key", APIKey);
- nvc.Add("method", "userrecaptcha");
- nvc.Add("googlekey", SiteKey);
- nvc.Add("proxy", formattedProxy);
- nvc.Add("proxytype", "http");
- nvc.Add("pageurl", SiteURL);
- int attemptsMax = MaxSubmitTries;
- // Guess what, you're mad and I'm not
- // People prefer a while loop over goto's these days, idk why
- // They're all the same in the end
- while ((attemptsMax--) > 0)
- {
- try
- {
- using (WebClient wc = new WebClient())
- {
- string resp = Encoding.UTF8.GetString(wc.UploadValues(string.Format("{0}", IN_URL), nvc));
- if (resp.StartsWith("OK|"))
- {
- return new CaptchaResult(null, resp.Split('|')[1], APIKey);
- }
- else
- {
- return null;
- }
- }
- }
- catch (Exception ex)
- {
- #if DEBUG
- Console.WriteLine("GetCaptchaID: {0}", ex);
- #endif
- }
- Thread.Sleep(1500);
- }
- return null;
- }
- #endregion
- }
- public class Login
- {
- public string email { get; set; }
- public string password { get; set; }
- }
- public class PlatinCreatorAPI
- {
- public bool FirstTimeSetup()
- {
- if (!File.Exists("config.txt"))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- public Dictionary<string, string> Logins = new Dictionary<string, string>();
- public string GetFingerPrint()
- {
- string response = new HttpClient().GetAsync("https://discordapp.com/api/v6/experiments").Result.Content.ReadAsStringAsync().Result;
- FingerPRINT lol = JsonConvert.DeserializeObject<FingerPRINT>(response.ToString());
- return lol.fingerprint;
- }
- public string _2Captcha { get; set; }
- public string Username { get; set; }
- public string InvCode { get; set; }
- public bool AutoEmailVerify { get; set; }
- public bool AutoPhoneVerify { get; set; }
- private static Random random = new Random();
- public static string RandomString(int length)
- {
- const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
- return new string(Enumerable.Repeat(chars, length)
- .Select(s => s[random.Next(s.Length)]).ToArray());
- }
- public class LoginShit
- {
- public string email { get; set; }
- public string password { get; set; }
- }
- public class TokenResponse
- {
- public string token { get; set; }
- }
- public class GetDisCRIMINATOR
- {
- public string username { get; set; }
- public bool verified { get; set; }
- public string locale { get; set; }
- public bool mfa_enabled { get; set; }
- public string id { get; set; }
- public object phone { get; set; }
- public int flags { get; set; }
- public string avatar { get; set; }
- public string discriminator { get; set; }
- public string email { get; set; }
- }
- public class Rootobject
- {
- public string username { get; set; }
- public string email { get; set; }
- public string password { get; set; }
- public string avatar { get; set; }
- public object discriminator { get; set; }
- public object new_password { get; set; }
- }
- static string ToBase64(string file)
- {
- return Convert.ToBase64String(File.ReadAllBytes(file));
- }
- private static string RandomImage(string dir)
- {
- Random random = new Random();
- string[] files = Directory.GetFiles(dir);
- return files[random.Next(files.Length)];
- }
- public class PFPChangorinoo
- {
- public string avatar { get; set; }
- }
- static string getCaptchaToken(string proxyURl)
- {
- HttpClient client = new HttpClient();
- client.DefaultRequestHeaders.Clear();
- var response = client.GetAsync("https://www.google.com/recaptcha/api2/anchor?ar=1&k=6Lef5iQTAAAAAKeIvIY-DeexoO3gj7ryl9rLMEnn&co=aHR0cHM6Ly9kaXNjb3JkYXBwLmNvbTo0NDM.&hl=en&v=v1540189908068&theme=dark&size=normal&cb=dnd7qlxnt44j");
- String s = response.Result.Content.ReadAsStringAsync().Result;
- HtmlDocument document2 = new HtmlDocument();
- document2.LoadHtml(s);
- var valuecaptchatoken = document2.GetElementbyId("recaptcha-token");
- return valuecaptchatoken.GetAttributeValue("value", null);
- }
- public async void HandleResponse(HttpResponseMessage response, string proxyUrlRequired, HttpClient cl, string email, string password, string inviteCode, WebProxy proxy, TwoCaptcha solvex)
- {
- new Thread(() =>
- {
- try
- {
- if (response.StatusCode == HttpStatusCode.OK || response.StatusCode == (HttpStatusCode)204)
- {
- var responselol = cl.PostAsync("https://discordapp.com/api/auth/login", new StringContent(JsonConvert.SerializeObject(new Login { email = email, password = password }), Encoding.UTF8, "application/json"));
- TokenResponse resp = JsonConvert.DeserializeObject<TokenResponse>(responselol.Result.Content.ReadAsStringAsync().Result);
- cl.DefaultRequestHeaders.Add("Authorization", resp.token);
- var responsexdxx = cl.GetAsync("https://discordapp.com/api/v6/users/@me");
- GetDisCRIMINATOR discrimxx = JsonConvert.DeserializeObject<GetDisCRIMINATOR>(responsexdxx.Result.Content.ReadAsStringAsync().Result);
- File.AppendAllText("Results.txt", $"{email}:{password}:{discrimxx.discriminator}" + Environment.NewLine);
- File.AppendAllText("OutputTokens.txt", resp.token + "\n");
- Console.WriteLine($"Trying to register an account, {Username}:{password} on proxyURL: {proxyUrlRequired}");
- }
- else
- {
- if (response.Content.ReadAsStringAsync().Result.ToLower().Contains("captcha-required"))
- {
- System.Console.WriteLine($"Registered an account, {email}:{password}");
- var responselolxx = cl.PostAsync("https://discordapp.com/api/auth/login", new StringContent(JsonConvert.SerializeObject(new LoginShit { email = email, password = password }), Encoding.UTF8, "application/json"));
- TokenResponse respxx = JsonConvert.DeserializeObject<TokenResponse>(responselolxx.Result.Content.ReadAsStringAsync().Result);
- var responsexdxx = cl.GetAsync("https://discordapp.com/api/v6/users/@me");
- GetDisCRIMINATOR discrimxx = JsonConvert.DeserializeObject<GetDisCRIMINATOR>(responsexdxx.Result.Content.ReadAsStringAsync().Result);
- File.AppendAllText("Results.txt", $"{email}:{password}:{discrimxx.discriminator}" + Environment.NewLine);
- File.AppendAllText("OutputTokens.txt", respxx.token + "\n");
- Console.WriteLine($"Trying to register an account, {Username}:{password} on proxyURL: {proxyUrlRequired}");
- }
- else
- {
- if (response.Content.ReadAsStringAsync().Result.ToLower().Contains("captcha-required"))
- {
- /*
- solvex.AccessProxy = proxy;
- Console.WriteLine("Captcha detected, let's attempt to solve! YEAh!1111");
- var x = solvex.SolveCaptcha();
- Console.WriteLine("g-recaptcha-response-token: " + x.Response.ToString());
- var responsex = cl.PostAsync("https://discordapp.com/api/v6/auth/register", new StringContent(JsonConvert.SerializeObject(new JSonToSendtoCreateAccs { fingerprint = GetFingerPrint(), consent = true, captcha_key = x.Response.ToString(), email = email, invite = inviteCode, password = password, username = Username }), Encoding.UTF8, "application/json"));
- System.Console.WriteLine($"Registered an account, check R!");
- */
- var responselolxx = cl.PostAsync("https://discordapp.com/api/auth/login", new StringContent(JsonConvert.SerializeObject(new LoginShit { email = email, password = password }), Encoding.UTF8, "application/json"));
- var responsexdxx = cl.GetAsync("https://discordapp.com/api/v6/users/@me");
- TokenResponse respxx = JsonConvert.DeserializeObject<TokenResponse>(responselolxx.Result.Content.ReadAsStringAsync().Result);
- cl.DefaultRequestHeaders.Add("Authorization", respxx.token);
- GetDisCRIMINATOR discrimxx = JsonConvert.DeserializeObject<GetDisCRIMINATOR>(responsexdxx.Result.Content.ReadAsStringAsync().Result);
- File.AppendAllText("Results.txt", $"{email}:{password}:{discrimxx.discriminator}" + Environment.NewLine);
- File.AppendAllText("OutputTokens.txt", respxx.token + "\n");
- Console.WriteLine($"Trying to register an account, {Username}:{password} on proxyURL: {proxyUrlRequired}");
- }
- else
- {
- if (response.Content.ReadAsStringAsync().Result.ToLower().Contains("limited"))
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.ForegroundColor = ConsoleColor.White;
- }
- else
- {
- if (response.Content.ReadAsStringAsync().Result.ToLower().Contains("registered"))
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.ForegroundColor = ConsoleColor.White;
- }
- else
- {
- var responselolx = cl.PostAsync("https://discordapp.com/api/auth/login", new StringContent(JsonConvert.SerializeObject(new Login { email = email, password = password }), Encoding.UTF8, "application/json"));
- TokenResponse respx = JsonConvert.DeserializeObject<TokenResponse>(responselolx.Result.Content.ReadAsStringAsync().Result);
- cl.DefaultRequestHeaders.Add("Authorization", respx.token);
- var responsexdxx = cl.GetAsync("https://discordapp.com/api/v6/users/@me");
- GetDisCRIMINATOR discrimxx = JsonConvert.DeserializeObject<GetDisCRIMINATOR>(responsexdxx.Result.Content.ReadAsStringAsync().Result);
- File.AppendAllText("Results.txt", $"{email}:{password}:{discrimxx.discriminator}" + Environment.NewLine);
- File.AppendAllText("OutputTokens.txt", respx.token + "\n");
- Console.WriteLine($"Trying to register an account, {Username}:{password} on proxyURL: {proxyUrlRequired}");
- }
- }
- }
- }
- }
- }
- catch (Exception e)
- {
- }
- }).Start();
- }
- public void CreateAccount(string username, string email, string password, string inviteCode, string proxyURLRequired)
- {
- new Thread(() =>
- {
- HttpClient cl = null;
- WebProxy proxy = null;
- HttpClientHandler handler = null;
- try
- {
- proxy = new WebProxy(proxyURLRequired, false)
- {
- UseDefaultCredentials = true
- };
- handler = new HttpClientHandler
- {
- Proxy = proxy,
- PreAuthenticate = true,
- UseDefaultCredentials = true
- };
- }
- catch (Exception e)
- {
- }
- HttpResponseMessage response = new HttpResponseMessage();
- try
- {
- string captchakey = getCaptchaToken(proxyURLRequired);
- cl = new HttpClient(handler);
- cl.DefaultRequestHeaders.Clear();
- cl.DefaultRequestHeaders.Add("X-Fingerprint", GetFingerPrint());
- response = cl.PostAsync("https://discordapp.com/api/v6/auth/register", new StringContent(JsonConvert.SerializeObject(new JSonToSendtoCreateAccs { fingerprint = GetFingerPrint(), consent = true, captcha_key = captchakey, email = email, invite = inviteCode, password = password, username = username }), Encoding.UTF8, "application/json")).Result;
- Logins.Add(email, password);
- TwoCaptcha solvex = new TwoCaptcha(this._2Captcha, "6Lef5iQTAAAAAKeIvIY-DeexoO3gj7ryl9rLMEnn", "https://discordapp.com/api/v6/auth/register");
- HandleResponse(response, proxyURLRequired, cl, email, password, inviteCode, proxy, solvex);
- Console.WriteLine($"Trying to register an account, {Username}:{password} on proxyURL: {proxyURLRequired}");
- }
- catch (Exception e)
- {
- }
- }).Start();
- }
- public string RandomStringx(int Length)
- {
- List<char> Characters = new List<char>()
- {
- 'a',
- 'b',
- 'c',
- 'd',
- 'e',
- 'f',
- 'g',
- 'h',
- 'i',
- 'j',
- 'k',
- 'l',
- 'm',
- 'n',
- 'o',
- 'p',
- 'q',
- 'r',
- 's',
- 't',
- 'u',
- 'v',
- 'x',
- 'y',
- 'z'
- };
- string FinalWord = null;
- for (int i = 0; i < Length; i++)
- {
- if (new Random().Next(1, 100) >= 50)
- {
- FinalWord += char.ToUpper(Characters[new Random().Next(1, Characters.Count())]);
- }
- else
- {
- FinalWord += char.ToLower(Characters[new Random().Next(1, Characters.Count())]);
- }
- }
- return FinalWord;
- }
- public PlatinCreatorAPI()
- {
- if (FirstTimeSetup())
- {
- Console.Title = "PlatinCreator 2.0; First time setup. by Tada / Yaekith.";
- Console.ForegroundColor = ConsoleColor.Green;
- Console.WriteLine("Attempting to generate a configuration file..\n2CaptchaKey? ");
- string captchakey = Console.ReadLine();
- Console.WriteLine("Account Usernames(Do x-1 if you're doing unique random names)? ");
- string Username = Console.ReadLine();
- Console.WriteLine("Invite Code? (InviteCodeONLY AFTER DISCORD.GG/, leave blank if none)");
- string InveCode = Console.ReadLine();
- List<string> ToWrite = new List<string>()
- {
- captchakey,
- Username
- };
- if (InveCode.ToLower() != null || InveCode.ToLower() != "")
- {
- ToWrite.Add(InveCode);
- }
- File.Create("config.txt").Close();
- File.Create("proxies.txt").Close();
- File.WriteAllLines("config.txt", ToWrite.ToArray());
- File.WriteAllText("proxies.txt", new WebClient().DownloadString("https://proxyscrape.com/proxies/HTTP_Working_Proxies.txt"));
- Console.WriteLine("Thank you for your co-operation. Re launch.");
- Console.ReadLine();
- }
- else
- {
- string[] lines = File.ReadAllLines("config.txt");
- this._2Captcha = lines[0];
- this.Username = lines[1];
- if (lines[2] != null || lines[2] != "" || lines[2] != " ")
- {
- this.InvCode = lines[2];
- }
- File.WriteAllText("proxies.txt", new WebClient().DownloadString("https://proxyscrape.com/proxies/HTTP_Working_Proxies.txt"));
- Console.Title = "Platincreator 2.0; Generating accounts. by Tada / Yaekith";
- Console.ForegroundColor = ConsoleColor.Green;
- Console.WriteLine("Sit back, relax and enjoy the show.");
- if (this.Username.ToLower() == "x-1")
- {
- Parallel.Invoke(() =>
- {
- new Thread(() =>
- {
- for (; ; )
- {
- try
- {
- string usernamxe = RandomString(15);
- this.Username = usernamxe;
- string email = $"{RandomString(20)}@gmail.com";
- string password = RandomString(20);
- new Thread(() => CreateAccount(usernamxe, email, password, this.InvCode, File.ReadAllLines("proxies.txt")[new Random().Next(1, File.ReadAllLines("proxies.txt").Count())])).Start();
- }
- catch (Exception e)
- {
- }
- }
- }).Start();
- });
- }
- else
- {
- Parallel.Invoke(() =>
- {
- new Thread(() =>
- {
- for (; ; )
- {
- try
- {
- string email = $"{RandomString(20)}@gmail.com";
- string password = RandomString(20);
- new Thread(() => CreateAccount(File.ReadAllLines("config.txt")[1], email, password, this.InvCode, File.ReadAllLines("proxies.txt")[new Random().Next(1, File.ReadAllLines("proxies.txt").Count())])).Start();
- }
- catch (Exception e)
- {
- }
- }
- }
- });
- }
- }
- }
- private class PFPChange
- {
- public string avatar { get; set; }
- }
- }
- }
Add Comment
Please, Sign In to add comment