{"id":18337731,"url":"https://github.com/agarzon/badboys","last_synced_at":"2025-04-09T20:18:32.383Z","repository":{"id":214427768,"uuid":"614582454","full_name":"agarzon/badboys","owner":"agarzon","description":"Download bad IP addresses from different sources and block them using iptables and ipset","archived":false,"fork":false,"pushed_at":"2023-12-28T14:03:59.000Z","size":15,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T20:18:29.528Z","etag":null,"topics":["blacklist","chatgpt","firewall","ipset","iptables","python","whitelist"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agarzon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-15T22:15:29.000Z","updated_at":"2023-03-15T22:32:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"322334f0-95e2-439e-b88a-a3dbd2387bd7","html_url":"https://github.com/agarzon/badboys","commit_stats":null,"previous_names":["agarzon/badboys"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agarzon%2Fbadboys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agarzon%2Fbadboys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agarzon%2Fbadboys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agarzon%2Fbadboys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agarzon","download_url":"https://codeload.github.com/agarzon/badboys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103910,"owners_count":21048246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blacklist","chatgpt","firewall","ipset","iptables","python","whitelist"],"created_at":"2024-11-05T20:12:07.919Z","updated_at":"2025-04-09T20:18:32.350Z","avatar_url":"https://github.com/agarzon.png","language":"Python","readme":"# Badboys - A simple python script to block bad IP addresses\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"badboys\" title=\"badboys\" src=\"https://user-images.githubusercontent.com/339828/225473301-c80d16a2-7df7-408e-90eb-8888aef9e25c.svg\" width=\"450\"\u003e\n\u003c/p\u003e\n\nA very simple python script to get bad IP addresses from a different URL and block them with iptable using ipset.\n\nThis script downloads bad IP addresses from different sources, removes whitelisted IPs from the list (supports subnet range CIDR), and then adds the remaining bad IPs to an ipset using the ipset command. It also flushes the existing ipset before adding the new bad IPs to it.\n\nYour machine public IP address is automatically added to the whitelist.\n\nThis script was inspired by: https://github.com/trick77/ipset-blacklist which I used for many many years.\n\nBut I felt that I want to redo it from scratch and make it more simple and easy to use but with Python.\n\nIt worth mentioning that this script was made possible thanks to chatGPT. Even though I do not code in Python, I was able to make this script thanks to chatGPT in no more than 2 hours. Even the logo was made by chatGPT 😮!\n\nThe Dockerfile was used for me only during the development phase and it is not needed for the script to work.\n\n## Requirements\n\n    - Python 3\n    - ipset\n    - iptables\n\n# Imstall dependencies\n\n`pip3 install -r requirements.txt`\n\n# Usage\n\nCreate your own config.yaml file based on sample.config.yaml and then run the script with:\n\n`python3 badboys.py`\n\n# DEBUG\n\nI use this code to see how many entryes are in the ipset\n\n`ipset list badboys | grep 'Number of entries' | cut -d' ' -f4`\n\n## Licence\n\nMIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagarzon%2Fbadboys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagarzon%2Fbadboys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagarzon%2Fbadboys/lists"}