Hack Forums
[.NET] Making a VB Program - [Login Password Brute-Force] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Making a VB Program - [Login Password Brute-Force] (/showthread.php?tid=5285985)



Making a VB Program - [Login Password Brute-Force] - anonbux0 - May 29, 2016

Hello,

I'm trying to make a password cracking program for a web login form and i need some help.

I want it to use a proxy for every POST request made, so it will be in this format:

1º Load password list.
2º Load Proxy list
3º Start:
Check if the Proxy is working (If not, try next one...)
Submit the POST request - > Check the HTTP response, if the word "token" is displayed than save the password and stop, if not proceed to the next password.

I don't know how can i make the program use one proxy at every request and also use the next password in the passwordlist.text.


At the moment i have this:

FORM 1:

Code
Imports System.Net
Imports System.Text
Imports System.IO

Public Class Form1

    Dim logincookie As CookieContainer

    Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click

        Dim postdata As String = "username=" & TextBox1.Text & "&password=" & TextBox2.Text
        Dim tempcookies As New CookieContainer
        Dim encoding As New UTF8Encoding
        Dim bytedata As Byte() = encoding.GetBytes(postdata)

        Dim postrequest As HttpWebRequest = DirectCast(WebRequest.Create("https://website.com/login"), HttpWebRequest)

        postrequest.Method = "POST"
        postrequest.KeepAlive = "True"
        postrequest.CookieContainer = tempcookies
        postrequest.ContentType = "application/x-www-form-urlencoded"
        postrequest.Referer = "https://website.com/"
        postrequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0"
        postrequest.ContentLength = bytedata.Length

        Dim postreqstream As Stream = postrequest.GetRequestStream()
        postreqstream.Write(bytedata, 0, bytedata.Length)


        Dim postresponse As HttpWebResponse

        Try

        Catch ex As Exception


        End Try
        postresponse = DirectCast(postrequest.GetResponse(), HttpWebResponse)




        tempcookies.Add(postresponse.Cookies)
        logincookie = tempcookies

        Dim postreqreader As New StreamReader(postresponse.GetResponseStream())


        Dim thepage As String = postreqreader.ReadToEnd

        RichTextBox1.Text = thepage

    End Sub

    Private Sub WebBrowser1_DocumentCompleted(sender As System.Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted


    End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        WebBrowser1.DocumentText = RichTextBox1.Text
    End Sub

    Private Sub TabPage1_Click(sender As System.Object, e As System.EventArgs)

    End Sub

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        Form2.Show()
    End Sub

    Private Sub TextBox2_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox2.TextChanged


    End Sub

End Class

FORM2:

Code
Public Class Form2

    Dim streamer As IO.StreamReader

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

        OpenFileDialog1.ShowDialog()
        TextBox1.Text = OpenFileDialog1.FileName

    End Sub

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        streamer = IO.File.OpenText(TextBox1.Text)

        Dim mystring() As String = streamer.ReadToEnd.Split(vbNewLine)

        ListBox1.Items.AddRange(mystring)
    End Sub
End Class

Can you help me please?

Thank you! 🤝


* - Nikola Тesla - May 29, 2016

I would suggest to first learn basics.

Try this:
1. Make Function {Boolean} For Login (Both Get , Post Req)
2. Accept Parameters for Password
3. Use Threading with For Each Loop { in Password List (Array) }
5. While Calling Function Use This : If { Function Name } Then 'Stop Your Thread & Show Password
4. In Function Return True if Token is Found.