{"id":26212327,"url":"https://github.com/hackinggate/country-ip-blocks","last_synced_at":"2025-04-15T15:22:14.406Z","repository":{"id":98541884,"uuid":"177807723","full_name":"HackingGate/Country-IP-Blocks","owner":"HackingGate","description":"Latest country IP ranges in CIDR notation updates at the end of every week day (Monday to Friday at 9:22PM UTC)","archived":false,"fork":false,"pushed_at":"2025-04-11T21:31:40.000Z","size":86326,"stargazers_count":41,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T22:33:35.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hackinggate.github.io/Country-IP-Blocks/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HackingGate.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,"zenodo":null}},"created_at":"2019-03-26T14:41:18.000Z","updated_at":"2025-04-09T15:04:54.000Z","dependencies_parsed_at":"2024-07-23T01:14:44.334Z","dependency_job_id":"bdabefbc-8229-4b1b-86e9-649f5732d2c5","html_url":"https://github.com/HackingGate/Country-IP-Blocks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackingGate%2FCountry-IP-Blocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackingGate%2FCountry-IP-Blocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackingGate%2FCountry-IP-Blocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackingGate%2FCountry-IP-Blocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HackingGate","download_url":"https://codeload.github.com/HackingGate/Country-IP-Blocks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249095197,"owners_count":21211880,"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":[],"created_at":"2025-03-12T08:29:54.501Z","updated_at":"2025-04-15T15:22:14.380Z","avatar_url":"https://github.com/HackingGate.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Country-IP-Blocks\n[![GitHub](https://img.shields.io/github/license/HackingGate/Country-IP-Blocks.svg)](https://github.com/HackingGate/Country-IP-Blocks/raw/master/LICENSE)\n[![CI](https://github.com/HackingGate/Country-IP-Blocks/actions/workflows/ci.yml/badge.svg)](https://github.com/HackingGate/Country-IP-Blocks/actions/workflows/ci.yml)\n[![pages-build-deployment](https://github.com/HackingGate/Country-IP-Blocks/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/HackingGate/Country-IP-Blocks/actions/workflows/pages/pages-build-deployment)\n\nGenerate the latest country IP ranges in CIDR notation\n\n## How it works\n\nThe shell script `generate.sh` will download the latest RIR statistics files ([RIR statistics exchange format](https://www.apnic.net/about-apnic/corporate-documents/documents/resource-guidelines/rir-statistics-exchange-format/)) from the following five Regional Internet Registries (RIRs).\n\n[![rir-map.svg](https://www.iana.org/_img/2013.1/rir-map.svg)](https://www.iana.org/numbers)\n\nURLs:\n\n```sh\nhttps://ftp.apnic.net/stats/apnic/delegated-apnic-latest\nhttps://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest\nhttps://ftp.ripe.net/ripe/stats/delegated-ripencc-latest\nhttps://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-latest\nhttps://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-latest\n```\n\nIt then grabs entries from the files above. Generate `country_code.txt`. Convert IP ranges to CIDR notation. Generate IP files for each country.\n\n### Example\n\nGenerate Japan IPv4 ranges from [APNIC](https://www.apnic.net) and save them to `JP_IPv4.txt`.\n\n```sh\ncurl -sL https://ftp.apnic.net/stats/apnic/delegated-apnic-latest | \\\ngrep \"apnic|JP|ipv4\" | \\\nawk -F '|' '{ printf(\"%s/%d\\n\", $4, 32-log($5)/log(2)) }' | \\\ntee JP_IPv4.txt\n```\n\n## Usage\n\nThis will generate all countries and save IP files to your current directory.\n\n```sh\ncurl -sL https://github.com/HackingGate/Country-IP-Blocks/raw/master/generate.sh | sh\n```\n\nThe country code is under [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) standard.\n\n## GitHub Pages\n\nThe following files are hosted on GitHub Pages.\n\n- Mirror files of `delegated-*-latest`\n- `country_code.txt`\n- Country IP Block files\n\nAvailable at [https://hackinggate.github.io/Country-IP-Blocks/](https://hackinggate.github.io/Country-IP-Blocks/)\n\nand auto-updates by [GitHub Workflows](https://github.com/HackingGate/Country-IP-Blocks/actions).\n\n## IP change history\n\nSince this project uses git.\n\nYou can view IP changes from [gh-pages branch](https://github.com/HackingGate/Country-IP-Blocks/tree/gh-pages).\n\nSuch as comparing files between git commits to see when and what entries are added or deleted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackinggate%2Fcountry-ip-blocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackinggate%2Fcountry-ip-blocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackinggate%2Fcountry-ip-blocks/lists"}