Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Automating an identity in a new account form using webbrowser

Here is the basics on how to automate a random identity for an account creation form. Warning: I'll be going into great detail!

For this project I will be using a hotmail account creation form. This may sound stupid but you will see why this is important in the future. You can use this link for reference: https://signup.live.com/

[Image: 3aaee962ebe1154b60b24f47b9cc0135.png]

So we can see that this form requires a first name, last name, username, password, reenter password, county (it's filled in automatically so you can skip this), birthday (MM/DD/YYYY), gender, and phone number or email. Most account creation forms require these basic types of information. Some may include more some may have less. It all depends on the website.

so to generate a random ID we can either have a large list of information which loops through and chooses at random and blacklists used identities or we can take a easier route and just do some basic scraping. To generate our random identity we will be using a website called http://www.fakenamegenerator.com/

So lets first make a sub to scrape it

Code
Private Sub createID
end sub

For this example I'll be using a webclient to download the source where I can sort through it later.

Don't forget to import system.net!
Code
imports system.net

Code
Dim wc As New WebClient
Dim source As String = wc.DownloadString("http://www.fakenamegenerator.com/")

Congrats, you just downloaded the source of the website! 🤗

To confirm this (and to see the source) you can call a messagebox which will display the source.

Code
messagebox.show(source)

Lets now look through that source so we can find what we want and extract just that section out of the full source and input that later on. For this section I'll be using regex..

If you don't know what regex is, just think of it like this; Say you have a block of text in HTML that we want in our case it's this:

Code
<h3>NameHere<h3>

we want to get the text "NameHere"

So what we do is first imports system.text.regularexpressions (so we can use regex)

Code
imports system.text.regularexpressions

then, we need to name this block of code as a regex

Code
Dim nameregex As New Regex("<h3>NameHere</h3>")

When regexing HTML make sure you have the full sub in our case its the 3rd header starting brackets (<h3>) and closing brackets (</h3>)

Now what ever we want to save we want to replace that with a period star no spaces.

Code
.*

now our new regex statement should look like this:
Code
Dim nameregex As New Regex("<h3>.*</h3>")

Now shit gets tricky.

We want to now split this and call it a string. The best way to explain this you have an index, and 0 means "its self" and 1 means forward. 2 is 2 forward, 3 is 3 forward, you get the picture. So this is what our string statement will look like then I'll explain what it means:

Code
Dim nameraw As String = nameregex.Matches(source)(0).Value.Split(">")(1).Split("<")(0)

So first we're diming (or calling) this text or string "nameraw" (make sure that's not in a sub so we can use it through out the class. So the name nameraw is that regex (which was <h3></h3>) which is in the source from there we want the 1st character over from the first ">" then up until the end of the first "<".

Not too bad eh? 😁

Now for this next part you need to know how fakenamegenerator works. Every time you refresh the page you will get a new identity. So you want to make a button, and every time you push this button you want to run through that code that scrapes a identity. So put your code under that button.

Now we have our webbrowser (this is the easy part)

we first want our webbrowser to load as the form starts up and navigate to the page so we can just push the button and we're in action.

Code
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      WebBrowser1.Navigate("https://signup.live.com")
    End Sub
Next under that button (after our ID generation code; You can even make this in a seperate sub and call it under the button so it looks cleaner) you look back onto the page and see what that textbox is called in our case it's called "firstname" and input that first name data that you scraped using this:

Code
WebBrowser1.Document.GetElementById("FirstName").SetAttribute("value", nameraw)

Do this for every option that you need to fill out then to submit the data just find the submit button and invoke a click!

Code
WebBrowser1.Document.GetElementById("submit").InvokeMember("click")

That's it! you successfully automated the account creation process 🤗

Now just save this to a list of string or listview and export using system.io to a .txt and you're in business.

Thank you for reading this tutorial and I hope it helped at least one of you as it took me over a hour to write this 🎉
(Jun 21, 2015 03:11 AM)Who Soup Wrote:  We want to now split this and call it a string. The best way to explain this you have an index, and 0 means "its self" and 1 means forward. 2 is 2 forward, 3 is 3 forward, you get the picture. So this is what our string statement will look like then I'll explain what it means:

Code
Dim nameraw As String = nameregex.Matches(source)(0).Value.Split(">")(1).Split("<")(0)

You've been very lazy with the regex. :P The name follows a clear pattern: "X Y. Z". Same for other attributes.

This fakenamegenerator site you're using apparently lets you order in bulk. Why not just download a huge batch and deserialize to an object? Eliminate outer-contact entirely.
(Jun 21, 2015 03:38 AM)Odus Wrote:  You've been very lazy with the regex. :P The name follows a clear pattern: "X Y. Z". Same for other attributes.

This fakenamegenerator site you're using apparently lets you order in bulk. Why not just download a huge batch and deserialize to an object? Eliminate outer-contact entirely.

Yeah I know I've been kind of lazy with regex haha, and the reason why I wouldn't bulk order is because 1. you don't know how many IDs you need, 2. there's a captcha, and 3. theres a wait limit.

[Image: a4567432dc8bb2957a7215f04f7dfbf1.png]
(Jun 21, 2015 03:40 AM)Who Soup Wrote:  Yeah I know I've been kind of lazy with regex haha, and the reason why I wouldn't bulk order is because 1. you don't know how many IDs you need, 2. there's a captcha, and 3. theres a wait limit.

Their maximum output per batch is 50,000 so if somehow that isn't enough, order until you're happy. I'd go back over the Regex parts of this. E.g:

(Jun 21, 2015 03:11 AM)Who Soup Wrote:  Now what ever we want to save we want to replace that with a period star no spaces.
Code
.*

Why? What do these sequences mean?


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by dinosaur770Jul 9, 2022 10:57 PM 6 126 Jul 9, 2022 10:57 PM
Last Post: dinosaur770
[.NET] by Agent474849May 4, 2020 05:06 AM 4 157 May 4, 2020 05:06 AM
Last Post: VisualSoft
[Python] by DarkMay 17, 2019 08:08 PM 1 207 May 17, 2019 08:08 PM
Last Post: demarco