All Projects → zu1k → Nali

zu1k / Nali

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

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Nali

GeoLite2-City
GeoLite2-City.mmdb.gz CDN files based on Free Open Source CDN jsDelivr!
Stars: ✭ 170 (-68.22%)
Mutual labels:  cdn, ip, geoip
Cdn dig
用于在linux 终端快速查询全国 CDN 调度到哪些区域节点的工具
Stars: ✭ 36 (-93.27%)
Mutual labels:  cdn, ip
Country Ip Blocks
CIDR country-level IP data, straight from the Regional Internet Registries, updated hourly.
Stars: ✭ 100 (-81.31%)
Mutual labels:  geoip, ip
Lenz
Console based MAP 🗺 : with lots of features 🤩
Stars: ✭ 51 (-90.47%)
Mutual labels:  cli, ip
Geo
🌎 A Bash utility for easy wan, lan, router, dns, mac address, and geolocation output, with clean stdout for piping
Stars: ✭ 225 (-57.94%)
Mutual labels:  cli, ip
Mirrorbits
Mirrorbits is a geographical download redirector written in Go for distributing files efficiently across a set of mirrors.
Stars: ✭ 365 (-31.78%)
Mutual labels:  cli, cdn
Fly
Deploy app servers close to your users. Package your app as a Docker image, and launch it in 17 cities with one simple CLI.
Stars: ✭ 862 (+61.12%)
Mutual labels:  cli, cdn
tor-ip-changer
request new identity every X seconds interval using TOR client
Stars: ✭ 233 (-56.45%)
Mutual labels:  ip, geoip
GeoLite2-Country
GeoLite2-Country.mmdb.gz CDN files based on Free Open Source CDN jsDelivr!
Stars: ✭ 69 (-87.1%)
Mutual labels:  ip, geoip
express-ip
An Express Middleware for getting IP information
Stars: ✭ 28 (-94.77%)
Mutual labels:  ip, geoip
Information collection handbook
Handbook of information collection for penetration testing and src
Stars: ✭ 447 (-16.45%)
Mutual labels:  cdn, ip
Timewarrior
Timewarrior - Commandline Time Reporting
Stars: ✭ 528 (-1.31%)
Mutual labels:  cli
Mt Aws Glacier
Perl Multithreaded Multipart sync to Amazon Glacier
Stars: ✭ 522 (-2.43%)
Mutual labels:  cli
Jenkins Library
Jenkins shared library for Continuous Delivery pipelines.
Stars: ✭ 521 (-2.62%)
Mutual labels:  cli
Dark Mode
Control the macOS dark mode from the command-line
Stars: ✭ 518 (-3.18%)
Mutual labels:  cli
Zdict
The last online dictionary framework you need. (?)
Stars: ✭ 531 (-0.75%)
Mutual labels:  cli
World Cup 2018 Cli Dashboard
⚽🏆A World Cup 2018 CLI dashboard – Watch matches in your terminal
Stars: ✭ 529 (-1.12%)
Mutual labels:  cli
Whipper
Python CD-DA ripper preferring accuracy over speed
Stars: ✭ 517 (-3.36%)
Mutual labels:  cli
Ramda Cli
🐏 A CLI tool for processing data with functional pipelines
Stars: ✭ 515 (-3.74%)
Mutual labels:  cli
Httpstat
curl statistics made simple
Stars: ✭ 4,991 (+832.9%)
Mutual labels:  cli


Nali

An offline tool for querying IP geographic information and CDN provider.

Github Actions

中文文档

Origin

Inspired by Nali C version and nali-cli js version.

I want to query the IP geographic information and CDN service provider on the terminal, then found the Nali tool. Nali mean 'where' in Chinese, good name for this kind of tools.

However the C version has too few functions, and the js version is too big and the supported platforms are not complete, so I rewrite it in golang, add IPv6 support and Geoip2 database.

Feature

  • Chunzhen qqip database
  • ZX ipv6 database
  • Geoip2 city database
  • IPIP free database
  • Pipeline support
  • Interactive query
  • Offline query
  • Both ipv4 and ipv6 supported
  • CDN provider query
  • Full platform support

Install

Install from source

Nali Requires Go >= 1.14. You can build it from source:

$ go get -u -v github.com/zu1k/nali

Install pre-build binariy

Pre-built binaries are available here: release

Download the binary compatible with your platform, unpack and copy to the directory in path

Install from docker

docker pull docker.pkg.github.com//zu1k/nali/nali:latest

Usage

Query a simple IP address

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

or use pipe

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

Query multiple IP addresses

$ 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 [越南 越南邮电集团公司]

Interactive query

use exit or quit to 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

Use with dig

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

Use with nslookup

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

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

Use with any other program

Because nali can read the contents of the stdin pipeline, it can be used with any program

bash abc.sh | nali

Nali will insert ip information after ip

IPV6 support

Use like 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. 服务器网段]

Query CDN provider

Query CDN provider only

$ nslookup www.gov.cn | nali cdn
Server:         127.0.0.53
Address:        127.0.0.53#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: 185.232.56.148
Name:   zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 185.232.56.147
Name:   zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 2001:428:6402:21b::6
Name:   zgovweb.v.bsgslb.cn [白山云 CDN]
Address: 2001:428:6402:21b::5

Also query IP geo

$ 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)]

Use standalone

You should parse cname by yourself

$ nali cdn cdn.somecdncname.com

Interface

Help

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

Available Commands:
  cdn         Query cdn service provider
  help        Help about any command
  parse       Query IP information
  update      update chunzhen ip database

Flags:
  -h, --help     help for nali
  -t, --toggle   Help message for toggle

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

Update chunzhen IP database

$ nali update
2020/07/17 12:53:46 正在下载最新纯真 IP 库...
2020/07/17 12:54:05 已将最新的纯真 IP 库保存到本地 /root/.nali/qqwry.dat

Use other database

Set environment variables NALI_DB

supported database:

  • Geoip2 ['geoip', 'geoip2', 'geo']
  • Chunzhen ['chunzhen', 'qqip', 'qqwry']
  • IPIP ['ipip', 'ipipfree', 'ipip.net']

Windows

Use geoip db
set NALI_DB=geoip

or use powershell

$env:NALI_DB="geoip"
Use ipip db
set NALI_DB=ipip

or use powershell

$env:NALI_DB="ipip"

Linux

Use geoip db
export NALI_DB=geoip
Use ipip db
export NALI_DB=ipip

Change database directory

If the database directory is not specified, the database will be placed in ~/.nali

Set environment variables NALI_DB_HOME to specify the database directory

set NALI_DB_HOME=D:\nalidb

or

export NALI_DB_HOME=/home/nali

Thanks

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].