# 使用 Homebrew, apk, chocolatey, apt, dnf, MacPorts, Nix, pacman, scoop, winget 安装 nmap

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

## 安装

```sh
sudo av install brew:nmap
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install nmap
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install nmap
```

  证据: MacPorts ports tree: net/nmap/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add nmap
```

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

- Debian apt (92%):

```sh
sudo apt install nmap
```

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

- dnf (92%):

```sh
sudo dnf install nmap
```

  证据: Fedora Rawhide package metadata: nmap from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#nmap
```

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

- pacman (92%):

```sh
sudo pacman -S nmap
```

  证据: Arch Linux sync databases: nmap from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

### Windows

- Chocolatey (92%):

```sh
choco install nmap
```

  证据: Chocolatey community package catalog: nmap from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','netfx-4.7.1-devpack'

- Scoop (92%):

```sh
scoop install main/nmap
```

  证据: Scoop official bucket manifest trees: bucket/nmap.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id Insecure.Nmap -e
```

  证据: Windows Package Manager source index: Insecure.Nmap from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:nmap
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/nmap>
- **版本:** 7.99
- **来源摘要:** Port scanning utility for large networks
- **主页:** <https://nmap.org/>
- **上游文档:** <https://nmap.org/>
- **许可证:** LicenseRef-Homebrew-cannot-represent
- **源码归档:** <https://nmap.org/dist/nmap-7.99.tar.bz2>
- **最后更新:** 2026-06-22T14:05:38-07:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- ncat (cli)
- ndiff (cli)
- nmap (cli)
- nping (cli)
- ncat (别名)
- ndiff (别名)
- nmap (别名)
- nping (别名)

## 依赖

- liblinear
- libssh2
- lua
- openssl@3
- pcre2
- python@3.14

## 构建依赖

- python-setuptools

## macOS 提供的库

- libpcap

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 7.99
- 管理器更新时间: 2026-06-22
- 本地数据: OK
- 上游仓库: https://nmap.org/
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

Nmap, short for Network Mapper, is one of the defining open-source security and network-discovery tools. Gordon "Fyodor" Lyon released it in Phrack issue 51 on September 1, 1997 as a Linux-only port scanner of about 2,000 lines; it grew into a cross-platform scanner for host discovery, port scanning, version detection, OS detection, scripting, scan comparison, packet generation, and network troubleshooting.

### 项目历史

The official Nmap history highlights rapid early expansion: version 2.00 added OS detection on December 12, 1998; the first GUI appeared in April 1999; Windows support landed in December 2000; Mac OS X support and XML output arrived with Nmap 3.00 on July 31, 2002; and service/version detection was publicly released with Nmap 3.45 on September 16, 2003. The scan engine was rewritten as `ultra_scan` in 2004, raw Ethernet sending appeared in 2005, and the Nmap Scripting Engine arrived in 2006.

### 采用历史

Nmap's adoption is unusually broad for a security tool. The official guide describes millions of users worldwide, recognition by publications such as Linux Journal and InfoWorld, and repeated appearances in films. Its own timeline also notes security-community infrastructure: a public Subversion repository in 2006, Google Summer of Code participation, Zenmap integration, and the 2009 release of Ncat and Ndiff as companion tools.

### 使用方式

Package nerds install Nmap not only for `nmap` itself but for the companion commands Homebrew ships: `ncat`, `ndiff`, and `nping`. Everyday workflows include `nmap -A -T4 host` for an aggressive inventory scan, targeted `-sV` service/version detection, `-O` OS detection, `-sn` ping sweeps, NSE scripts for protocol checks, `ncat` for socket work, and `ndiff` to compare repeated XML scans.

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

Nmap is a canonical example of a CLI package whose upstream is bigger than a single binary: it carries data files, scripts, service probes, OS fingerprints, documentation, and multiple related tools. It is packaged almost everywhere, and Homebrew's API reported 14,039 installs in 30 days, 54,604 in 90 days, and 251,639 in 365 days when checked on July 1, 2026.

### 时间线

- 1997-09-01: first release in Phrack issue 51.
- 1998-12-12: Nmap 2.00 adds OS detection.
- 2000-12-07: first official Windows-capable version.
- 2002-07-31: Nmap 3.00 adds Mac OS X support, XML output, and uptime detection.
- 2003-09-16: service/version detection is publicly released.
- 2006-12-10: Nmap Scripting Engine debuts in Nmap 4.21ALPHA1.
- 2009-01-23: Ncat and Ndiff are added.
- 2026-07-01: Homebrew stable version is 7.99.

### Related projects

- Ncat
- Ndiff
- Nping
- Zenmap
- Npcap
- Nmap Scripting Engine

### 来源

- <https://formulae.brew.sh/api/formula/nmap.json>
- <https://nmap.org/book/history-future.html>
- <https://nmap.org/book/man-author.html>
- <https://nmap.org/book/man.html>
- <https://nmap.org/book/preface.html>
- <https://nmap.org/docs.html>


## 安全说明

network reconnaissance tool.

- **Geiger 风险:** red / 中
- network reconnaissance tool

## 源数据库详情

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

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

- Debian apt - ncat - 7.95+dfsg-3: normalized package name match | Debian stable package indexes: ncat from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | NMAP netcat reimplementation | https://nmap.org/
- Debian apt - ndiff - 7.95+dfsg-3: normalized package name match | Debian stable package indexes: ndiff from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | The Network Mapper - result compare utility | https://nmap.org/
- Debian apt - nmap - 7.95+dfsg-3: normalized package name match | Debian stable package indexes: nmap from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | The Network Mapper | https://nmap.org/
- Debian apt - nmap-common - 7.95+dfsg-3: normalized package name match | Debian stable package indexes: nmap-common from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Architecture independent files for nmap | https://nmap.org/
- Debian apt - zenmap - 7.95+dfsg-3: normalized package name match | Debian stable package indexes: zenmap from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | The Network Mapper Front End | https://nmap.org/
- Nix - nmap: normalized package name match | nixpkgs package indexes: pkgs/by-name/nm/nmap/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - ncat - 7.94+git20230807.3be01efb1+dfsg-3build2: normalized package name match | Ubuntu 24.04 LTS package indexes: ncat from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | NMAP netcat reimplementation | https://nmap.org/
- Ubuntu apt - ndiff - 7.94+git20230807.3be01efb1+dfsg-3build2: normalized package name match | Ubuntu 24.04 LTS package indexes: ndiff from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | The Network Mapper - result compare utility | https://nmap.org/
- Ubuntu apt - nmap - 7.94+git20230807.3be01efb1+dfsg-3build2: normalized package name match | Ubuntu 24.04 LTS package indexes: nmap from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | The Network Mapper | https://nmap.org/
- Ubuntu apt - nmap-common - 7.94+git20230807.3be01efb1+dfsg-3build2: normalized package name match | Ubuntu 24.04 LTS package indexes: nmap-common from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Architecture independent files for nmap | https://nmap.org/
- Ubuntu apt - zenmap - 7.94+git20230807.3be01efb1+dfsg-3build2: normalized package name match | Ubuntu 24.04 LTS package indexes: zenmap from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | The Network Mapper Front End | https://nmap.org/
- apk - nmap - 7.99-r0: normalized package name match | Alpine Linux edge package indexes: nmap from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | network exploration tool and security/port scanner | https://nmap.org
- apk - nmap-doc - 7.99-r0: normalized package name match | Alpine Linux edge package indexes: nmap-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | network exploration tool and security/port scanner (documentation) | https://nmap.org
- apk - nmap-ncat - 7.99-r0: normalized package name match | Alpine Linux edge package indexes: nmap-ncat from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | network exploration tool and security/port scanner (ncat tool) | https://nmap.org
- apk - nmap-nping - 7.99-r0: normalized package name match | Alpine Linux edge package indexes: nmap-nping from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | network exploration tool and security/port scanner (nping tool) | https://nmap.org
- apk - nmap-nselibs - 7.99-r0: normalized package name match | Alpine Linux edge package indexes: nmap-nselibs from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | network exploration tool and security/port scanner (nselibs) | https://nmap.org


## 相关链接

- [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.
- [Security and crypto packages](https://pkg.so/zh-hans/security-crypto-tools/) - Matched security, identity, cryptography, password, signing, or certificate metadata.
- [openssl@3](https://pkg.so/zh-hans/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [python@3.14](https://pkg.so/zh-hans/brew/python-3-14/) - Runtime dependency declared by Homebrew.
- [pcre2](https://pkg.so/zh-hans/brew/pcre2/) - Runtime dependency declared by Homebrew.
- [lua](https://pkg.so/zh-hans/brew/lua/) - Runtime dependency declared by Homebrew.
- [liblinear](https://pkg.so/zh-hans/brew/liblinear/) - Runtime dependency declared by Homebrew.
- [rustscan](https://pkg.so/zh-hans/brew/rustscan/) - Popular package that depends on this formula.
- [nb](https://pkg.so/zh-hans/brew/nb/) - Popular package that depends on this formula.
- [asn](https://pkg.so/zh-hans/brew/asn/) - Popular package that depends on this formula.
- [masscan](https://pkg.so/zh-hans/brew/masscan/) - Shares pkgdb curated category or tags: cli, network-scanning, port-scanner, security.
- [naabu](https://pkg.so/zh-hans/brew/naabu/) - Shares pkgdb curated category or tags: cli, network-scanning, port-scanner, security.
- [sslscan](https://pkg.so/zh-hans/brew/sslscan/) - Shares pkgdb curated category or tags: cli, scanner, security.
- [gosec](https://pkg.so/zh-hans/brew/gosec/) - Shares pkgdb curated category or tags: cli, scanner, security.
- [lynis](https://pkg.so/zh-hans/brew/lynis/) - Shares pkgdb curated category or tags: cli, security, security-audit.
- [bbot](https://pkg.so/zh-hans/brew/bbot/) - Shares pkgdb curated category or tags: cli, scanner, security.
- [ssh-audit](https://pkg.so/zh-hans/brew/ssh-audit/) - Shares pkgdb curated category or tags: cli, security, security-audit.
- [ncrack](https://pkg.so/zh-hans/brew/ncrack/) - Security-sensitive metadata or terminology overlaps. Shared terms: cli, network, openssl, openssl-3, security.

## Combined YAML source

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


## 来源

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