{"id":16356401,"url":"https://github.com/mitchellkrogza/badips.com-hosts-file-generator","last_synced_at":"2026-02-22T22:04:18.412Z","repository":{"id":86668263,"uuid":"86148108","full_name":"mitchellkrogza/Badips.com-Hosts-File-Generator","owner":"mitchellkrogza","description":"A simple shell script to pull a daily list of known bad hosts from badips.com and create an /etc/hosts.deny file for you. Only hosts with a level 5 (bad) are pulled daily from badips.com","archived":false,"fork":false,"pushed_at":"2017-04-04T14:51:58.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T05:42:29.409Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitchellkrogza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-03-25T10:01:21.000Z","updated_at":"2024-05-05T08:22:49.000Z","dependencies_parsed_at":"2023-05-20T08:00:42.558Z","dependency_job_id":null,"html_url":"https://github.com/mitchellkrogza/Badips.com-Hosts-File-Generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mitchellkrogza/Badips.com-Hosts-File-Generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellkrogza%2FBadips.com-Hosts-File-Generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellkrogza%2FBadips.com-Hosts-File-Generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellkrogza%2FBadips.com-Hosts-File-Generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellkrogza%2FBadips.com-Hosts-File-Generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitchellkrogza","download_url":"https://codeload.github.com/mitchellkrogza/Badips.com-Hosts-File-Generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellkrogza%2FBadips.com-Hosts-File-Generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29729089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T20:09:16.275Z","status":"ssl_error","status_checked_at":"2026-02-22T20:09:13.750Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-11T01:43:30.182Z","updated_at":"2026-02-22T22:04:18.391Z","avatar_url":"https://github.com/mitchellkrogza.png","language":"Shell","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=BKF9XT6WHATLG):beer"],"categories":[],"sub_categories":[],"readme":"# Badips.com hosts.deny File Generator\n\nA simple shell script to pull a daily list of known bad hosts from badips.com and create an /etc/hosts.deny file for you. \nOnly hosts with a level 5 (very bad) and level 3 (bad) are pulled daily from badips.com.\n\n- https://github.com/mitchellkrogza/Badips.com-Hosts-File-Generator\n\n## ABOUT\n\nShell script for blocking IPs which have been reported to http://www.badips.com. This writes IP entries to your hosts.deny file on Linux and immediately blocks all the Bad Ip's it collects from accessing SSH on your server\n\nI run this as a daily cron to always have the freshest set of IP's and I collect only those IP addresses blocked by badips.com with a levels of 5 (very bad) within a 6 month period and pulls any IP's with a level 3 (bad) using your private key.\n\nThis script uses the key method - you need your own key from badips.com, on my servers this script takes all of 4-5 seconds to complete.\n\n## INSTALLATION\n\n`cd /usr/sbin`\n\n`sudo wget https://raw.githubusercontent.com/mitchellkrogza/Badips.com-Hosts-File-Generator/master/badips2hostsdeny.sh -O badips2hostsdeny.sh`\n\nMake the file executable\n\n`sudo chmod 700 /usr/sbin/badips2hostsdeny.sh`\n\n## RUNNING IT AS CRON\n\nA cron for this would be as follows (substitute your own email address)\n\n`30 22 * * * /usr/sbin/badips2hostsdeny.sh | mail -s \"Bad IPs updated on `uname -n`\" me@mydomain.com`\n\nThe above cron will run every night at 22:30 and email you to tell you it was updated.\n\nOn a daily basis this list will vary in length from 13000 - 25000 Bad IP entries\n\nIf you play with the variables _age and _level you could increase this to a much larger list but it is really not necessary as this script extracts only those IP's scored with a very high score on badips.com - ie. only those who have repeat offended and been reported by multiple people.\n\n## GET OUR OWN PRIVATE KEY\n\nMake sure you get your own key from badips.com and add it below in the _keyservice field before running this\n\n`sudo wget https://www.badips.com/get/key -qO -`\n\nSee - https://www.badips.com/documentation\n\n# ERRORS\n\nAn error on the first run is normal \"tail: invalid number of lines: ‘/etc/hosts.deny’\"\n\nAvoid this by first adding the comment block into your exising hosts.deny file\n\nThe Comment Block is the two lines below copy and paste it into your hosts.deny file\n\n```\n# ##### START badips.com Block List — DO NOT EDIT #####\n# ##### END badips.com Block List #####\n```\n\nReport any issues on https://github.com/mitchellkrogza/Badips.com-Hosts-File-Generator\n\n# KEEP BAD BOTS AT BAY !!!\n\nCheck out my highly popular Nginx and Apache Bad Bot Blockers\n\n**NGINX ULTIMATE BAD BOT BLOCKER**\n\nhttps://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker\n\n**APACHE ULTIMATE BAD BOT BLOCKER**\n\nhttps://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker\n\nUse the bad bot bot blockers in conjuction with this Badips.com hosts.deny and you will keep almost every bad IP and bot out there out of your servers.\n\nCome drop by and visit me also at https://mitchellkrog.com\n\n### If this helps you why not [buy me a beer](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=BKF9XT6WHATLG):beer:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellkrogza%2Fbadips.com-hosts-file-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitchellkrogza%2Fbadips.com-hosts-file-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellkrogza%2Fbadips.com-hosts-file-generator/lists"}