Open-source project
zmap/zgrab2 avatar
zmap/zgrab2

ZGrab2: a Go scanner for application-layer handshakes after ZMap

Fast Application Layer Scanner

2,219 stars380 forksGoLicense varies

At a glance

What is it?
ZGrab2 runs protocol modules against targets from stdin and prints JSON results, including detailed handshake transcripts for supported protocols. It is built for large measurement runs, not for credential testing.
Who is it for?
Use ZGrab2 if you run measurement or inventory scans and want structured protocol results and supported handshake transcripts as JSON, especially behind ZMap. Skip it if you want authentication testing, which the project refuses by design.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 35 days ago.
What is it written in?
Mainly Go, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • zmap/zgrab22,219 ★ · +28
Star history
Repository2026-10-082026-11-25
zmap/zgrab22.2k2.2k

28 Stars in the last 48 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

ZGrab2 starts where ZMap stops: it records the whole L7 handshake, not a yes or no

ZMap finds hosts that answer at layer 4. ZGrab2 then opens a real application-layer conversation with each one and writes down the exchange. The README's pitch is that, unlike many other network scanners, it outputs detailed transcripts of network handshakes, for example every message exchanged in a TLS handshake, so the analysis happens offline after the scan.

The quickest way to see the shape of that output is the README's own example, which pipes one hostname into the ntp module:

shell
echo "pool.ntp.org" | zgrab2 ntp

Each target produces one JSON line with the ip, the domain, and a data object keyed by module name. The example result carries a status of success, the port 123 and the NTP version and time. A summary line follows it with the target count, the rate in targets per second and the success percentage.

This is a tool for people who want structured evidence to post-process. If you only need to know whether a port is open, ZMap alone answers that and ZGrab2 adds nothing you need.

Thirty-odd protocol modules, and the module name is the first thing after the binary

ZGrab2 is a modular framework that fully supersedes the older zmap/zgrab repository. The module table in the README runs from AMQP, BACnet and Banner through HTTP, JARM, Modbus, MongoDB, MQTT, MSSQL, MySQL and NTP to SSH, Telnet and TLS. Several of them speak industrial or building-automation protocols: BACnet, DNP3, Fox, Modbus and Siemens.

Selecting one is positional. `./zgrab2 ssh` runs the ssh module, and appending `-h` as in `./zgrab2 [module] -h` prints the module's own options together with the application-wide ones. The order matters in one direction only: module specific options must be included after the module, while application specific options can be given at any time.

The top level of the source tree backs this layout. There is a modules/ directory, a module.go and a module_set.go at the root, and a cmd/ directory that the Dockerfile uses as the build location of the final zgrab2 binary.

Scan input is CSV with four positional fields, and a CIDR block expands to one target per address

Targets arrive from an input file or from stdin, one per line, in the form `IP, DOMAIN, TAG, PORT`. Every line must give an IP, a DOMAIN, or both. With only a domain, the scanner performs a DNS lookup to find the address. With both, it connects to the IP but uses the domain wherever the protocol needs a name, such as the HTTP HOST header and the TLS SNI extension. That distinction is what lets a scan hit a specific address while still presenting the right virtual host.

If the IP field holds a CIDR block, the framework expands it to one target for each address in the block. The README's example is `192.168.0.0/24, , tag`. The TAG field only does anything together with the `--trigger` scanner argument, and PORT overrides the `-p`/`--port` option for that single line. Blank fields are allowed, and trailing blanks can be dropped.

A single-field line is read as a DOMAIN, a rule the README keeps for backwards compatibility. Its working example for the http module is:

shell
echo "en.wikipedia.org" | ./zgrab2 http --max-redirects=1 --endpoint="/wiki/New_York_City"

Running http on 80 and 8080 plus ssh in one pass needs an .ini file and unique names

One command line runs one module. Anything wider goes through the `multiple` module and a configuration file, started with:

shell
./zgrab2 multiple -c multiple.ini

The README's sample file puts input-file and output-file under an `[Application Options]` section, which must be the first section. Below it come module sections such as `[http]` with `port=80` and `endpoint="/"`, a second `[http]` with `port=8080`, and `[ssh]` with `port=22`. Section names must match the module names exactly.

The constraint that bites is the naming. A module's default name is its command name, so the second `[http]` section collides with the first unless each carries a unique `name`, as in `name="http80"` and `name="http8080"`. The README text that follows this part is cut off in the repository material available here, so any further multi-module rules, such as how results are keyed in the output, are not covered by this article.

make builds ./zgrab2, make install puts it on $GOPATH/bin, and the shell often cannot find it

The README recommends building from source and states Go 1.26.0 or later as the requirement. go.mod declares `go 1.26.0` with `toolchain go1.26.8`, and the README names 1.26.8 as the recommended toolchain. The build is:

