Thread: Wait System
View Single Post
  #5  
Old 18th January 2010, 20:59
Genkai Genkai is offline
Senior Member
 
Join Date: Aug 2008
Portugal
Posts: 16
Default
announce.php
[php]<?php

define ('IN_ANNOUNCE', true);
require_once('./include/core_announce.php');

gzip();

foreach (array('passkey','info_hash','peer_id','event','ip ','localip') as $x) {
if(isset($_GET[$x]))
$GLOBALS[$x] = '' . $_GET[$x];
}

foreach (array('port','downloaded','uploaded','left') as $x)
$GLOBALS[$x] = 0 + $_GET[$x];

if (strpos($passkey, '?')) {
$tmp = substr($passkey, strpos($passkey, '?'));
$passkey = substr($passkey, 0, strpos($passkey, '?'));
$tmpname = substr($tmp, 1, strpos($tmp, '=')-1);
$tmpvalue = substr($tmp, strpos($tmp, '=')+1);
$GLOBALS[$tmpname] = $tmpvalue;
}

if (get_magic_quotes_gpc()) {
$info_hash = stripslashes($info_hash);
$peer_id = stripslashes($peer_id);
}

foreach (array('passkey','info_hash','peer_id','port','dow nloaded','uploaded','left') as $x)
if (!isset($x)) err('Missing key: '.$x);
foreach (array('info_hash','peer_id') as $x)
if (strlen($GLOBALS[$x]) != 20)
err('Invalid '.$x.' (' . strlen($GLOBALS[$x]) . ' - ' . urlencode($GLOBALS[$x]) . ')');
if (strlen($passkey) != 32)
err('Invalid passkey (' . strlen($passkey) . ' - $passkey)');
$ip = getip();
$rsize = 50;

foreach(array('num want', 'numwant', 'num_want') as $k) {
if (isset($_GET[$k]))
{
$rsize = 0 + $_GET[$k];
break;
}
}

$agent = $_SERVER['HTTP_USER_AGENT'];

if (!$port || $port > 0xffff)
err("Invalid port");
if (!isset($event))
$event = '';
$seeder = ($left == 0) ? 'yes' : 'no';

if (ereg("^ABC\\/ABC", $agent)) err("ABC is Banned.");
if (ereg("^0P3R4H", $agent)) err("IBrowser Opera is not a cool BT client.");
if (substr($peer_id, 0, 4) == "FUTB") err("FUTB? Fuck You Too.");
if (substr($peer_id, 0, 7) == "exbc\0L") err("BitLord 1.0 is Banned.");
if (substr($peer_id, 0, 7) == "exbcL") err("BitLord 1.1 is Banned.");
if (substr($peer_id, 0, 3) == "-TS") err("TorrentStorm is Banned.");
if (substr($peer_id, 0, 5) == "Mbrst") err("Burst! is Banned.");
if (substr($peer_id, 0, 3) == "-BB") err("BitBuddy is Banned.");
if (substr($peer_id, 0, 3) == "-SZ") err("Shareaza is Banned.");
if (substr($peer_id, 0, 5) == "turbo") err("TurboBT is banned.");
if (preg_match("/MLDonkey\/([0-9]+).([0-9]+).([0-9]+)*/", $agent, $matches)) err("MLDonkey is not a BT client.");
if (preg_match("/ed2k_plugin v([0-9]+\\.[0-9]+).*/", $agent, $matches)) err("eDonkey is not a BT client.");

//
Reply With Quote