Members   Search      Help    Register    Login    Home
Home » Discussion Forums » M0dZ & HaCkZ » Additional Anti-cheat check(in announce)
Additional Anti-cheat check [message #2158] Tue, 29 July 2008 13:32
Revan is currently offline Revan  Czech Republic
Messages: 125
Registered: April 2007
Super-Seeder
At the moment we use User Agent to discover if user is accessing announce from web browser or not, but if some smart ass would change user agent to something else it would very easily allow cheating...
This is fixed on lots of tbdev trackers however so I took their code and edited it to our purpose - thanks to the original creator!

So far we have this:
if (eregi("(Mozilla|Opera|Lynx|Netscape)",$HTTP_SERVER_VARS["HTTP_USER_AGENT"])) {
        die("<html><head><title>Error!</title></head><body><h3>Sorry, but this file is not suitable for browsers.</h3></body></html>");
}


What I'm suggesting is adding these lines below:
    $headers = getallheaders();
    if (isset($headers["Cookie"]) || isset($headers["Accept-Language"]) || isset($headers["Accept-Charset"])) {
    die("<html><head><title>Error!</title></head><body><h3>Sorry, but this file is not suitable for browsers.</h3></body></html>");
    }
    unset($headers);


If your server doesn't have (or allow) function getallheaders like mine (you're not using apache for example), then add these before the code:
if (!function_exists('getallheaders'))
{
    function getallheaders()
    {
       foreach ($_SERVER as $name => $value)
       {
           if (substr($name, 0, 5) == 'HTTP_')
           {
               $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
           }
       }
       return $headers;
    }
}
Previous Topic:[Help] Everyone please share "install-MSSQL-ODBC.sql" file.
Next Topic:AJAX PM Checking
Goto Forum:
  


Current Time: Wed Feb 08 11:28:40 GMT 2012

Total time taken to generate the page: 0.00713 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software