shell
git clone https://github.com/zmap/zgrab2.git
cd zgrab2
make
./zgrab2 http --help # to see the http module's help message

That leaves a zgrab2 binary in the current directory. For a system-wide copy the README gives `make install; zgrab2 --help`. The common failure is `command not found: zgrab2`, because Go places the binary in `$GOPATH/bin`, which may not be on the PATH. The documented fix is `export PATH=$PATH:$GOPATH/bin` in ~/.bashrc or ~/.zshrc, followed by `source ~/.bashrc # or source ~/.zshrc`.

There is no prebuilt binary download in the README. The Releases page lists v1.0.0 from 4 December 2025 and the release candidates RC3 and RC2 before it, but the README itself tells you to build from source for the latest version.

The Docker image reads targets from stdin, so a config file has to be mounted at /config.ini

The official image is ghcr.io/zmap/zgrab2, and its entrypoint is zgrab2, so the module name follows the image name. A single scan:

shell
echo 'example.com' | docker run --rm -i ghcr.io/zmap/zgrab2 http

The `-i` flag is not optional decoration. Targets are read from stdin, and without an attached stdin the container has nothing to scan. For several modules, the README mounts the config file into the container:

shell
docker run --rm -i -v /path/to/your/config.ini:/config.ini ghcr.io/zmap/zgrab2 multiple -c /config.ini

The Dockerfile shows what is inside. A build stage on golang:${GO_VERSION}-alpine3.23 with GO_VERSION defaulting to 1.26.8 runs `CGO_ENABLED=0 GOOS=linux make all`, and the runtime stage is `alpine:latest`. The runtime stage copies conf/blocklist.conf to /root/.config/zgrab2/blocklist.conf, so the container ships with a blocklist in place. The runtime base is not pinned to a version, which means two builds of the image can differ in their Alpine layer.

The ethics note limits what the modules may do: no credentials, no exploits, handshakes aborted before auth

The README states the boundary in a NOTE block. ZGrab collects only information available to any standard application client without authenticating. Contributions that try to gain access by exploiting vulnerabilities or brute-forcing credentials are refused, and application handshakes are always aborted before authentication is attempted.

For a reader deciding whether to run it, that sets two practical limits. A scan will not tell you whether a service accepts a given password, and it will not show anything behind a login. Both are by design, not gaps. The repository also contains blocklist.go and a ratelimit/ directory, but the README text available does not explain how either is configured, so check the module help with `-h` before pointing a scan at address space you do not own.

The repository has a second, Python side. setup.py publishes a package called zgrab2_schemas, described as ZSchema definitions for zgrab2's JSON output, and requirements.txt lists zschema, requests and a zcrypto_schemas package pinned to a specific git commit. Those are for people who validate or load the JSON output, not for running scans.

Last push on 22 October 2026, v1.0.0 in December 2025, and a license field GitHub could not read

The repository is not archived. The last push to master was on 22 October 2026, and the newest tagged release is v1.0.0 from 4 December 2025, which followed v1.0.0-RC3 on 1 December and v1.0.0-RC2 on 22 September of that year. A checkout of master can therefore be well ahead of the last tagged version.

GitHub reports the license as NOASSERTION, meaning it could not match the LICENSE file to a known identifier, and the README text available does not state a license. Read the LICENSE file in the repository before using it inside a product.

The README's guide for running it with ZMap lives in a separate document, Getting Started with ZMap and ZGrab2, linked from the TIP box at the top. The README also states no benchmark or hardware requirement, so the speed implied by its name is a claim you have to measure on your own network.

Editorial conclusion

Use ZGrab2 if you run measurement or inventory scans and want structured protocol results and supported handshake transcripts as JSON, especially behind ZMap. Skip it if you want authentication testing, which the project refuses by design. Before a first run, check the LICENSE file, because GitHub could not identify one, and confirm the scan range is yours to probe.

Frequently asked questions

What is a ZGrab scanner?

ZGrab is a fast, modular application-layer network scanner designed for completing large Internet-wide surveys. It outputs detailed transcripts of network handshakes for offline analysis.

How do I use ZMap with ZGrab2 to scan my network?

ZMap identifies L4 responsive hosts and ZGrab performs in-depth follow-up L7 handshakes. The README links a Getting Started with ZMap and ZGrab2 guide for building a measurement pipeline.

What are the key differences between ZMap and Nmap, and where does ZGrab2 fit?

The README does not compare ZMap with Nmap. It says ZMap identifies L4 responsive hosts, while ZGrab2 performs the follow-up L7 handshakes and writes transcripts for offline analysis.

Official sources

  1. Issues
  2. README
  3. Releases
  4. zmap/zgrab2 on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/zmap-zgrab2.svg)](https://hysenlabs.com/projects/zmap-zgrab2)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/zmap-zgrab2.svg)](https://hysenlabs.com/projects/zmap-zgrab2)

Was this useful?