# 使用 Homebrew, apk, apt, Nix 安装 asn

查看 asn 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:asn
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install asn
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add asn
```

  证据: Alpine Linux edge package indexes: asn from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install asn
```

  证据: Debian stable package indexes: asn from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#asn
```

  证据: nixpkgs package indexes: pkgs/by-name/as/asn/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:asn
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/asn>
- **版本:** 0.81.0
- **来源摘要:** Organization lookup and server tool (ASN / IPv4 / IPv6 / Prefix / AS Path)
- **主页:** <https://github.com/nitefood/asn>
- **仓库:** <https://github.com/nitefood/asn>
- **许可证:** MIT
- **源码归档:** <https://github.com/nitefood/asn/archive/refs/tags/v0.81.0.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- asn (cli)
- asn (别名)

## 依赖

- aha
- bash
- coreutils
- grepcidr
- ipcalc
- mtr
- nmap

## macOS 提供的库

- jq
- whois

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 all

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 0.81.0
- 本地数据: OK
- 上游仓库: https://github.com/nitefood/asn
- 检测到的最新版本: v0.81.0 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

asn is a Bash-based network lookup, recon, and traceroute server tool centered on autonomous systems, prefixes, RPKI validity, BGP statistics, geolocation, reputation, and IP/ASN investigation workflows.

### 项目历史

The nitefood/asn repository was created in July 2020. The README describes a single command-line tool that can also run as a web traceroute server and as a JSON-producing lookup API endpoint.

The project grew beyond simple ASN lookup into a collector of network intelligence APIs and command-line workflows. Its README lists Team Cymru, Prefix Whois, PeeringDB, CAIDA ASRank, RIPEStat, RIPE IPmap, Shodan, Cloudflare Radar, GreyNoise, NVD, IPQualityScore, ipinfo.io, and other data providers as supported inputs.

### 采用历史

asn has unusually broad packaging for a shell network tool. The README displays OS support for Debian, Ubuntu, Kali, CentOS, Red Hat, Rocky Linux, Fedora, Arch, Manjaro, Alpine, openSUSE, FreeBSD, Nix, macOS, Windows environments, and Raspberry Pi, and the input package facts list apk, Homebrew, Debian, Nix, and Ubuntu packages.

GitHub metadata shows roughly two thousand stars and active releases through 2026. Homebrew analytics show continuing installs, while the README's Repology badge points at multi-repository packaging status.

### 使用方式

The common workflow is to run `asn` against an IP address, hostname, prefix, AS number, URL, or organization name and inspect enriched network output. The tool can do AS path tracing with mtr, RPKI checks, organization searches, Shodan recon, country CIDR mapping, bulk geolocation, and JSON output for pipelines.

Configuration is deliberately Unix-like: defaults can be overridden with `$HOME/.asnrc`, and optional API tokens are read from `$HOME/.asn/` for user mode or `/etc/asn/` for server mode. Docker and Google Cloud Shell workflows are documented for users who do not want a local install.

### 为什么软件包爱好者会关心

asn is significant because it packages a messy incident-response habit, asking several network-intelligence services about an address or ASN, into a scriptable CLI. For package maintainers, it is also an instructive case: a Bash tool with many external command and API integrations, distro packages, container usage, and optional credential files.

It occupies the same practical shelf as whois, dig, mtr, bgp.tools shortcuts, and OSINT helper scripts, but makes the package-manager version matter because release updates can add or repair upstream data-provider integrations.

### 时间线

- 2020: GitHub repository created.
- 2024: v0.76 and v0.78 releases published.
- 2025: v0.79 and v0.80 releases published.
- 2026: v0.81.0 published and listed by Homebrew as the stable version.

### Related projects

- The README documents integrations with mtr, Team Cymru IP to ASN mapping, Prefix Whois, PeeringDB, CAIDA ASRank, RIPEStat, Cloudflare Radar, Shodan, GreyNoise, ipinfo.io, and other network-data services.

### 来源

- <https://api.github.com/repos/nitefood/asn>
- <https://api.github.com/repos/nitefood/asn/releases>
- <https://formulae.brew.sh/api/formula/asn.json>
- <https://github.com/nitefood/asn#readme>
- source_facts.package-manager


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.asnrc

## Credential files

- Unix: ~/.asn/ipinfo_token, /etc/asn/ipinfo_token, ~/.asn/iqs_token, /etc/asn/iqs_token, ~/.asn/cloudflare_token, /etc/asn/cloudflare_token
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** asn
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## 其他软件包管理器记录

- Debian apt - asn - 0.78.0-1: normalized package name match | Debian stable package indexes: asn from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | network OSINT CLI ASN, RPKI, BGP, Geo, Recon, Trace | https://github.com/nitefood/asn/
- Nix - asn: normalized package name match | nixpkgs package indexes: pkgs/by-name/as/asn/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - asn - 0.75.3-1.1: normalized package name match | Ubuntu 24.04 LTS package indexes: asn from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | network OSINT CLI ASN, RPKI, BGP, Geo, Recon, Trace | https://github.com/nitefood/asn/
- apk - asn - 0.81.0-r0: normalized package name match | Alpine Linux edge package indexes: asn from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | ASN Lookup Tool and Traceroute Server | https://github.com/nitefood/asn/


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [coreutils](https://pkg.so/zh-hans/brew/coreutils/) - Runtime dependency declared by Homebrew.
- [bash](https://pkg.so/zh-hans/brew/bash/) - Runtime dependency declared by Homebrew.
- [nmap](https://pkg.so/zh-hans/brew/nmap/) - Runtime dependency declared by Homebrew.
- [mtr](https://pkg.so/zh-hans/brew/mtr/) - Runtime dependency declared by Homebrew.
- [ipcalc](https://pkg.so/zh-hans/brew/ipcalc/) - Runtime dependency declared by Homebrew.
- [aha](https://pkg.so/zh-hans/brew/aha/) - Runtime dependency declared by Homebrew.
- [grepcidr](https://pkg.so/zh-hans/brew/grepcidr/) - Runtime dependency declared by Homebrew.
- [asnmap](https://pkg.so/zh-hans/brew/asnmap/) - Shares pkgdb curated category or tags: asn, cli, network, networking, osint.
- [ddns-go](https://pkg.so/zh-hans/brew/ddns-go/) - Shares pkgdb curated category or tags: cli, ipv4, ipv6, networking.
- [subnetcalc](https://pkg.so/zh-hans/brew/subnetcalc/) - Shares pkgdb curated category or tags: cli, ipv4, ipv6, networking.
- [sipcalc](https://pkg.so/zh-hans/brew/sipcalc/) - Shares pkgdb curated category or tags: cli, ipv4, ipv6, networking.
- [scamper](https://pkg.so/zh-hans/brew/scamper/) - Shares pkgdb curated category or tags: cli, ipv4, ipv6, networking.
- [netaddr](https://pkg.so/zh-hans/brew/netaddr/) - Shares pkgdb curated category or tags: cli, ipv4, ipv6, networking.
- [rpki-client](https://pkg.so/zh-hans/brew/rpki-client/) - Shares pkgdb curated category or tags: bgp, cli, networking, rpki.
- [ahcpd](https://pkg.so/zh-hans/brew/ahcpd/) - Shares pkgdb curated category or tags: cli, ipv4, ipv6, networking.
- [asroute](https://pkg.so/zh-hans/brew/asroute/) - Local metadata places this package in an adjacent workflow. Shared terms: as, asn, cli, network, networking.

## Combined YAML source

View the package source record on GitHub. [combined/asn.yml](https://github.com/mxcl/pkgdb/blob/main/combined/asn.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
