{"id":22901130,"url":"https://github.com/leolovenet/ipqqwry","last_synced_at":"2025-07-04T00:34:21.355Z","repository":{"id":57584047,"uuid":"371653972","full_name":"leolovenet/ipqqwry","owner":"leolovenet","description":"一个(包含)纯真IP库的单一可执行文件","archived":false,"fork":false,"pushed_at":"2024-12-09T09:18:31.000Z","size":18223,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T16:48:46.023Z","etag":null,"topics":["chunzhen","cli","geoip","golang","ip","qqwry","qqwry-ip-database","tcpdump"],"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/leolovenet.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":"2021-05-28T09:46:49.000Z","updated_at":"2025-02-23T14:21:14.000Z","dependencies_parsed_at":"2024-12-14T01:32:09.302Z","dependency_job_id":"e70eb173-ca0d-4a1d-adf8-562d731865b3","html_url":"https://github.com/leolovenet/ipqqwry","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/leolovenet/ipqqwry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leolovenet%2Fipqqwry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leolovenet%2Fipqqwry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leolovenet%2Fipqqwry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leolovenet%2Fipqqwry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leolovenet","download_url":"https://codeload.github.com/leolovenet/ipqqwry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leolovenet%2Fipqqwry/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263426387,"owners_count":23464795,"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":["chunzhen","cli","geoip","golang","ip","qqwry","qqwry-ip-database","tcpdump"],"created_at":"2024-12-14T01:31:56.123Z","updated_at":"2025-07-04T00:34:21.322Z","avatar_url":"https://github.com/leolovenet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003eipqqwry\u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e一个(包含)纯真IP库的单一可执行文件\u003c/h4\u003e\n\n\n## 来源\n\n该工具出自自身需求，写完后，发现已经存在一个同类型的工具 [Nali](https://github.com/zu1k/nali), 本着\"重新造轮子\"的精神，发布了出来。\n\n与 Nali 最大的不同，估计就是只支持纯真IP库，并且为了部署，分发便利，将纯正库直接编译进了可执行文件内，下载相应版本的可执行文件，就可以直接运行使用。\n\n同时，整日面对黑漆漆的终端框，我喜欢丰富的颜色，所以还给工具增加了IPv4、IPv6、MAC 地址颜色高亮的功能。\n\n## 功能\n\n- 单一可执行文件（纯真库已经编译进可执行文件内，也可通过环境变量`IPDB_QQWRY_PATH`指定使用外部纯正库）\n- 纯真 IPv4 离线数据库\n- 支持域名、URL 、IPv4 的直接查询\n- 支持管道处理（管道模式与输入重定向模式下，支持IPv4、IPv6、MAC 地址字符，端口，网卡名等信息的颜色高亮）\n- 查询完全离线\n- 全平台支持（go语言的功劳）\n- 支持 hosts 文件中的自定义信息显示\n\n![pipeline with tcpdump command](./images/with-tcpdump.jpg)\n\n## 安装\n\n### 从源码安装\n\nipqqwry 需要预先安装 Go. 安装后可以从源码安装软件:\n\n```sh\ngo install github.com/leolovenet/ipqqwry@latest\n```\n\n### 下载预编译的可执行程序\n\n可以从Release页面下载预编译好的可执行程序: [Release](https://github.com/leolovenet/ipqqwry/releases)\n\n你需要选择适合你系统和硬件架构的版本下载，解压后可直接运行\n\n## 使用说明\n\n### 直接查询 IP、域名、URL 中 HostName 的归属地信息\n\n```\n$ ipqqwry 1.1.1.1 2.2.2.2 weibo.com https://google.com/ncr\n[\n  {\n    \"ip     \": \"1.1.1.1\",\n    \"country\": \"美国\",\n    \"area   \": \"APNIC\\u0026CloudFlare公共DNS服务器\"\n  },\n  {\n    \"ip     \": \"2.2.2.2\",\n    \"country\": \"法国\",\n    \"area   \": \"Orange\"\n  },\n  {\n    \"domain \": \"weibo.com\",\n    \"ip     \": \"123.125.23.27\",\n    \"country\": \"北京市\",\n    \"area   \": \"亦庄联通数据中心\"\n  },\n  {\n    \"domain \": \"weibo.com\",\n    \"ip     \": \"123.125.22.241\",\n    \"country\": \"北京市\",\n    \"area   \": \"亦庄联通数据中心\"\n  },\n  {\n    \"domain \": \"weibo.com\",\n    \"ip     \": \"123.125.106.66\",\n    \"country\": \"北京市\",\n    \"area   \": \"新浪互联信息服务联通节点\"\n  },\n  {\n    \"domain \": \"weibo.com\",\n    \"ip     \": \"123.125.106.67\",\n    \"country\": \"北京市\",\n    \"area   \": \"新浪互联信息服务联通节点\"\n  },\n  {\n    \"domain \": \"google.com\",\n    \"ip     \": \"59.24.3.174\",\n    \"country\": \"韩国\",\n    \"area   \": \"KT电信\"\n  }\n]\n```\n\n### 或者 使用 `管道模式`\n\n该模式的工作原理，就是对标准输入进行\"逐行扫描\"，然后对发现的IPv4进行归属地查询，并将查询结果附加到IP的后面，再输出到标准输出。如果发现标准输出为终端，则附加上颜色信息（可强制关闭）。\n\n```\n$ echo IP 6.6.6.6 | ipqqwry\nIP 6.6.6.6(美国,亚利桑那州华楚卡堡市美国国防部网络中心)\n\n#或者\n$ ifconfig | ipqqwry\n\n#或者\n$ ip addr show  | ipqqwry\n\n#或者 (注意添加 -l 选项)\n$ tcpdump -lnni any icmp | ipqqwry\n\n```\n\n![pipeline with echo command](./images/with-echo.jpg)\n\n\n![pipeline with ifconfig command](./images/with-ifconfig.jpg)\n\n### 更换数据库\n\n\n```shell\nexport IPDB_QQWRY_PATH=/some/other/qqwry.dat\n\nipqqwry -v\n```\n\n![with other qqwry](./images/with-other-qqwry.jpg)\n\n## 查看帮助\n\n直接运行 ipqqwry 命令，或者 ipqqwry --help\n\n```shell\n$ ipqqwry --help\nUsage:\n  ipqqwry [ip | domain] ...\n  ifconfig | ipqqwry [-p | -C]             Using pipeline, translate the included MAC/IPv4/IPv6 address information.\n                                           The -p option also translates(default not) non-public IPv4 information.\n                                           The -C option suppress color output.\n  ipqqwry \u003c file                           Using Input redirection, translate the included MAC/IPv4/IPv6 address information.\n  ipqqwry [-v | --version | version]       show qqwry version.\n  ipqqwry [-h | --help | help]             show this help.\n```\n\n\n## 测试效果\n```shell\ncat test.log | ipqqwry\n#或\nipqqwry \u003c test.log\n```\n\n## 感谢列表\n- [纯真QQIP离线数据库](http://www.cz88.net/fox/ipdat.shtml)\n- [qqwry mirror](https://qqwry.mirror.noc.one/)\n- [qqwry纯真数据库解析](https://metacpan.org/pod/IP::QQWry)\n- [nali](https://github.com/zu1k/nali)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleolovenet%2Fipqqwry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleolovenet%2Fipqqwry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleolovenet%2Fipqqwry/lists"}