![]() |
|
Register | FAQ | The Twelve Commandments | Members List | Calendar | Arcade | Find the Best VPN | Today's Posts | Search |
Development Open Discussion Anything else about the Phex development |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
| |||
![]() it's not polished at all and frankly I don't know if it's even importing the entirety of the massive peerguardian list, but I made it and figured maybe some others would use it too. Don't blame me if anything bad happens, this program was written hastily for my own use. It WILL NOT warn you if you attempt to overwrite an existing file! The only potentially dangerous line is the one where you set the output file path. GET IT RIGHT! For this reason i'm leaving it without a file path prompt, hoping that people smart enough to edit the line of code will be smart enough not to overwrite their files. This program is also not smart enough to keep your existing rules so you will have to redo them. For those adventurous enough to try it, just place the code into a file(.pl extension on windows), set the paths, and run it from DOS prompt(assuming Perl is installed). Linux users will need to put in the shebang line cuz i'm too lazy to. I tried to comment as best I could but the programming is still hackish and kinda hard to understand. Theres also a good chance I created a couple syntax errors while transferring it to the forum. Perhaps a good future Phex feature(haha that rhymes) would be to support importing peerguardian block lists? I would probably do it but I can't program C ![]() Code: open (FROM,'C:/documents and settings/bob/desktop/list.p2p');#change this to the path of the exported peerguardian list open (TO,'>C:/Documents and Settings/bob/phex/security.xml');#change this to the path of phex's security.xml (usually in documents and settings under the current user) $totalnum=0; $totalnum++ while(<FROM>);#counts lines in file seek(FROM,0,0);#resets read pointer print TO <<HERE;#here document pastes default beginning of file <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <phex phex-version="2.8.10.98"> <security> HERE $counter=0; $time=time();#so I can print status every few seconds while(<FROM>)#goes line by line { m/(.*):(.*)-(.*)\n/;#seperates PG listing into addresses and description @ary=map {uc(sprintf("%x",$_))} split(/\./,$2);#convert starting IP adress to hex(format Phex uses) and makes it uppercase foreach(@ary)#adds a 0 if neccesary to adress { $_="0$_" if(length $_==1); } $startad=join "",@ary;#completed starting adress @ary=map {uc(sprintf("%x",$_))} split(/\./,$3);#convert ending IP adress to hex(format Phex uses) and makes it uppercase foreach(@ary)#adds a 0 if neccesary to adress { $_="0$_" if(length $_==1); } $endad=join "",@ary;#completed ending adress $desc=$1; $desc=~y/a-zA-Z0-9. -//cd;#gets rid of chars in the PG descriptions that Phex doesn't like push (@adresses," <ip-access-rule> <description>$desc</description> <isDenyingRule>true</isDenyingRule> <isDisabled>false</isDisabled> <triggerCount>0</triggerCount> <expiryDate>9223372036854775807</expiryDate> <isDeletedOnExpiry>false</isDeletedOnExpiry> <addressType>3</addressType> <ip>$startad</ip> <compareIP>$endad</compareIP> </ip-access-rule> ");#this huge line is what prints completed rule entries $counter++;#keeps track of how many lines are done if(time()>$time+1)#prints status { $time=time(); $cent=int($counter/$totalnum*100); print "$cent % done $counter records out of $totalnum\n"; } if(!($counter%4000))#flushes lines to disk every 4000(speed optimization) { print TO join( "",@adresses); @adresses=(); } } print TO <<HERE;#prints default file ending </security> </phex> HERE #the newline at the end of HERE was really important so I put a comment here to force you to leave the newline Last edited by blahblahblabh; August 29th, 2006 at 02:20 PM. |
| |||
![]() Great work thanks... Phex currently compiles its security rules from bluetack.co.uk. It merges ranges from the following lists: Hijacked IP Blocks IANA Reserved Level 1 Blocklist Spyware List Not sure how much overlapping it has with peerguardian. Here is the file that shoes the complete blocked ranges used: http://svn.sourceforge.net/viewvc/ph...fg?view=markup BTW: You can remove the lower part of your script which adds "the default rules that came set on my phex". They are only used to store the trigger count across Phex sessions. Phex will still add its default rules when you remove these lines. The only thing you loose is the trigger count, which is only used for display/user information purpose. Also note that Phex handles type 2 (ip/mask) slightly more performant then type 3 (ranges) addresses. It could make a difference on large lists. |
![]() |
| |
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
list of providers that don't block file sharing apps | osu_uma | Connection Problems | 70 | January 21st, 2009 02:14 PM |
Here's my block list - what's yours look like? | nerryj | Download/Upload Problems | 2 | July 22nd, 2005 12:39 PM |
Adding large # of IP's to Phex block list? | noia | General Discussion | 1 | December 10th, 2003 08:27 AM |
block list | osu_uma | Open Discussion topics | 2 | June 21st, 2003 04:14 PM |
List of IPs to add to your BLOCK / DENY lists ! | Chateau | General Gnutella / Gnutella Network Discussion | 0 | November 28th, 2002 01:53 AM |