Log in

View Full Version : [CODE] Survey Bypasser (CPAlead)



Apolva
12-04-2010, 12:10 PM
OK so I got a little frustrated with all these stupid surveys just to see a "funny" picture, so I've written a simple php script to block them.

Note: this was done in a hurry, I know it's wildly inefficient and doesn't translate relative -> absolute URLs, it's merely POC.

I tested it, and it seemed to work fine without translating the URLs, but feel free to make improvements...

Explanation:

OK, so CPAlead is the people who provide the surveys. What happens is the page downloads their script containing the ads, then makes sure that it has been downloaded (else will show a "disable your ad-blocker warning").

This script changes the address of the survey script to itself, tricking the rest of the script into thinking the surveys have been loaded.

Source:


<?php
$u=$_GET['u']; // URL

// Show the fake survey script page.
if($_GET['divert']=="y"){header("Content-type: text/js"); die("isloaded=true");}

// If no URL is present, show the form.
if($u=="") die("<div style='text-align:center;margin-top:30px;margin-bottom:10px;'>This is just to bypass those annoying &quot;answer the survey to see the pic&quot; sites.</div><form><table style='margin:0 auto;'><tr><td><b>URL:</b></td><td><input type='text' value='http://' name='u' style='width:200px;' /></td></tr><tr><td colspan='2' style='text-align:center;'><input type='submit' value='Go &raquo;' /></td></tr></table></form>");

// Blocks local file acess.
if(substr($u,0,7)!="http://" && substr($u,0,8)!="https://") die("<b>Error</b> - Not a valid site address.");

// Get remote page.
$file=@file_get_contents($u);
if(!$file) die("<b>Error</b> - Can't access the site.");

// To prevent it just being used as a proxy.
if(strpos($file,"http://www.cpalead.com/")===FALSE){die("<b>Error</b> - Site hasn't got a survey on it.");}

// Rewrite the script url to use fake one.
$file=str_replace("http://www.cpal"."ead.com/mygateway.php?","?divert=y&",$file);

// Output page.
echo $file;
?>


I'm not hosting this myself because I know someone will come and abuse it and probably get my hosting suspended, lol.

If someone does decide to use it, a little credit doesn't harm. :)

Apolva
12-04-2010, 02:19 PM
Decided I'm going to host a newer version of this script, I'll leave this one one here for inspiration...

iDenning
12-04-2010, 02:40 PM
Awesome, can this trick sites into thinking youve filled out surveys too?

Apolva
12-04-2010, 03:38 PM
Nah, not where you earn points/money from it etc. It just stops you having to fill them out to see the rest of the page.

And we're up: http://apolva.co.cc/other/surveybypass/

Jahova
12-04-2010, 04:03 PM
Thanks for the code, I will also jig it around and work on it :)

Apolva
12-04-2010, 04:07 PM
you're welcome, also new thread: http://www.habboxforum.com/showthread.php?t=638298

Want to hide these adverts? Register an account for free!