# 使用 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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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
- **版本:** 7.99
- **来源摘要:** Port scanning utility for large networks
- **主页:** <https://nmap.org/>
- **最后更新:** 2026-06-22T14:05:38-07:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

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

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 7.99
## 项目历史与用法

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

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

- 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


## 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
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
