Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
nali — An offline tool for querying IP geographic information and CDN provider. 一个查询IP地理信息和CDN服务提供商的离线终端工具. | Kitploit
工具/GitHubGitHub/zu1k/nali
OSINT (Open Source Intelligence)Network MappingInformation GatheringDNS Analysis
GitHubzu1k/nali

nali

An offline tool for querying IP geographic information and CDN provider. 一个查询IP地理信息和CDN服务提供商的离线终端工具.

查看仓库
4.1k3714020天前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享


Nali

一个查询IP地理信息和CDN提供商的离线终端工具.

Github Actions

English

功能

  • 支持多种数据库
    • 纯真 IPv4 离线数据库
    • ZX IPv6 离线数据库
    • ip2region IPv4 / IPv6 数据库 (可选)
    • IPinfo Lite 数据库 (可选)
    • Geoip2 城市数据库 (可选)
    • IPIP 数据库 (可选)
    • DB-IP 数据库 (可选)
    • IP2Location DB3 LITE 数据库 (可选)
  • CDN 服务提供商查询
  • 支持管道处理
  • 支持交互式查询
  • 同时支持IPv4和IPv6
  • 支持多语言
  • 查询完全离线
  • 全平台支持
  • 支持彩色输出

安装

从源码安装

Nali 需要预先安装 Go >= 1.26. 安装后可以从源码安装软件:

$ go install github.com/zu1k/nali@latest

下载预编译的可执行程序

可以从Release页面下载预编译好的可执行程序: Release

你需要选择适合你系统和硬件架构的版本下载,解压后可直接运行

Arch 系 Linux

我们在 Aur 中发布了 3 个相关的包:

  • nali-go: Release 版本,安装时编译
  • nali-go-bin: Release 版本,预编译的二进制文件
  • nali-go-git: 最新的 master 分支版本,安装时编译

Debian / Ubuntu

从 Release 页面下载对应架构(amd64、i386、armhf、arm64)的 .deb 包后安装:

$ sudo apt install ./nali_*_amd64.deb

使用说明

查询一个IP的地理信息

$ nali 1.2.3.4
1.2.3.4 [澳大利亚 APNIC Debogon-prefix网络]

或者 使用 管道

$ echo IP 6.6.6.6 | nali
IP 6.6.6.6 [美国 亚利桑那州华楚卡堡市美国国防部网络中心]

同时查询多个IP的地理信息

$ nali 1.2.3.4 4.3.2.1 123.23.3.0
1.2.3.4 [澳大利亚 APNIC Debogon-prefix网络]
4.3.2.1 [美国 新泽西州纽瓦克市Level3Communications]
123.23.3.0 [越南 越南邮电集团公司]

交互式查询

使用 exit 或 quit 退出查询

$ nali
123.23.23.23
123.23.23.23 [越南 越南邮电集团公司]
1.0.0.1
1.0.0.1 [美国 APNIC&CloudFlare公共DNS服务器]
8.8.8.8
8.8.8.8 [美国 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器]
quit

与 dig 命令配合使用

需要你系统中已经安装好 dig 程序

$ dig nali.zu1k.com +short | nali
104.28.2.115 [美国 CloudFlare公司CDN节点]
104.28.3.115 [美国 CloudFlare公司CDN节点]
172.67.135.48 [美国 CloudFlare节点]

与 nslookup 命令配合使用

需要你系统中已经安装好 nslookup 程序

$ nslookup nali.zu1k.com 8.8.8.8 | nali
Server:         8.8.8.8 [美国 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器]
Address:        8.8.8.8 [美国 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器]#53

Non-authoritative answer:
Name:   nali.zu1k.com
Address: 104.28.3.115 [美国 CloudFlare公司CDN节点]
Name:   nali.zu1k.com
Address: 104.28.2.115 [美国 CloudFlare公司CDN节点]
Name:   nali.zu1k.com
Address: 172.67.135.48 [美国 CloudFlare节点]

与任意程序配合使用

因为 nali 支持管道处理,所以可以和任意程序配合使用

bash abc.sh | nali

Nali 将在 IP后面插入IP地理信息,CDN域名后面插入CDN服务提供商信息

支持IPv6

和 IPv4 用法完全相同

$ nslookup google.com | nali
Server:         127.0.0.53 [局域网 IP]
Address:        127.0.0.53 [局域网 IP]#53

Non-authoritative answer:
Name:   google.com
Address: 216.58.211.110 [美国 Google全球边缘网络]
Name:   google.com
Address: 2a00:1450:400e:809::200e [荷兰Amsterdam Google Inc. 服务器网段]

查询 CDN 服务提供商

因为 CDN 服务通常使用 CNAME 的域名解析方式,所以推荐与 nslookup 或者 dig 配合使用,在已经知道 CNAME 后可单独使用

$ nslookup www.gov.cn | nali
Server:         127.0.0.53 [局域网 IP]
Address:        127.0.0.53 [局域网 IP]#53

Non-authoritative answer:
www.gov.cn      canonical name = www.gov.cn.bsgslb.cn [白山云 CDN].
www.gov.cn.bsgslb.cn [白山云 CDN]       canonical name = zgovweb.v.bsgslb.cn [白山云 CDN].
Name:   zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 103.104.170.25 [新加坡 ]
Name:   zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 2001:428:6402:21b::5 [美国Louisiana州Monroe Qwest Communications Company, LLC (CenturyLink)]
Name:   zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 2001:428:6402:21b::6 [美国Louisiana州Monroe Qwest Communications Company, LLC (CenturyLink)]

