Online website account checker

Posts 1–3 of 3 · Page 1 of 1
Online website account checker
I've codding for few hours to achieve a online account checker, to input userass from txt and then check if them works

I cant get it working... Also I havent found any source code, but here is what I achieved (Visual basic)

Code:
Imports System.Net
Imports System.Text
Imports System****
Imports System.Threading

Public Class Form1
    
    Dim w As IO.StreamWriter
    Dim r As IO.StreamReader
    Dim uss, pss As String
    Public Sub addme(ByVal yes As Boolean)
        CheckForIllegalCrossThreadCalls = False
        ListBox2.Items.Add(uss & ":" & pss)
        uss = ""
        pss = ""
        Label6.Text = ListBox2.Items.Count
    End Sub
    Public Sub checkme()
        WebBrowser1.Navigate("https://www.MYWEBSITE.com/login")
        MsgBox("wait")

        Dim theElementCollection As HtmlElementCollection
        theElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
        For Each curElement As HtmlElement In theElementCollection
            Dim controlName As String = curElement.GetAttribute("name").ToString
            If controlName = "email" Then
                curElement.SetAttribute("Value", "Username text here")
            ElseIf controlName = "password" Then
                curElement.SetAttribute("Value", "Password text here")
                'In addition,you can get element value like this:
                'MessageBox.Show(curElement.GetAttribute("Value"))
            End If

        Next
        For Each curElement As HtmlElement In theElementCollection
            If curElement.GetAttribute("value").Equals("submit") Then
                curElement.InvokeMember("click")
                ' javascript has a click method for we need to invoke on button and hyperlink elements.
            End If
        Next
        Thread.Sleep(9000)
        Try
            Dim theElementCollection1 As HtmlElementCollection
            theElementCollection1 = WebBrowser1.Document.GetElementsByTagName("input")
            For Each curElement1 As HtmlElement In theElementCollection1
                If WebBrowser1.DocumentText.Contains("info") Then
                    addme(1)
                End If
                Dim element = WebBrowser1.Document.GetElementById("info")
                If element IsNot Nothing Then
                    MsgBox(element.InnerHtml)
                End If
            Next
        Catch ex As Exception
        End Try
        ' If thepage.Contains("<span data-subscription-type=""user"" ") Then
        'addme(1)
        ' End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        ListBox1.Items.Clear()
        Using open As New OpenFileDialog
            If open.ShowDialog = DialogResult.OK Then
                r = New IO.StreamReader(open.FileName)
                While (r.Peek() > -1)
                    ListBox1.Items.Add(r.ReadLine)
                End While
                r.Close()
            End If
        End Using
        Label4.Text = ListBox1.Items.Count
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If ListBox2.Items.Count = 0 Then

        Else
            Dim save1 As New SaveFileDialog()
            If save1.ShowDialog() = DialogResult.OK Then
                Dim i As Integer
                w = New IO.StreamWriter(save1.FileName)
                For i = 0 To ListBox2.Items.Count - 1
                    w.WriteLine(ListBox2.Items.Item(i))
                Next
                w.Close()
                ListBox2.Items.Clear()
            End If
        End If
        
    End Sub
    Private Sub split(ByVal i As Integer)
        Dim username As String
        Dim password As String
        Dim info As String
        Dim splited() As String
        info = ListBox1.Items.Item(i).ToString
        splited = info.Split(":")
        username = splited(0)
        password = splited(1)
        uss = username
        pss = password
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If ListBox1.Items.Count = 0 Then

        Else
            BackgroundWorker1.RunWorkerAsync()
        End If

    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click

        For i = 0 To ListBox1.Items.Count - 1
            split(i)
            MsgBox(i)
            Dim theElementCollection As HtmlElementCollection
            theElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
            For Each curElement As HtmlElement In theElementCollection
                Dim controlName As String = curElement.GetAttribute("name").ToString
                If controlName = "email" Then
                    curElement.SetAttribute("Value", uss)
                ElseIf controlName = "password" Then
                    curElement.SetAttribute("Value", pss)
                    'In addition,you can get element value like this:
                    'MessageBox.Show(curElement.GetAttribute("Value"))
                End If

            Next
            If i = ListBox1.Items.Count - 1 Then
                MsgBox("All Accounts Checked! Please save your Working Accounts!")
            End If
        Next


    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork

        For i = 0 To ListBox1.Items.Count - 1
            split(i)
            checkme()
            If i = ListBox1.Items.Count - 1 Then
                MsgBox("All Accounts Checked! Please save your Working Accounts!")
            End If
        Next

    End Sub
End Class
Thanks for trying to help me!
Look at the login packet and see if it is a GET or POST type. Then use a WebClient and send packet like the webbrowser form does. There are alot of tutorials online to show you got to do this.
This is how I do it for MPGH Authentication:

Code:
public string Login(string username, string password)
        {
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(MPGHLogin);
            req.AllowAutoRedirect = true;
            string cookie = "";
            string values = "vb_login_username=" + username + "&vb_login_password=" + password
                            + "&securitytoken=guest&"
                            + "cookieuser=checked&"
                            + "do=login";
            req.Method = "POST";
            req.ContentType = "application/x-www-form-urlencoded";
            req.ContentLength = values.Length;
            CookieContainer a = new CookieContainer();
            req.CookieContainer = a;

            System.Net.ServicePointManager.Expect100Continue = false;

            StreamWriter writer = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
            writer.Write(values);
            writer.Close();

            req.Timeout = 5000;
            HttpWebResponse c;
            try {
                c = (HttpWebResponse)req.GetResponse(); // da response 
            } catch(Exception e)
            {
                return "FAILED_CONNECTION";
            }

            foreach (Cookie cook in c.Cookies)
            {
                cookie = cookie + cook.ToString() + ";";
            }

            Stream resp = c.GetResponseStream();
            StreamReader reader = new StreamReader(resp, Encoding.GetEncoding(c.CharacterSet));
            string response = reader.ReadToEnd();
            reader.Close();
            reader.Dispose();

            if (response.Contains("Thank you for logging in, " + username))
            {
                c.Dispose();
                return cookie;
            }
            else
                return "FAILED_AUTH";
        }
This is for C# but yea.
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us