{
"info": {
"author": "Sergey Arkhipov",
"author_email": "serge@aerialsounds.org",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Topic :: Internet :: WWW/HTTP :: Site Management :: Link Checking",
"Topic :: System :: Networking :: Firewalls",
"Topic :: Utilities"
],
"description": "iblocklist2ipset\n=========\n\n|Build Status| |Coverage Status| |Health Status|\n\niblocklist2ipset is a small utility (really small, check out sources)\nto manage your favourite `iblocklists `__\nwith `IPSets `__.\n\nAll it does, it converts lists from P2P format to the format compatible with\n``ipset restore``. Basic usage is following:\n\n.. code-block:: bash\n\n $ iblocklist2ipset generate \\\n --ipset idiots\n \"http://list.iblocklist.com/?list=usrcshglbiilevmyfhse&fileformat=p2p&archiveformat=gz\" \\\n > ~/.ipset\n $ sudo ipset restore -f ~/.ipset\n\nAnd you are done.\n\nNow let's try to figure out why do you need it (and you need it).\n\n\nWhy do you need it\n------------------\n\nLet's imagine you are living in a country where DMCA makes sense and you\nwant to make your seedbox safe but you can't use PeerGuardian or PeerBlock\nbecause it sucks on Linux so you decide to use iptables + ipset so...\n\nWait. It looks like a tool for... piracy? No, of course it is not. Let's start\nagain.\n\nLet's imagine you have some kind of server (bare metal or cloud VM) and you are\nrunning some mission critical software on it. You do not like botnets or EVIL HACKERS\nso want to block all of them to have some good feeling of safety. You heard about\nblocklists supplied by `BlueTack `__ and wanna use them.\n\nBut pure iptables import sucks. iptables actually is a pretty dumb tool for shiny\nnetfilter and it sucks back and forth if you have a lot of rules (linear complexity\nis WTF in 2014, right?). You googled and found amazing `ipset `__\ntool which integrates with iptables perfectly. Lovely. Let's use it.\n\nSo this tool just converts gzipped P2P lists into something you can give to\nipset to restore, right? This is a missing tool and you definitely want it.\n\nWhy not to use PeerGuardian etc?\n--------------------------------\n\nGood question. Actually they are pretty heavyweight and do almost nothing. It is just a\nfirewall after firewall you already have installed. Look, basically combination of iptables,\nipset and iblocklist2ipset with cron gives you the same features.\n\nMoreover, I want to setup it once and do not worry about anything else. PeerGuardian is\ngreat if you are running this tool on desktop but not on a remote machine. Basically it looks\nas excess.\n\nExamples\n--------\n\nWell, to give you a feel of a tool, let's just execute it as is:\n\n.. code-block:: bash\n\n $ iblocklist2ipset -h\n Small utility to convert p2p format of IP Blocklists to IPSet format.\n\n Usage:\n iblocklist2ipset generate [options] BLOCKLIST_URL...\n iblocklist2ipset example_restore_ipset_job [options] IPTABLES_NAME IPSET_PATH\n iblocklist2ipset example_update_ipset_job [options] IPSET_PATH BLOCKLIST_URL...\n iblocklist2ipset -h | --help\n iblocklist2ipset --version\n\n Options:\n -h --help Shows this screen.\n --version Shows version and exits.\n -i IPSET_NAME --ipset=IPSET_NAME The name of IPSet set [default: blocklist]\n\n To get IP blocklists please visit https://www.iblocklist.com/\n\nSo as you can see, usage is pretty straightforward. You can give it multiple blocklist\nURLs and it will generate you correct file you can restore with ``ipset restore``. Let's do\nit with *hijacked* list:\n\n.. code-block:: bash\n\n $ iblocklist2ipset generate \\\n \"http://list.iblocklist.com/?list=usrcshglbiilevmyfhse&fileformat=p2p&archiveformat=gz\" \\\n > ipset_to_restore\n $ head ipset_to_restore\n create blocklist hash:net family inet hashsize 512 maxelem 536\n add blocklist 81.22.152.0/23\n add blocklist 91.220.163.0/24\n add blocklist 206.209.80.0/20\n add blocklist 204.187.254.0/24\n add blocklist 103.12.216.0/22\n add blocklist 193.0.146.0/23\n add blocklist 208.90.0.0/21\n add blocklist 110.232.160.0/20\n add blocklist 91.213.148.0/24\n\nQuite nice, isn't it? It calculated proper sizes for our list also. Now you can just import it\n\n.. code-block:: bash\n\n $ sudo ipset -f ipset_to_restore\n\nAnd you are safe.\n\nNot really, you need to setup iptables etc to get it work. No problems, if you are using the same\nconfiguration all the times, you can use ``example_restore_ipset_job`` and ``example_update_ipset_job``\ncommands to get some examples of the usage.\n\nReal world example\n------------------\n\nI have my Raspberry Pi running some mission critical software (BTSync for example) and I want to use\n`*hijacked* list from IBlockList.com `__.\n\nI have a Raspbian up to date and now I want to use this shiny tool. First, let's install it.\n\n.. code-block:: bash\n\n $ sudo pip install iblocklist2ipset\n $ sudo apt-get install -y ipset\n\n(ipset is not bundled by default so install it before).\n\nI want to store an ipset blocklist into ``/etc/ipset.rules``.\n\n.. code-block:: bash\n\n $ iblocklist2ipset example_restore_ipset_job \\\n -i hijacked blocklist \\\n /etc/ipset.rules \\\n > ~/scripts/ipset_restore.sh\n $ chmod +x ~/scripts/ipset_restore.sh\n\nNow we created shell scripts. On execution it will restore iptables and ipset configuration. Please\nbe noticed that ``iblocklist2ipset`` understands virtualenv usage and script is generated with this\nknowledge also.\n\n.. code-block:: bash\n\n $ iblocklist2ipset example_update_ipset_job \\\n -i hijacked \\\n /etc/ipset.rules \"http://list.iblocklist.com/?list=usrcshglbiilevmyfhse&fileformat=p2p&archiveformat=gz\" \\\n > ~/scripts/ipset_update.sh\n $ chmod +x ~/scripts/ipset_update.sh\n\nLovely. Now we have a script to update. Let's update crontab then\n\n.. code-block:: bash\n\n @reboot /home/user/scripts/ipset_restore.sh\n @midnight /home/user/scripts/ipset_update.sh\n\nWhy not to store this stuff into iptables permanently? Well this is mostly because of\nipset configuration. It loses it on reboot and it is not really trivial to restore it.\n\nProbably one day I will do it but right now it has to be like this. At least it works\nfor me.\n\nCheers.\n\n.. |Build Status| image:: https://travis-ci.org/9seconds/iblocklist2ipset.svg?branch=master\n :target: https://travis-ci.org/9seconds/iblocklist2ipset\n\n.. |Coverage Status| image:: https://coveralls.io/repos/9seconds/iblocklist2ipset/badge.png?branch=master\n :target: https://coveralls.io/r/9seconds/iblocklist2ipset?branch=master\n\n.. |Health Status| image:: https://landscape.io/github/9seconds/iblocklist2ipset/master/landscape.png\n :target: https://landscape.io/github/9seconds/iblocklist2ipset/master\n :alt: Code Health",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/9seconds/iblocklist2ipset/",
"keywords": null,
"license": "MIT",
"maintainer": null,
"maintainer_email": null,
"name": "iblocklist2ipset",
"package_url": "https://pypi.org/project/iblocklist2ipset/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/iblocklist2ipset/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/9seconds/iblocklist2ipset/"
},
"release_url": "https://pypi.org/project/iblocklist2ipset/0.0.1/",
"requires_dist": null,
"requires_python": null,
"summary": "Converter between P2P lists from IBlocklist.com to IPSet",
"version": "0.0.1"
},
"last_serial": 1193659,
"releases": {
"0.0.1": [
{
"comment_text": "",
"digests": {
"md5": "4f203df27ccf2a00d4f30ae9566613fd",
"sha256": "783a371db6420d898c2f5b16670758e9ccba08467b4c1d268edf46ad97d50e65"
},
"downloads": -1,
"filename": "iblocklist2ipset-0.0.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "4f203df27ccf2a00d4f30ae9566613fd",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 11808,
"upload_time": "2014-08-18T07:49:57",
"url": "https://files.pythonhosted.org/packages/5e/a8/859d764e05f58b3bbc302195a1a14be0b756dd11d40f69b61ec05e1e6ea7/iblocklist2ipset-0.0.1-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "b1cd2f98243ac0f839d89f2d1a71bae7",
"sha256": "b442523b3a84934fb2f6c2dadc758e99f56066a23d1236e9e0e80bea74ea5d49"
},
"downloads": -1,
"filename": "iblocklist2ipset-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "b1cd2f98243ac0f839d89f2d1a71bae7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7366,
"upload_time": "2014-08-18T07:48:58",
"url": "https://files.pythonhosted.org/packages/ca/00/a37c122ebbba72ece01e2811e84f9c5c3c71743202c398ce5f2554b76319/iblocklist2ipset-0.0.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "4f203df27ccf2a00d4f30ae9566613fd",
"sha256": "783a371db6420d898c2f5b16670758e9ccba08467b4c1d268edf46ad97d50e65"
},
"downloads": -1,
"filename": "iblocklist2ipset-0.0.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "4f203df27ccf2a00d4f30ae9566613fd",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 11808,
"upload_time": "2014-08-18T07:49:57",
"url": "https://files.pythonhosted.org/packages/5e/a8/859d764e05f58b3bbc302195a1a14be0b756dd11d40f69b61ec05e1e6ea7/iblocklist2ipset-0.0.1-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "b1cd2f98243ac0f839d89f2d1a71bae7",
"sha256": "b442523b3a84934fb2f6c2dadc758e99f56066a23d1236e9e0e80bea74ea5d49"
},
"downloads": -1,
"filename": "iblocklist2ipset-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "b1cd2f98243ac0f839d89f2d1a71bae7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7366,
"upload_time": "2014-08-18T07:48:58",
"url": "https://files.pythonhosted.org/packages/ca/00/a37c122ebbba72ece01e2811e84f9c5c3c71743202c398ce5f2554b76319/iblocklist2ipset-0.0.1.tar.gz"
}
]
}