Code Monkey home page Code Monkey logo

pg2ipset's Introduction

======== ABOUT

Information:

http://ipset.netfilter.org/

https://wiki.archlinux.org/index.php/Ipset

http://www.maeyanie.com/2008/12/efficient-iptables-peerguardian-blocklist/

pg2ipset takes the contents of PG2 IP Blocklists and outputs lists that ipset under Linux can consume, for more efficient blocking than most other methods.

The ipset-update.sh script helps import these and plain text based blocklists easily, for scheduling via cron.

======== INSTALLATION

make build && make install

(or just run make as root)

======== CONFIGURATION

See the comments above each variable and array in the ipset-update.sh script to configure it to block the ip lists of your choosing.

======== USAGE

To manually import from a .txt list from bluetack:

cat /path/to/blocklist.txt | pg2ipset - - listname | ipset restore

To manually import from a .gz list:

zcat /path/to/blocklist.gz | pg2ipset - - listname | ipset restore

To manually import a txt list of only IP addresses and/or CIDR ranges, make sure to remove all comments and empty lines, then do the following:

awk '!x[$0]++' /path/to/blocklist.txt | sed -e "s/^/\-A\ \-exist\ listname\ /" | grep -v \# | grep -v ^$ | ipset restore

Help text: Usage: ./pg2ipset [ [ []]] Input should be a PeerGuardian .p2p file, blank or '-' reads from stdin. Output is suitable for usage by 'ipset restore', blank or '-' prints to stdout. Set name is 'IPFILTER' if not specified. Example: curl http://www.example.com/guarding.p2p | ./pg2ipset | ipset restore

======== AUTOMATIC LIST UPDATING

Be friendly and don't update more than once every 24 hours. Bluetack likely changes the obfuscated list URLS regularly, too.

0 0 * * * sh /path/to/ipset-update.sh >/dev/null 2>&1

======== LICENSE

pg2ipset.c - Convert PeerGuardian lists to IPSet scripts.
Copyright (C) 2009-2010, [email protected]

ipset-update.sh - Automatically update and import pg2 format
and text based ipset blocklists.
Copyright (C) 2012-2015, [email protected]

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

pg2ipset's People

Contributors

trajano avatar mynamewastaken avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.