{"id":18464247,"url":"https://github.com/projectdiscovery/asnmap","last_synced_at":"2025-05-14T02:07:07.581Z","repository":{"id":60435144,"uuid":"542861539","full_name":"projectdiscovery/asnmap","owner":"projectdiscovery","description":"Go CLI and Library for quickly mapping organization network ranges using ASN information.","archived":false,"fork":false,"pushed_at":"2025-05-05T16:29:50.000Z","size":685,"stargazers_count":851,"open_issues_count":14,"forks_count":83,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-05-08T00:45:54.660Z","etag":null,"topics":["asn","asn-lookup","cidr-range","osint","recon"],"latest_commit_sha":null,"homepage":"","language":"Go","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/projectdiscovery.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":"2022-09-29T01:19:40.000Z","updated_at":"2025-05-06T15:49:34.000Z","dependencies_parsed_at":"2024-01-21T21:31:34.980Z","dependency_job_id":"d92be0ac-25ea-4ce2-8e86-cca4ff8b40f5","html_url":"https://github.com/projectdiscovery/asnmap","commit_stats":{"total_commits":273,"total_committers":11,"mean_commits":"24.818181818181817","dds":"0.19047619047619047","last_synced_commit":"9eed8411517b21980578b87a2fb2884adb57a846"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fasnmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fasnmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fasnmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fasnmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectdiscovery","download_url":"https://codeload.github.com/projectdiscovery/asnmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052747,"owners_count":22006716,"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":["asn","asn-lookup","cidr-range","osint","recon"],"created_at":"2024-11-06T09:09:15.270Z","updated_at":"2025-05-14T02:07:02.567Z","avatar_url":"https://github.com/projectdiscovery.png","language":"Go","readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/8293321/192910103-a5945f2c-fa82-45e1-8568-1e46898ff6c5.png\" alt=\"asnmap\" width=\"200px\"\u003e\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eGo CLI and Library for quickly mapping organization network ranges using \u003ca href=\"https://en.wikipedia.org/wiki/Autonomous_system_(Internet)\"\u003eASN\u003c/a\u003e information.\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://goreportcard.com/report/github.com/projectdiscovery/asnmap\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/projectdiscovery/asnmap\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/projectdiscovery/asnmap/issues\"\u003e\u003cimg src=\"https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/projectdiscovery/asnmap/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/projectdiscovery/asnmap\"\u003e\u003c/a\u003e\n\u003ca href=\"https://twitter.com/pdiscoveryio\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/pdiscoveryio.svg?logo=twitter\"\u003e\u003c/a\u003e\n\u003ca href=\"https://discord.gg/projectdiscovery\"\u003e\u003cimg src=\"https://img.shields.io/discord/695645237418131507.svg?logo=discord\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#running-asnmap\"\u003eRunning asnmap\u003c/a\u003e •\n  \u003ca href=\"https://discord.gg/projectdiscovery\"\u003eJoin Discord\u003c/a\u003e\n\u003c/p\u003e\n\n\n****\n\n\u003c/div\u003e\n\n# Features\n\n![image](https://user-images.githubusercontent.com/8293321/192092220-5d734305-fd3e-43fb-919a-91ff5296dfd2.png)\n\n\n- **ASN to CIDR** Lookup\n- **ORG to CIDR** Lookup\n- **DNS to CIDR** Lookup\n- **IP to CIDR** Lookup\n- **ASN/DNS/IP/ORG** input\n- **JSON/CSV/TEXT** output\n- STD **IN/OUT** support \n\n## Installation\n\nasnmap requires **Go 1.21** to install successfully. To install, just run the below command or download pre-compiled binary from [release page](https://github.com/projectdiscovery/asnmap/releases).\n\n```console\ngo install github.com/projectdiscovery/asnmap/cmd/asnmap@latest\n```\n\n## Usage\n\n```console\nasnmap -h\n```\n\nThis will display help for the tool. Here are all the flag it supports.\n\n```console\nUsage:\n  ./asnmap [flags]\n\nFlags:\nINPUT:\n   -a, -asn string[]     target asn to lookup, example: -a AS5650\n   -i, -ip string[]      target ip to lookup, example: -i 100.19.12.21, -i 2a10:ad40::\n   -d, -domain string[]  target domain to lookup, example: -d google.com, -d facebook.com\n   -org string[]         target organization to lookup, example: -org GOOGLE\n   -f, -file string[]    targets to lookup from file\n\nCONFIGURATIONS:\n   -config string           path to the asnmap configuration file\n   -r, -resolvers string[]  list of resolvers to use\n\nUPDATE:\n   -up, -update                 update asnmap to latest version\n   -duc, -disable-update-check  disable automatic asnmap update check\n\nOUTPUT:\n   -o, -output string  file to write output to\n   -j, -json           display json format output\n   -c, -csv            display csv format output\n   -v6                 display ipv6 cidr ranges in cli output\n   -v, -verbose        display verbose output\n   -silent             display silent output\n   -version            show version of the project\n```\n\n## Configuring ASNMap CLI\n\nASNMap CLI is built on top of the ASNMap API that requires API Token from [ProjectDiscovery Cloud Platform](https://cloud.projectdiscovery.io/?ref=api_key) that can be configured using environment variable or using interactive `-auth` option as shown below.\n\n### Using environment variable\n\n```console\nexport PDCP_API_KEY=*************\n```\n\n### Using auth option\n\n```console\nasnmap -auth\n\n\n   ___   _____  __              \n  / _ | / __/ |/ /_ _  ___ ____ \n / __ |_\\ \\/    /  ' \\/ _  / _ \\\n/_/ |_/___/_/|_/_/_/_/\\_,_/ .__/\n                         /_/ \n\n    projectdiscovery.io\n\n[INF] Get your free api key by signing up at https://cloud.projectdiscovery.io\n[*] Enter PDCP API Key (exit to abort): *************\n[INF] Successfully logged in as (@user)\n```\n\n## Running asnmap\n\n**asnmap** support multiple inputs including **ASN**, **IP**, **DNS** and **ORG** name to query ASN/CIDR information.\n\n\n| Input   | ASN       | DNS           | IP              | ORG      |\n| ------- | --------- | ------------- | --------------- | -------- |\n| Example | `AS14421` | `example.com` | `93.184.216.34` | `GOOGLE` |\n\n\n\nInput can be provided either using specific options or STDIN which accepts all the supported formats. Single, multiple (comma-separated) and file input is supported for all the options.\n\n```console\necho GOOGLE | ./asnmap -silent\n```\n\nExample input for asnmap:\n\n```console\nasnmap -a AS45596 -silent\nasnmap -i 100.19.12.21 -silent\nasnmap -d hackerone.com -silent\nasnmap -org GOOGLE -silent\n```\n\n### Default Run\n\n**asnmap** by default returns the CIDR range for given input.\n\n```console\necho GOOGLE | ./asnmap\n\n   ___   _____  __              \n  / _ | / __/ |/ /_ _  ___ ____ \n / __ |_\\ \\/    /  ' \\/ _  / _ \\\n/_/ |_/___/_/|_/_/_/_/\\_,_/ .__/\n                         /_/    v0.0.1\n\t\tprojectdiscovery.io\n\nUse with caution. You are responsible for your actions\nDevelopers assume no liability and are not responsible for any misuse or damage.\n\n8.8.4.0/24\n8.8.8.0/24\n8.35.200.0/21\n34.3.3.0/24\n34.4.4.0/24\n34.96.0.0/20\n34.96.32.0/19\n34.96.64.0/18\n34.98.64.0/18\n34.98.136.0/21\n34.98.144.0/21\n```\n### JSON Output\n\n**asnmap** by default displays CIDR range, and all the information is always available in JSON format, for automation and post processing using `-json` output is most convenient option to use.\n\n```console\necho hackerone.com | ./asnmap -json -silent | jq\n```\n\n```json\n{\n  \"timestamp\": \"2022-09-19 12:14:33.267339314 +0530 IST\",\n  \"input\": \"hackerone.com\",\n  \"as_number\": \"AS13335\",\n  \"as_name\": \"CLOUDFLARENET\",\n  \"as_country\": \"US\",\n  \"as_range\": [\n    \"104.16.0.0/14\",\n    \"104.20.0.0/16\",\n    \"104.21.0.0/17\"\n  ]\n}\n{\n  \"timestamp\": \"2022-09-19 12:14:33.457401266 +0530 IST\",\n  \"input\": \"hackerone.com\",\n  \"as_number\": \"AS13335\",\n  \"as_name\": \"CLOUDFLARENET\",\n  \"as_country\": \"US\",\n  \"as_range\": [\n    \"2606:4700:8390::/44\"\n  ]\n}\n```\n### CSV Output\n\n**asnmap** also support csv format output which has all the information just like JSON output\n\n```console\necho hackerone.com | ./asnmap -csv -silent\n```\n\n```console\ntimestamp|input|as_number|as_name|as_country|as_range\n2022-09-19 12:15:04.906664007 +0530 IST|hackerone.com|AS13335|CLOUDFLARENET|US|104.16.0.0/14,104.20.0.0/16,104.21.0.0/17\n2022-09-19 12:15:05.201328136 +0530 IST|hackerone.com|AS13335|CLOUDFLARENET|US|2606:4700:9760::/44\n```\n\n### Using with other PD projects\n\nOutput of asnmap can be directly piped into other projects in workflow accepting stdin as input, for example:\n\n- `echo AS54115 | asnmap | tlsx`\n- `echo AS54115 | asnmap | dnsx -ptr`\n- `echo AS54115 | asnmap | naabu -p 443`\n- `echo AS54115 | asnmap | naabu -p 443 | httpx`\n- `echo AS54115 | asnmap | naabu -p 443 | httpx | nuclei -id tech-detect`\n\n## Use asnmap as a library\n\nExamples of using asnmap from Go code are provided in the [examples](examples/) folder.\n\n## Acknowledgements\n\n- [Frank Denis](https://github.com/jedisct1/) for maintaining free IPtoASN database.\n\n-----\n\n\u003cdiv align=\"center\"\u003e\n\n**asnmap** is made with ❤️ by the [projectdiscovery](https://projectdiscovery.io) team and distributed under [MIT License](LICENSE).\n\n\n\u003ca href=\"https://discord.gg/projectdiscovery\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/projectdiscovery/nuclei-burp-plugin/main/static/join-discord.png\" width=\"300\" alt=\"Join Discord\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n","funding_links":[],"categories":["Weapons","Miscellaneous","osint"],"sub_categories":["Tools","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Fasnmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectdiscovery%2Fasnmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Fasnmap/lists"}