Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[ADDON] Peerguardian blocklist import
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-02-13 12:08:50
I have taken this from Torrentstrike, it seems to work but there is one small problem that is probably easy to fix.

this is the importpg.php file:

<?

// This script downloads/adds/updates peerguardian IP ranges in the bans table.



require_once ("backend/functions.php");

dbconn();



header("Content-type: text/plain");



if (!$CURUSER || $CURUSER["class"]<"7")die;{



$url = "http://mirror.thesynapse.org/phoenixlabs/lists/level1.php";





$f = @fopen($url, "r");

if (!$f)

 show_error_msg("Cannot download: " . htmlspecialchars($url));



mysql_query("DELETE FROM bans WHERE comment LIKE 'PeerGuardian: %'") or sqlerr(__FILE__, __LINE__);



$uid = $CURUSER["id"];

$n = 0;

$o = 0;

$dt = sqlesc(get_date_time());

while (!feof($f))

{

++$o;

$s = rtrim(fgets($f));

$i = strrpos($s, ":");

if (!$i) continue;

$comment = sqlesc("PeerGuardian: " . substr($s, 0, $i));

$s = substr($s, $i + 1);

$i = strpos($s, "-");

$first = ip2long(substr($s, 0, $i));

$last = ip2long(substr($s, $i + 1));

if ($first == -1 || $last == -1) continue;

mysql_query("INSERT INTO bans (added, addedby, comment, first, last) VALUES($dt, $uid, $comment, $first, $last )")or die(mysql_error());

$res = mysql_query($query) or sqlerr(__FILE__, __LINE__);

if (mysql_affected_rows() != 1)

show_error_msg("Database insertion failed (" . htmlspecialchars($query) . ").");

++$n;

}

$o -= $n;

print("Source: " . htmlspecialchars($url) . "\n$n ranges imported, $o line(s) was discarded.");



}



?>



now the problem is when i run that it tells me:

Source: [url="http://mirror.thesynapse.org/phoenixlabs/lists/level1.php"]http://mirror.thesynapse.org/phoenixlabs/lists/level1.php[/url]

0 ranges imported, 11521 line(s) was discarded.

so as you can see the script works, but for some reason it will not import to the database. i adapted the script to  TorrentTrader v2.03 as much as i could but i think there is something missing. [size=12px]so if somebody could please help!!!!!!!!![/size]
Unknown User
2008-02-13 12:37:35
Try this:

admincp.php, find:

#======================================================================

# Peer Guardian Import

#======================================================================#

if($action == "peerg")

{

stdhead();

navmenu();

begin_frame("Peer Guardian Importer", center);

// change the following to your  .p2p location

$f = fopen("hxxp://www.ishtar.ca/guarding.p2p", "r");

if (!$f)

die("Cannot download guarding.p2p!");

mysql_query("DELETE FROM bans WHERE comment LIKE 'PeerGuardian: %'") or die(mysql_error());

$n = 0;

$o = 0;

$dt = sqlesc(get_date_time());

while (!feof($f))

{

++$o;

$s = rtrim(fgets($f));

$i = strrpos($s, ":");

if (!$i) continue;

$comment = sqlesc("PeerGuardian: " . substr($s, 0, $i));

$s = substr($s, $i + 1);

$i = strpos($s, "-");

$first = ip2long(substr($s, 0, $i));

$last = ip2long(substr($s, $i + 1));

if ($first == -1 || $last == -1) continue;

mysql_query("INSERT INTO bans (added, addedby, first, last, comment) VALUES($dt, $uid, $first, $last, $comment)") or die(mysql_error());

++$n;

}

$o -= $n;

print("$n ranges imported, $o line(s) was discarded.");

end_frame();

}

Download that .gz file, gunzip it, rename it guarding.p2p, and change the link in the code above, worked in test encironment on TT 2.03 (SVN). 205354 ranges imported, 0 line(s) was discarded. Though the ban system really needs more work for this to actually work :S

