Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print per-second summary statistics detailing a scan, similar to ZMap #473

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

phillip-stephens
Copy link
Contributor

@phillip-stephens phillip-stephens commented Nov 11, 2024

Closes #472

Adds a per-second summary with the following:

  • h/min/sec printout
  • # of domains scanned
  • domains/second
  • success rate of domain resolution
  • Occurrence of the different status codes, sorted greatest to least

A final summary is printed on scan completion

This is printed to stderr by default.

Two new CLI flags are available to modify this behavior:

  -q, --quiet                  do not print status updates
  -u, --status-updates-file=   file to write scan progress to, defaults to stderr (default: -)

Demo

$ cat status
00h:00m:01s; 67 domains scanned; 66.99 domains/sec.; 100.0% success rate; NOERROR: 67
00h:00m:02s; 91 domains scanned; 45.49 domains/sec.; 100.0% success rate; NOERROR: 91
00h:00m:03s; 96 domains scanned; 32.00 domains/sec.; 100.0% success rate; NOERROR: 96
00h:00m:04s; 97 domains scanned; 24.24 domains/sec.; 100.0% success rate; NOERROR: 97
00h:00m:05s; 98 domains scanned; 19.60 domains/sec.; 100.0% success rate; NOERROR: 98
00h:00m:06s; 98 domains scanned; 16.33 domains/sec.; 100.0% success rate; NOERROR: 98
00h:00m:07s; 98 domains scanned; 14.00 domains/sec.; 100.0% success rate; NOERROR: 98
00h:00m:08s; 98 domains scanned; 12.25 domains/sec.; 100.0% success rate; NOERROR: 98
00h:00m:09s; 99 domains scanned; 11.00 domains/sec.; 99.0% success rate; NOERROR: 98, ITERATIVE_TIMEOUT: 1
00h:00m:10s; 99 domains scanned; 9.90 domains/sec.; 99.0% success rate; NOERROR: 98, ITERATIVE_TIMEOUT: 1
00h:00m:11s; 99 domains scanned; 9.00 domains/sec.; 99.0% success rate; NOERROR: 98, ITERATIVE_TIMEOUT: 1
00h:00m:12s; 99 domains scanned; 8.25 domains/sec.; 99.0% success rate; NOERROR: 98, ITERATIVE_TIMEOUT: 1
00h:00m:13s; 100 domains scanned; 7.69 domains/sec.; 99.0% success rate; NOERROR: 99, ITERATIVE_TIMEOUT: 1
00h:00m:13s; Scan Complete, no more input. 100 domains scanned; 7.18 domains/sec.; 99.0% success rate; NOERROR: 99, ITERATIVE_TIMEOUT: 1

Copy link
Member

@zakird zakird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's OK to make this not disable'able or not redirectable. I also don't think that it's OK to put these on stdout since it precludes piping ZDNS into another program. These should be able to be turned on and off and should be printed to stderr or a file.

The most useful thing in ZMap to make sure a scan looks good is hitrate, which you can't actually quite get here. Can we get the same thing here. When calculating hitrate I would include both NOERROR and NXDOMAIN because both are a successful response from the DNS server.

@phillip-stephens
Copy link
Contributor Author

Yep all seems reasonable! Will make those changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Periodically log statistics
2 participants