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

.NET 

Making a bot - how do I autoclick a Javascript button?

Hello there.
I have been trying to figure this out for days and I'm completely lost. I'm in my final high school year and we have this group voting website, where we vote for the best group. The votes are based on IP, so I'm trying to make a "bot" where my script clicks the "Vote" button, then changes the IP using a proxy list, and then clicks the button again. I'm not quite sure what language I'm supposed to code this in, I'm trying VB and a couple other languages as well.

Anyways, where should I start? My very first problem is that the button is coded in Javascript, so the button link is href="javascript :void(0)". How do I generate this as an URL? Such as www.website.com/page/#void(0), or something like that. Will that work in this scenario?

Here is the website I'm trying to make a script for: http://russelaat.no/huemist-2016-01/
And this is how the vote button looks like:
[Image: 99794zo.png]

Please help me get going with this small project.
Thank you very much in advance.
I whipped this up, just add proxy support and you are good to go.

Code
private static void Vote(string url)
{
     using(WebClient wc = new WebClient())
     {
         string init = wc.DownloadString(url);

         string wpv_nonce = Regex.Match(init, "\"wpv_nonce\":\"(.*)\"").Groups[1].Value;
         string postID = Regex.Match(init, "class=\"postID\" value=\"(.*)\"").Groups[1].Value;
         string userID = Regex.Match(init, "class=\"userID\" value=\"(.*)\"").Groups[1].Value;
         string authorID = Regex.Match(init, "class=\"authorID\" value=\"(.*)\"").Groups[1].Value;

         NameValueCollection post = new NameValueCollection();
         post.Add("action", "wpv-submit");
         post.Add("wpv_nonce", wpv_nonce);
         post.Add("postID", postID);
         post.Add("userID", userID);
         post.Add("authorID", authorID);

         wc.UploadValues("http://russelaat.no/wp-admin/admin-ajax.php", post);
     }
}

Usage:
Code
Vote("http://russelaat.no/huemist-2016-01/");


Edit: It would be more efficient to just get the "init" request once, then use the values from it for each vote request( i guess the values would always be the same for the page).
Lotta blood to let, peace to make, give a fuk about a check
(Nov 15, 2015 05:29 AM)BahNahNah Wrote:  -snip-

I'll give it a go and try it out when I get home. I'll keep you posted and let you know how it goes.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by LeonieHackPetaBytes2Jan 23, 2019 05:10 PM 1 227 Jan 23, 2019 05:10 PM
Last Post: 0xDEAD10CC
[.NET] by securityoneAug 20, 2016 12:54 AM 3 140 Aug 20, 2016 12:54 AM
Last Post: FatStacks
[C#] by KaleMar 7, 2016 05:01 PM 4 184 Mar 7, 2016 05:01 PM
Last Post: Kale