Jump to content

Random Adlink Visitor


murder_face

Recommended Posts

I don't know much about programming, but I found this little snippet and it looks like it might have potential. What I am wanting to do is to substitue the links for say an AdBlock plus list, and rather than clicking a button maybe have the program visit a new link every 5 seconds. The other thing I would like to do is instead of running in a browser is to have it run as a screensaver(kind of like SETI).

I figure if enough people would jump on the bandwagon it would pretty much put an end to "data mining". Since the advertisers wouldn't be able to tell which visits were legitimate.

The other thing that I was considering is maybe having a centralized server that would coordinate the visits so that everyone who is running the program is visiting the same site at the same time. Studid question, but would that still be considered a DDoS?

I'm not really sure about the legality or feasability of any of this.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Random Link</title>

<script type="text/javascript"><!--

var links = new Array();

links[0]="http://www.google.com";

links[1]="http://www.msn.com";

links[2]="http://www.yahoo.com";

links[3]="http://www.ebay.com";

links[4]="http://www.cnn.com";

function getRandomLink() {

var randomNum = Math.floor(Math.random()*links.length);

window.location = links[randomNum];

}

//--></script>

</head>

<body>

<form name="" action="">

<input type="button" value="Go to random link!" onclick="getRandomLink()" />

</form>

</body>

</html>

Link to comment
Share on other sites

So from what I have read I javascript can't work with files on my computer. Would adding some PHP (I'm still looking for the right function) to import a list work? Also, instead of having the page of the clicked link visited is there something like /dev/null that would still register as a valid site visit? And last but not least, how do I deal with the cookie generated by the visit?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Random Link</title>

<script type="text/javascript"><!--

var links = new Array();

<?php

$RandomList = array(); // Leave this line as is.

// Edit next lines for the file locations to be inserted randomly.

$RandomList[] = "https://secure.fanboy.co.nz/fanboy-adblock.txt";

// Leave next line as is.

readfile($_SERVER['DOCUMENT_ROOT'].$RandomList[rand(0,count($RandomList)-1)]);

?>

function getRandomLink() {

var randomNum = Math.floor(Math.random()*links.length);

window.location = links[randomNum];

}

//--></script>

</head>

<body>

<form name="" action="">

<input type="button" value="Go to random link!" onclick="getRandomLink()" />

</form>

</body>

</html>

Edited by murder_face
Link to comment
Share on other sites

Not sure exactly what it is you are trying to accomplish, but what kind of computer do you have that "javascript" cant work with files on your computer? Like as if PHP would make that any simpler. Screensavers in general, are not written in HTML, nor are they written in PHP. If its a script you want to loop and launch requests to random sites you feed into it though, that can be done like above with javascript for sure, but why do you want to make your computer continually launch the browser to a site? Even if you hooked it in a program, unless you are doing raw socket requests in the background, the above script launched from any program requesting a web page, would more than likely launch your browser, not to mention, the above script requires interaction for the onclick event.

Now, if its say, a list of 1000 ad sites, you wanted to send random clicks to, all you are doing is committing click fraud, which, many bots do on places like Facebook, which just spider their site as a logged in user, and look for ads from say, a competitor, and just continually send clicks for that ad. I don't see how that has anything to do with data mining though. Ad companies, can tell if an ad was clicked by a bot or a real user. In fact, one company filed suit against Facebook, because they were being charged for a jump in ad clicks, which by way of metrics and how they generate their code, could see the end users we're using Javascript to submit the ads, and was 80% click fraud. Ad companies kind of know what you are doing, and sites like Facebook, sell your data to them anyway, so unless you plan to never visit any site ever again, doesn't matter if you block the ads or not, the site you visit, will still collect data on you, and share it with the ad companies, even if you have adblocker or other things like it to not see the ads.

Now, if its anonymity you want, use tools like TOR or the Live CD Tails. https://tails.boum.org/index.en.html There are plugins for FF and most other browsers to have TOR built in as well, but if you could, explain why you want a bunch of people clicking or requesting ad links in general, and what thats is supposed to accomplish?

Link to comment
Share on other sites

Sorry, I'm pretty new to writing any kind of program/code whatsoever. The code I have been posting is more of a jumping off point. Once I figured out how to make it run in a browser, I planned on trying to figure out how to make it standalone or just run it through a lightweight browser.

I guess click fraud is what I was going for.

I have been trying to learn a little bit of programming and didn't really have a jumping off point, so I thought something like this would be a good place to start

Link to comment
Share on other sites

What is the end result you are trying to accomplish, then work from there. You could script this in some other languages too, such as python (I'm not a programmer either and couldn't write my way out of a wet paper bag with python, but probably a good place to start) or even in php. Python though would let you just script a bunch of stuff like the javascript did and just have it loop and go out to random sites from your array of hosts you gave it and you could add timers how often it randomly chooses to hit them, etc. Cool thing about using python, it can all run from the command line and won't need a browser to make the connections. Other scripting languages could do the same thing, like using curl with php, or ruby, etc. Using Javascript, requires some user interaction and at least launching it from a browser, unless you did it all through node.js and prototype or using the chrome engine to do it from the command line. Node.js will give you some interaction server side with the host its running under to allow you to call more than just web browser based code.

Edited by digip
Link to comment
Share on other sites

In python it's very simple. libcurl is a very powerful open source library for many protocols.

import pycurl
import time

g = pycurl.Curl () # starts instance

g.setopt ( g.url, 'www.google.com' ) # pass url as argument type

g.perform () # send request to http server

Alternatively, instead of visiting one URL, you could go to multiple ones.


# The following is psuedo code and unconfirmed, but something like the following should work for multiple urls

import time, pycurl

g = pycurl.Curl () # start instance of curl class

url_list = [ 'www.google.com', 'www.yahoo.com', 'www.hotmail.com' ] # put the urls you want to visit into this list

for x in url_list: # Define number of iterations

    g.setopt( g.url, url_list[ x ] ) # takes item from url_list and puts it as argument to setopt function

    g.perform () # sends get request to http server

    time.sleep(.5) # Wait before entering the next iteration (iteration is fancy talk for loop)

If you're doing this to generate fake traffic, I don't think it will work. I don't know much about websites, but I imagine there would be server side scripts running to verify that requests are coming from a browser (or other legit ways and not automated programs). For fake traffic I think a rogue DNS server is the preferred method, yet very illegal, as people pay money for traffic.

C/C++ or a low level language is the way to go for this though, python is slow and you'll notice that. As a project, you could download Dev C++ (free and small) and copy and paste the code from here (http://curl.haxx.se/...rl/c/https.html) and compile it (only after linking the necessary library files to the linker). Take the same principal of python's list (which is what allowed in the previous script for multiple urls), and apply it to C++ by putting your multiple url's in either a vector, (possibly) array, and pass them as arguments into the libcurl functions (you could probably pass it in as a normal string too). This will run 50x faster than python. I am by far from a C++ expert, but this way could possibly work. But only if you want it to : ) libcurl is also probably one of the best documented libraries IMO, as such an excellent place to start.

A side note, when you have questions, we'd be more than happy to help here, but there will be questions we can't answer, in which case stackoverflow.com is your friend.

Edited by bobbyb1980
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...