用户交互

程序第一次运行后,会在 config 目录生成配置文件 config.yaml (使用 nali info 来查看具体信息),配置文件定义了数据库信息,默认用户无需进行修改

数据库格式默认如下:

- name: geoip
  name-alias:
  - geolite
  - geolite2
  format: mmdb
  file: GeoLite2-City.mmdb
  languages:
  - ALL
  types:
  - IPv4
  - IPv6

其中,languages 和 types 表示该数据库支持的语言和查询类型。 如果你需要增加数据库,需小心修改配置文件,如果有任何问题,欢迎提 issue 询问。

旧版本生成的配置文件无需修改:配置文件中找不到的数据库会使用内置的默认定义。

数据库一览

数据库名称 / 别名查询类型默认文件自动下载
纯真 IPv4qqwry, chunzhenIPv4(默认)qqwry.dat✓
ZX IPv6zxipv6wry, zxipv6, zxIPv6(默认)zxipv6wry.db✓
ip2region IPv4ip2region, i2rIPv4ip2region.xdb✓
ip2region IPv6ip2region-ipv6, i2r-ipv6IPv6ip2region_v6.xdb✓
IPinfo LiteipinfoIPv4、IPv6ipinfo_lite.mmdb✓
GeoIP2 / GeoLite2 Citygeoip, geoip2, geolite, geolite2IPv4、IPv6GeoLite2-City.mmdb需手动下载
DB-IPdbip, db-ipIPv4、IPv6dbip.mmdb需手动下载
IPIPipipIPv4、IPv6ipipfree.ipdb需手动下载
IP2Location DB3 LITEip2locationIPv4、IPv6IP2LOCATION-LITE-DB3.IPV6.BIN需手动下载
CDNcdn域名(默认)cdn.yml✓

支持自动下载的数据库在首次使用、本地文件不存在时会自动下载;需手动下载的数据库请将文件放入 nali info 显示的数据目录,或在配置文件中用绝对路径指定 file。

使用 IPinfo Lite

IPinfo Lite 提供免费的国家和 ASN 数据,同时支持 IPv4 和 IPv6,首次使用时自动下载:

$ NALI_DB_IP4=ipinfo NALI_DB_IP6=ipinfo nali 8.8.8.8 2001:4860:4860::8888
8.8.8.8 [United States AS15169 Google LLC]
2001:4860:4860::8888 [United States AS15169 Google LLC]

$ NALI_DB_IP4=ipinfo nali --json 8.8.8.8
{"type":0,"ip":"8.8.8.8","text":"United States AS15169 Google LLC","source":"ipinfo","info":{"network":"8.8.8.0/24","country":"United States","country_code":"US","continent":"North America","continent_code":"NA","asn":"AS15169","as_name":"Google LLC","as_domain":"google.com"}}

长期使用可在配置文件中将 selected.ipv4、selected.ipv6 设为 ipinfo。

文本输出包含国家、ASN 和 AS 名称;JSON 输出包含 network、country、country_code、continent、continent_code、asn、as_name、as_domain。数据库记录未提供 network 字段时,使用命中的 CIDR 网段。名称为数据库中的英文原文。

format 为 mmdb 的数据库会根据元数据自动识别是否为 IPinfo 格式,因此也可以使用登录 IPinfo 后下载的 ipinfo_lite.mmdb。默认下载地址是社区维护的镜像 NetworkCats/IPinfoLite-Download,可以在配置文件中通过 download-urls 改为其他地址:

- name: ipinfo
  format: mmdb
  file: ipinfo_lite.mmdb
  download-urls:
  - https://github.com/NetworkCats/IPinfoLite-Download/releases/latest/download/ipinfo_lite.mmdb
  languages: [en]
  types: [IPv4, IPv6]

IPinfo Lite 数据以 CC BY-SA 4.0 许可发布,公开使用其数据时请注明来源 IPinfo。

使用 ip2region IPv6

ip2region 分为 IPv4(ip2region)和 IPv6(ip2region-ipv6)两个数据库文件,首次使用时自动下载:

$ NALI_DB_IP4=ip2region NALI_DB_IP6=ip2region-ipv6 nali 223.5.5.5 240e::1
223.5.5.5 [中国|浙江省|杭州市|阿里|CN]
240e::1 [中国|北京市|北京市|电信|CN]

旧版本的 ip2region.xdb 文件仍可直接使用;配置文件中失效的旧下载地址会在启动时自动迁移到 ip2region_v4.xdb。

查看帮助

$ nali --help
Usage:
  nali [flags]
  nali [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  info        get the necessary information of nali
  update      update ip databases and cdn, update nali to latest version if -v

Flags:
      --color string   Colorize output: auto, always or never (NO_COLOR is honored in auto mode) (default "auto")
      --gbk            Decode input as GBK (detected automatically on Chinese Windows)
  -h, --help           help for nali
  -j, --json           Output in JSON format
  -v, --version        version for nali

Use "nali [command] --help" for more information about a command.

更新数据库

不带参数时更新纯真、ZX IPv6、ip2region (IPv4) 和 CDN 数据库。体积较大的可选数据库 ip2region-ipv6(约 37 MB)和 ipinfo(约 24 MB)只在被选用(配置文件的 selected 或 NALI_DB_* 环境变量)或本地已存在时才会更新。

下载工具