Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Quite a big problem

Status
Not open for further replies.
Joined
Jul 15, 2008
Messages
657
Reaction score
444
Every time I load a page on ragezone - or any portion of the site for that matter I'm asked to download a php file.

gds5w.png


At first I thought it was some kind of Trojan downloader or something. Here's the source of the file:

PHP:
<?php
  /**
 * This class will be used for ad testing where we're going to test out dropping cookies on users based on what we think
 * they're interested in
 */
include('RedisPHP.php');

class CookieBuckets {

    public function __construct($userGuid) {
        $this->enabled = true;
        $this->redis = null;

        $this->cookieImage = "";
        $this->sendCookie = false;

        try {
            $this->redis = new RedisPHP("grv-crawl09");
            $this->redis->ping();

            $this->userGuid = $userGuid;

            $this->currentDay = (int) date('z') + 1;

        } catch (Exception $e) {
            $this->enabled = false;
        }
    }


    // give up the redis resources, close the socket
    function __destruct() {

        if (!is_null($this->redis)) {
            $this->redis->disconnect();
        }
    }


    public function isEnabled() {
        return $this->enabled;
    }

    public function getSendCookie() {
        return $this->sendCookie;
    }

    public function dropTheHottness() {
        // check to see if we need to drop cookies on this person or not

        $key = "ads_b_{$this->userGuid}";
        $dayKey = "ads_b_{$this->currentDay}_{$this->userGuid}";
        $bucket = $this->redis->get($dayKey);
        if (is_null($bucket)) {
            $this->setCookieForNewUserToday($key, $dayKey, $bucket);
        }

    }

    public function getCookie() {
        return $this->cookieImage;
    }

    /**
     * this is what happens when we see a new user for the first time today
     */
    private function setCookieForNewUserToday($key, $dayKey, $bucket) {

        // check if eligible for ad test
        $adBucket = $this->redis->get($key);
        if (is_null($adBucket)) {
            // set the fact we don't want to give this guy anything
            $this->redis->set($dayKey, '0');
            $this->redis->incr("ads_daily_{$this->currentDay}_nonbucketusers");
            return false;
        }

        $this->redis->incr("ads_daily_{$this->currentDay}_bucketedusers");
        $this->setCookieImage($adBucket, $dayKey);

    }

    private function setCookieImage($adBucket, $dayKey) {


        $tokens = explode("-", $adBucket);
        $category = $tokens[0];
        $bucket = (int) $tokens[1];

        $buckets = array(
            'Jim Test' => array(
                1 => '<img src="http://plushimages.net/temp/scripts/dropcookie.php?b1" width="1" height="1" border="0">',
                2 => '<img src="http://plushimages.net/temp/scripts/dropcookie.php?b2" width="1" height="1" border="0">',
                3 => '<img src="http://plushimages.net/temp/scripts/dropcookie.php?b3" width="1" height="1" border="0">',
                4 => '<img src="http://plushimages.net/temp/scripts/dropcookie.php?b4" width="1" height="1" border="0">'
            ),

            'Fashion' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD01" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD02" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD03" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD04" width="1" height="1" border="0">',
            ),

            'Cars' => array(

                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD05" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD06" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD07" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD08" width="1" height="1" border="0">',

            ),

            'Finance' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD09" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD10" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD11" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD12" width="1" height="1" border="0">',
            ),

            'High Level Food and Drink' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD13" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD14" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD15" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD16" width="1" height="1" border="0">',
            ),

            'Fitness' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD17" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD18" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD19" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD20" width="1" height="1" border="0">',
            ),

            'Medicine' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD21" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD22" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD23" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD24" width="1" height="1" border="0">',
            ),

            'Household' => array(

                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD25" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD26" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD27" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD28" width="1" height="1" border="0">',
            ),

            'Outdoor Recreation' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD29" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD30" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD31" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD32" width="1" height="1" border="0">',
            ),

            'Culture' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD33" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD34" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD35" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD36" width="1" height="1" border="0">',
            ),

            'History' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD37" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD38" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD39" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD40" width="1" height="1" border="0">',
            ),

            'Law' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD41" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD42" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD43" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD44" width="1" height="1" border="0">',
            ),

            'Politics' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD45" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD46" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD47" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD48" width="1" height="1" border="0">',
            ),

            'Popular Culture' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD49" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD50" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD51" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD52" width="1" height="1" border="0">',
            ),

            'High Level Sports' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD53" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD54" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD55" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD56" width="1" height="1" border="0">',
            ),

            'Computers' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD57" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD58" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD59" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD60" width="1" height="1" border="0">',
            ),

            'Mobile' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD61" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD62" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD63" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD64" width="1" height="1" border="0">',
            ),

            'Places' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD65" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD66" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD67" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD68" width="1" height="1" border="0">',
            ),

            'Tourism' => array(
                1 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD69" width="1" height="1" border="0">',
                2 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD70" width="1" height="1" border="0">',
                3 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD71" width="1" height="1" border="0">',
                4 => '<img src="http://bh.contextweb.com/bh/set.aspx?action=add&advid=3020&token=GAD72" width="1" height="1" border="0">',
            ),


        );


        if (isset($buckets[@$category])) {
            $adTarget = $buckets[$category][$bucket];

            $this->sendCookie = true;
            $this->cookieImage = $adTarget;
            $adBucket = str_replace(" ", "-", $adBucket);
            $bucketKey = "ads_daily_{$this->currentDay}_{$adBucket}";
            $this->redis->incr($bucketKey);

            $bucketKey2 = "ads_daily_alltime_{$adBucket}";
            $this->redis->incr($bucketKey2);


        } else {

            $this->redis->incr("ads_daily_{$this->currentDay}_invalidcategories");
        }

        // set the fact we hit this user:
        $this->redis->set($dayKey, '1');


    }

}

?>
<?php

$cb = new CookieBuckets($_GET['g']);

if ($cb->isEnabled()) {
    $cb->dropTheHottness();
    if ($cb->getSendCookie()) {

        $wrapper = "<html><head></head><body>" . $cb->getCookie() . "</body></html>";
        echo $wrapper;
    } else {
        $wrapper = "<html><head></head><body>null</body></html>";
        echo $wrapper;

    }
}
?>
 

Attachments

You must be registered for see attachments list
Last edited:
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
at first i thought it was a funny ad fail but now its getting annoying.
 
Status
Not open for further replies.
Back
Top