Guest User

Untitled

a guest
Nov 29th, 2018
1,151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.01 KB | None | 0 0
  1. using Discord.WebSocket;
  2. using HtmlAgilityPack;
  3. using Newtonsoft.Json;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Collections.Specialized;
  7. using System.Diagnostics;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Net;
  11. using System.Net.Http;
  12. using System.Text;
  13. using System.Threading;
  14. using System.Threading.Tasks;
  15. using static System.Net.Mime.MediaTypeNames;
  16.  
  17. namespace PlatincreatorAPI
  18. {
  19.  
  20. public class JSonToSendtoCreateAccs
  21. {
  22. public string fingerprint { get; set; }
  23. public string email { get; set; }
  24. public string username { get; set; }
  25. public string password { get; set; }
  26. public object invite { get; set; }
  27. public bool consent { get; set; }
  28. public string captcha_key { get; set; }
  29. }
  30. public class FingerPRINT
  31. {
  32. public long[][] assignments { get; set; }
  33. public string fingerprint { get; set; }
  34. }
  35.  
  36. public class TwoCaptcha
  37. {
  38. #region Consts
  39. public const string IN_URL = "http://2captcha.com/in.php";
  40. public const string RES_URL = "http://2captcha.com/res.php";
  41. #endregion
  42.  
  43. #region Public Fields
  44. /// <summary>
  45. /// Site key from recaptcha for the site
  46. /// </summary>
  47. public string SiteKey;
  48. /// <summary>
  49. /// 2captcha API key
  50. /// </summary>
  51. public string APIKey;
  52. /// <summary>
  53. /// Site URL or domain to send to 2captcha
  54. /// </summary>
  55. public string SiteURL;
  56. /// <summary>
  57. /// Max amount of poll tries before it is marked as not solved
  58. /// </summary>
  59. public int MaxPollTries = 15;
  60. /// <summary>
  61. /// Max submit tries before it returns null
  62. /// </summary>
  63. public int MaxSubmitTries = 15;
  64. #endregion
  65.  
  66. #region Properties
  67. /// <summary>
  68. /// The proxy sent to 2captcha when requesting a captcha to be solved
  69. /// </summary>
  70. public WebProxy AccessProxy
  71. {
  72. get;
  73. set;
  74. }
  75. #endregion
  76.  
  77. #region Constructors
  78. /// <summary>
  79. /// Creates a new instance of the 2captcha api without setting a proxy
  80. /// </summary>
  81. /// <param name="siteKey">ReCaptcha Site Key</param>
  82. /// <param name="siteUrl">Url from the site for the site key</param>
  83. public TwoCaptcha(string apiKey, string siteKey, string siteUrl)
  84. : this(apiKey, siteKey, siteUrl, null)
  85. {
  86. }
  87.  
  88. /// <summary>
  89. /// Creates a new instance of the 2captcha api
  90. /// </summary>
  91. /// <param name="apiKey">2captcha API Key</param>
  92. /// <param name="siteKey">ReCaptcha Site Key</param>
  93. /// <param name="siteUrl">Url from the site for the site key</param>
  94. /// <param name="accessProxy">Proxy to send to 2captcha for external use</param>
  95. public TwoCaptcha(string apiKey, string siteKey, string siteUrl, WebProxy accessProxy)
  96. {
  97. SiteKey = siteKey;
  98. SiteURL = siteUrl;
  99.  
  100. APIKey = apiKey;
  101. AccessProxy = accessProxy;
  102. }
  103. #endregion
  104.  
  105. #region Public Members
  106. /// <summary>
  107. /// Solve a new Google NoCaptcha for the provided site using the provided proxy.
  108. /// </summary>
  109. /// <returns>CaptchaResult containing the token required</returns>
  110. public CaptchaResult SolveCaptcha()
  111. {
  112. CaptchaResult captchaId = GetCaptchaID();
  113.  
  114. if (captchaId == null)
  115. return null;
  116.  
  117. // Kill me, yeah, I know, wow, thread.sleep in 2016
  118. Thread.Sleep(5000);
  119.  
  120. return PollCaptchaID(captchaId);
  121. }
  122. #endregion
  123.  
  124. #region Private Members
  125. private CaptchaResult PollCaptchaID(CaptchaResult captchaId)
  126. {
  127. int attemptsMax = MaxPollTries;
  128. while ((attemptsMax--) > 0)
  129. {
  130. try
  131. {
  132. using (WebClient wc = new WebClient())
  133. {
  134. string resp = wc.DownloadString(string.Format("{0}?key={1}&action=get&id={2}", RES_URL, APIKey, captchaId.ID));
  135. if (resp.Contains("OK|"))
  136. {
  137. captchaId.HasSolved = true;
  138. captchaId.Response = resp.Split('|')[1];
  139. return captchaId;
  140. }
  141. // apparently will only be sent after 90 seconds is up
  142. else if (resp == "ERROR_CAPTCHA_UNSOLVABLE")
  143. {
  144. return captchaId;
  145. }
  146. }
  147. }
  148. catch (Exception ex)
  149. {
  150. #if DEBUG
  151. Console.WriteLine("PollCaptchaID {0}: {1}", attemptsMax, ex);
  152. #endif
  153. }
  154.  
  155. // Change to what you like, 2captcha are pretty slow, so expect some heavy waiting
  156. Thread.Sleep(5000);
  157. }
  158. return captchaId;
  159. }
  160.  
  161. private CaptchaResult GetCaptchaID()
  162. {
  163. NameValueCollection nvc = new NameValueCollection();
  164.  
  165.  
  166. string formattedProxy = string.Format("{0}:{1}", AccessProxy.Address.DnsSafeHost, AccessProxy.Address.Port);
  167.  
  168. nvc.Add("key", APIKey);
  169. nvc.Add("method", "userrecaptcha");
  170. nvc.Add("googlekey", SiteKey);
  171. nvc.Add("proxy", formattedProxy);
  172. nvc.Add("proxytype", "http");
  173. nvc.Add("pageurl", SiteURL);
  174.  
  175. int attemptsMax = MaxSubmitTries;
  176.  
  177. // Guess what, you're mad and I'm not
  178. // People prefer a while loop over goto's these days, idk why
  179. // They're all the same in the end
  180. while ((attemptsMax--) > 0)
  181. {
  182. try
  183. {
  184. using (WebClient wc = new WebClient())
  185. {
  186. string resp = Encoding.UTF8.GetString(wc.UploadValues(string.Format("{0}", IN_URL), nvc));
  187.  
  188. if (resp.StartsWith("OK|"))
  189. {
  190. return new CaptchaResult(null, resp.Split('|')[1], APIKey);
  191. }
  192. else
  193. {
  194. return null;
  195. }
  196. }
  197. }
  198. catch (Exception ex)
  199. {
  200. #if DEBUG
  201. Console.WriteLine("GetCaptchaID: {0}", ex);
  202. #endif
  203. }
  204. Thread.Sleep(1500);
  205. }
  206. return null;
  207. }
  208. #endregion
  209. }
  210.  
  211. public class Login
  212. {
  213. public string email { get; set; }
  214. public string password { get; set; }
  215. }
  216. public class PlatinCreatorAPI
  217. {
  218. public bool FirstTimeSetup()
  219. {
  220. if (!File.Exists("config.txt"))
  221. {
  222. return true;
  223. }
  224. else
  225. {
  226. return false;
  227. }
  228. }
  229. public Dictionary<string, string> Logins = new Dictionary<string, string>();
  230. public string GetFingerPrint()
  231. {
  232. string response = new HttpClient().GetAsync("https://discordapp.com/api/v6/experiments").Result.Content.ReadAsStringAsync().Result;
  233.  
  234. FingerPRINT lol = JsonConvert.DeserializeObject<FingerPRINT>(response.ToString());
  235.  
  236. return lol.fingerprint;
  237.  
  238. }
  239. public string _2Captcha { get; set; }
  240. public string Username { get; set; }
  241. public string InvCode { get; set; }
  242. public bool AutoEmailVerify { get; set; }
  243. public bool AutoPhoneVerify { get; set; }
  244. private static Random random = new Random();
  245. public static string RandomString(int length)
  246. {
  247. const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  248. return new string(Enumerable.Repeat(chars, length)
  249. .Select(s => s[random.Next(s.Length)]).ToArray());
  250. }
  251. public class LoginShit
  252. {
  253. public string email { get; set; }
  254. public string password { get; set; }
  255. }
  256.  
  257. public class TokenResponse
  258. {
  259. public string token { get; set; }
  260. }
  261.  
  262. public class GetDisCRIMINATOR
  263. {
  264. public string username { get; set; }
  265. public bool verified { get; set; }
  266. public string locale { get; set; }
  267. public bool mfa_enabled { get; set; }
  268. public string id { get; set; }
  269. public object phone { get; set; }
  270. public int flags { get; set; }
  271. public string avatar { get; set; }
  272. public string discriminator { get; set; }
  273. public string email { get; set; }
  274. }
  275.  
  276. public class Rootobject
  277. {
  278. public string username { get; set; }
  279. public string email { get; set; }
  280. public string password { get; set; }
  281. public string avatar { get; set; }
  282. public object discriminator { get; set; }
  283. public object new_password { get; set; }
  284. }
  285. static string ToBase64(string file)
  286. {
  287. return Convert.ToBase64String(File.ReadAllBytes(file));
  288. }
  289. private static string RandomImage(string dir)
  290. {
  291. Random random = new Random();
  292. string[] files = Directory.GetFiles(dir);
  293. return files[random.Next(files.Length)];
  294. }
  295. public class PFPChangorinoo
  296. {
  297. public string avatar { get; set; }
  298. }
  299. static string getCaptchaToken(string proxyURl)
  300. {
  301.  
  302. HttpClient client = new HttpClient();
  303. client.DefaultRequestHeaders.Clear();
  304. 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");
  305.  
  306. String s = response.Result.Content.ReadAsStringAsync().Result;
  307.  
  308. HtmlDocument document2 = new HtmlDocument();
  309. document2.LoadHtml(s);
  310. var valuecaptchatoken = document2.GetElementbyId("recaptcha-token");
  311. return valuecaptchatoken.GetAttributeValue("value", null);
  312. }
  313. public async void HandleResponse(HttpResponseMessage response, string proxyUrlRequired, HttpClient cl, string email, string password, string inviteCode, WebProxy proxy, TwoCaptcha solvex)
  314. {
  315. new Thread(() =>
  316. {
  317. try
  318. {
  319.  
  320. if (response.StatusCode == HttpStatusCode.OK || response.StatusCode == (HttpStatusCode)204)
  321. {
  322. var responselol = cl.PostAsync("https://discordapp.com/api/auth/login", new StringContent(JsonConvert.SerializeObject(new Login { email = email, password = password }), Encoding.UTF8, "application/json"));
  323.  
  324. TokenResponse resp = JsonConvert.DeserializeObject<TokenResponse>(responselol.Result.Content.ReadAsStringAsync().Result);
  325. cl.DefaultRequestHeaders.Add("Authorization", resp.token);
  326. var responsexdxx = cl.GetAsync("https://discordapp.com/api/v6/users/@me");
  327. GetDisCRIMINATOR discrimxx = JsonConvert.DeserializeObject<GetDisCRIMINATOR>(responsexdxx.Result.Content.ReadAsStringAsync().Result);
  328. File.AppendAllText("Results.txt", $"{email}:{password}:{discrimxx.discriminator}" + Environment.NewLine);
  329. File.AppendAllText("OutputTokens.txt", resp.token + "\n");
  330. Console.WriteLine($"Trying to register an account, {Username}:{password} on proxyURL: {proxyUrlRequired}");
  331.  
  332. }
  333. else
  334. {
  335.  
  336. if (response.Content.ReadAsStringAsync().Result.ToLower().Contains("captcha-required"))
  337. {
  338.  
  339.  
  340. System.Console.WriteLine($"Registered an account, {email}:{password}");
  341.  
  342. var responselolxx = cl.PostAsync("https://discordapp.com/api/auth/login", new StringContent(JsonConvert.SerializeObject(new LoginShit { email = email, password = password }), Encoding.UTF8, "application/json"));
  343.  
  344.  
  345. TokenResponse respxx = JsonConvert.DeserializeObject<TokenResponse>(responselolxx.Result.Content.ReadAsStringAsync().Result);
  346. var responsexdxx = cl.GetAsync("https://discordapp.com/api/v6/users/@me");
  347. GetDisCRIMINATOR discrimxx = JsonConvert.DeserializeObject<GetDisCRIMINATOR>(responsexdxx.Result.Content.ReadAsStringAsync().Result);
  348. File.AppendAllText("Results.txt", $"{email}:{password}:{discrimxx.discriminator}" + Environment.NewLine);
  349. File.AppendAllText("OutputTokens.txt", respxx.token + "\n");
  350. Console.WriteLine($"Trying to register an account, {Username}:{password} on proxyURL: {proxyUrlRequired}");
  351. }
  352. else
  353. {
  354. if (response.Content.ReadAsStringAsync().Result.ToLower().Contains("captcha-required"))
  355. {
  356. /*
  357. solvex.AccessProxy = proxy;
  358. Console.WriteLine("Captcha detected, let's attempt to solve! YEAh!1111");
  359. var x = solvex.SolveCaptcha();
  360.  
  361. Console.WriteLine("g-recaptcha-response-token: " + x.Response.ToString());
  362.  
  363. 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"));
  364.  
  365.  
  366. System.Console.WriteLine($"Registered an account, check R!");
  367. */
  368. var responselolxx = cl.PostAsync("https://discordapp.com/api/auth/login", new StringContent(JsonConvert.SerializeObject(new LoginShit { email = email, password = password }), Encoding.UTF8, "application/json"));
  369.  
  370. var responsexdxx = cl.GetAsync("https://discordapp.com/api/v6/users/@me");
  371. TokenResponse respxx = JsonConvert.DeserializeObject<TokenResponse>(responselolxx.Result.Content.ReadAsStringAsync().Result);
  372. cl.DefaultRequestHeaders.Add("Authorization", respxx.token);
  373.  
  374. GetDisCRIMINATOR discrimxx = JsonConvert.DeserializeObject<GetDisCRIMINATOR>(responsexdxx.Result.Content.ReadAsStringAsync().Result);
  375. File.AppendAllText("Results.txt", $"{email}:{password}:{discrimxx.discriminator}" + Environment.NewLine);
  376. File.AppendAllText("OutputTokens.txt", respxx.token + "\n");
  377. Console.WriteLine($"Trying to register an account, {Username}:{password} on proxyURL: {proxyUrlRequired}");
  378.  
  379. }
  380.  
  381. else
  382. {
  383. if (response.Content.ReadAsStringAsync().Result.ToLower().Contains("limited"))
  384. {
  385. Console.ForegroundColor = ConsoleColor.Red;
  386.  
  387. Console.ForegroundColor = ConsoleColor.White;
  388. }
  389. else
  390. {
  391. if (response.Content.ReadAsStringAsync().Result.ToLower().Contains("registered"))
  392. {
  393. Console.ForegroundColor = ConsoleColor.Red;
  394.  
  395. Console.ForegroundColor = ConsoleColor.White;
  396. }
  397. else
  398. {
  399.  
  400.  
  401. var responselolx = cl.PostAsync("https://discordapp.com/api/auth/login", new StringContent(JsonConvert.SerializeObject(new Login { email = email, password = password }), Encoding.UTF8, "application/json"));
  402. TokenResponse respx = JsonConvert.DeserializeObject<TokenResponse>(responselolx.Result.Content.ReadAsStringAsync().Result);
  403. cl.DefaultRequestHeaders.Add("Authorization", respx.token);
  404. var responsexdxx = cl.GetAsync("https://discordapp.com/api/v6/users/@me");
  405. GetDisCRIMINATOR discrimxx = JsonConvert.DeserializeObject<GetDisCRIMINATOR>(responsexdxx.Result.Content.ReadAsStringAsync().Result);
  406. File.AppendAllText("Results.txt", $"{email}:{password}:{discrimxx.discriminator}" + Environment.NewLine);
  407. File.AppendAllText("OutputTokens.txt", respx.token + "\n");
  408.  
  409. Console.WriteLine($"Trying to register an account, {Username}:{password} on proxyURL: {proxyUrlRequired}");
  410. }
  411. }
  412. }
  413.  
  414. }
  415.  
  416. }
  417. }
  418. catch (Exception e)
  419. {
  420.  
  421. }
  422.  
  423. }).Start();
  424.  
  425.  
  426.  
  427. }
  428.  
  429. public void CreateAccount(string username, string email, string password, string inviteCode, string proxyURLRequired)
  430. {
  431. new Thread(() =>
  432. {
  433. HttpClient cl = null;
  434. WebProxy proxy = null;
  435. HttpClientHandler handler = null;
  436. try
  437. {
  438. proxy = new WebProxy(proxyURLRequired, false)
  439. {
  440. UseDefaultCredentials = true
  441. };
  442.  
  443. handler = new HttpClientHandler
  444. {
  445. Proxy = proxy,
  446. PreAuthenticate = true,
  447. UseDefaultCredentials = true
  448. };
  449.  
  450. }
  451. catch (Exception e)
  452. {
  453.  
  454. }
  455. HttpResponseMessage response = new HttpResponseMessage();
  456.  
  457.  
  458.  
  459.  
  460. try
  461. {
  462. string captchakey = getCaptchaToken(proxyURLRequired);
  463. cl = new HttpClient(handler);
  464. cl.DefaultRequestHeaders.Clear();
  465. cl.DefaultRequestHeaders.Add("X-Fingerprint", GetFingerPrint());
  466. 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;
  467. Logins.Add(email, password);
  468.  
  469. TwoCaptcha solvex = new TwoCaptcha(this._2Captcha, "6Lef5iQTAAAAAKeIvIY-DeexoO3gj7ryl9rLMEnn", "https://discordapp.com/api/v6/auth/register");
  470. HandleResponse(response, proxyURLRequired, cl, email, password, inviteCode, proxy, solvex);
  471. Console.WriteLine($"Trying to register an account, {Username}:{password} on proxyURL: {proxyURLRequired}");
  472. }
  473. catch (Exception e)
  474. {
  475.  
  476.  
  477.  
  478. }
  479. }).Start();
  480.  
  481. }
  482. public string RandomStringx(int Length)
  483. {
  484. List<char> Characters = new List<char>()
  485. {
  486. 'a',
  487. 'b',
  488. 'c',
  489. 'd',
  490. 'e',
  491. 'f',
  492. 'g',
  493. 'h',
  494. 'i',
  495. 'j',
  496. 'k',
  497. 'l',
  498. 'm',
  499. 'n',
  500. 'o',
  501. 'p',
  502. 'q',
  503. 'r',
  504. 's',
  505. 't',
  506. 'u',
  507. 'v',
  508. 'x',
  509. 'y',
  510. 'z'
  511. };
  512.  
  513. string FinalWord = null;
  514.  
  515. for (int i = 0; i < Length; i++)
  516. {
  517. if (new Random().Next(1, 100) >= 50)
  518. {
  519. FinalWord += char.ToUpper(Characters[new Random().Next(1, Characters.Count())]);
  520.  
  521. }
  522. else
  523. {
  524. FinalWord += char.ToLower(Characters[new Random().Next(1, Characters.Count())]);
  525. }
  526. }
  527.  
  528. return FinalWord;
  529. }
  530. public PlatinCreatorAPI()
  531. {
  532. if (FirstTimeSetup())
  533. {
  534. Console.Title = "PlatinCreator 2.0; First time setup. by Tada / Yaekith.";
  535.  
  536. Console.ForegroundColor = ConsoleColor.Green;
  537. Console.WriteLine("Attempting to generate a configuration file..\n2CaptchaKey? ");
  538. string captchakey = Console.ReadLine();
  539. Console.WriteLine("Account Usernames(Do x-1 if you're doing unique random names)? ");
  540. string Username = Console.ReadLine();
  541. Console.WriteLine("Invite Code? (InviteCodeONLY AFTER DISCORD.GG/, leave blank if none)");
  542. string InveCode = Console.ReadLine();
  543. List<string> ToWrite = new List<string>()
  544. {
  545. captchakey,
  546. Username
  547. };
  548. if (InveCode.ToLower() != null || InveCode.ToLower() != "")
  549. {
  550. ToWrite.Add(InveCode);
  551.  
  552. }
  553.  
  554. File.Create("config.txt").Close();
  555. File.Create("proxies.txt").Close();
  556.  
  557.  
  558. File.WriteAllLines("config.txt", ToWrite.ToArray());
  559. File.WriteAllText("proxies.txt", new WebClient().DownloadString("https://proxyscrape.com/proxies/HTTP_Working_Proxies.txt"));
  560. Console.WriteLine("Thank you for your co-operation. Re launch.");
  561. Console.ReadLine();
  562. }
  563. else
  564. {
  565. string[] lines = File.ReadAllLines("config.txt");
  566.  
  567. this._2Captcha = lines[0];
  568. this.Username = lines[1];
  569. if (lines[2] != null || lines[2] != "" || lines[2] != " ")
  570. {
  571. this.InvCode = lines[2];
  572.  
  573. }
  574. File.WriteAllText("proxies.txt", new WebClient().DownloadString("https://proxyscrape.com/proxies/HTTP_Working_Proxies.txt"));
  575. Console.Title = "Platincreator 2.0; Generating accounts. by Tada / Yaekith";
  576. Console.ForegroundColor = ConsoleColor.Green;
  577. Console.WriteLine("Sit back, relax and enjoy the show.");
  578. if (this.Username.ToLower() == "x-1")
  579. {
  580. Parallel.Invoke(() =>
  581. {
  582. new Thread(() =>
  583. {
  584. for (; ; )
  585. {
  586. try
  587. {
  588. string usernamxe = RandomString(15);
  589. this.Username = usernamxe;
  590. string email = $"{RandomString(20)}@gmail.com";
  591. string password = RandomString(20);
  592. new Thread(() => CreateAccount(usernamxe, email, password, this.InvCode, File.ReadAllLines("proxies.txt")[new Random().Next(1, File.ReadAllLines("proxies.txt").Count())])).Start();
  593. }
  594. catch (Exception e)
  595. {
  596.  
  597. }
  598.  
  599. }
  600. }).Start();
  601. });
  602.  
  603.  
  604. }
  605. else
  606. {
  607. Parallel.Invoke(() =>
  608. {
  609. new Thread(() =>
  610. {
  611. for (; ; )
  612. {
  613. try
  614. {
  615. string email = $"{RandomString(20)}@gmail.com";
  616. string password = RandomString(20);
  617. 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();
  618. }
  619. catch (Exception e)
  620. {
  621.  
  622. }
  623.  
  624. }
  625.  
  626. }
  627.  
  628.  
  629. });
  630. }
  631. }
  632. }
  633.  
  634. private class PFPChange
  635. {
  636. public string avatar { get; set; }
  637. }
  638. }
  639. }
Add Comment
Please, Sign In to add comment