peerg.gif
peerg.gif
Unknown User
2008-02-13 13:16:39
another stupid questin but this is for what?
Unknown User
2008-02-13 15:51:46
"SpaZiuR, post: 38902":
another stupid questin but this is for what?

this is to help you keep some of the buy guys away.

thank you very much ezerbeth i have tested it and it works like a charm along with this reply to a post i made for banning individual ip. [url="http://www.torrenttrader.org/index.php?showtopic=7209&st=0#entry38874"]http://www.torrenttrader.org/index.php?sho...st=0#entry38874[/url]   :)
Unknown User
2008-02-13 17:09:33
I dont see any announce ban code anywhere yet.. so it's kinda pointless if you ask me...
Unknown User
2008-02-13 19:49:14
"Ezerbeth, post: 38921":
I dont see any announce ban code anywhere yet.. so it's kinda pointless if you ask me...

it is good enough for me because now when somebody reaches my site with a banned address it tells them they can not access the page.
Unknown User
2008-02-13 21:35:23
Yeah but if I'm a member on your site, and my "friend" has a banned IP, I can just send him the torrent and he can leech it at will... so yeah it's a basic security but anyone who's motivated or knows there's no announce ban can work around the ban :\

Edit: I'll look at the announce ban code in the next couple of days when I have some time...

Edit2: Also, before you import the PG file, make sure your IP (range) is not listed in there or you might get some weird unexpected results on your tracker (banning yourself is bad  :)  ) -- mine was.

My big problem with peer guardian is that they use a list not maintained by themselves. Have you ever tried to get an IP removed from it? Remember the BOPM days?? I sure do...... I'll look into using public DNSBL instead of PG for bans, since public DNSBL actually have maintainers and/or automated scripts to remove unjustified banned IPs from the list. (PG sucks!)
Unknown User
2008-02-13 23:45:46
"Ezerbeth, post: 38944":
Yeah but if I'm a member on your site, and my "friend" has a banned IP, I can just send him the torrent and he can leech it at will... so yeah it's a basic security but anyone who's motivated or knows there's no announce ban can work around the ban :\
Edit: I'll look at the announce ban code in the next couple of days when I have some time...

Edit2: Also, before you import the PG file, make sure your IP (range) is not listed in there or you might get some weird unexpected results on your tracker (banning yourself is bad  :D  ) -- mine was.

My big problem with peer guardian is that they use a list not maintained by themselves. Have you ever tried to get an IP removed from it? Remember the BOPM days?? I sure do...... I'll look into using public DNSBL instead of PG for bans, since public DNSBL actually have maintainers and/or automated scripts to remove unjustified banned IPs from the list. (PG sucks!)


but if somebody from my site was letting peeps use theor passkey then i would ban them  :)  i banned myself to see if the banning system works and it did. as far as peer guardian i will stick with them for the moment and i may use some of the DNSBL list. i like the pg because it blocks the anti-piracy peeps, who even if you are not doing anything illegal like to try to put an end to all trackers. thank you for your help.
Unknown User
2008-02-14 00:12:00
Yeah, PG is not *completely* useless, they DO ban ranges that need to be banned, but the problem is they also seem to randomly ban lots of other ranges for no reason. They banned my *entire* data center (that's over 5 million IP addresses :S ) because they're not p2p-friendly.... well according to PG. I've been spreading warez for over 3 years on that data center (FXP and torrents), with the same IPs and systems .. Hell I transfer over 30TB per month .. but about 3 months ago they decided I was not P2P friendly and banned me, and I can't get unbanned :| Of course I could (and did) request new IP ranges from my data center, only to confirm they banned the entire company :\

Now to "fix" all that BS, I had to put up a nice little notice to all my users, and add it to the welcome message, that you CANNOT use PG on my tracker, since you'll ban the main seed. Users are still protected (thanks to the site bans) but that means I lose lots of users .. all because PG are too dumb to maintain their list and the third party is too dumb to remove bans (they actually deleted all my posts from their forums ..   :)  ). Users think "I cant secure myself, I'm not going there!" even though I actually *firewalled* (not banned on the site) all the relevant PG IPs :\
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728