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

Output output from multiple modules in the same output line, similar to Grab #429

Conversation

phillip-stephens
Copy link
Contributor

@phillip-stephens phillip-stephens commented Aug 23, 2024

Description

Since we want the output of a single domain to stay in a single line, changed the output to be more similar to ZGrab and have a map of module_name to result

  • updated output schema to support multiple modules in one result line
  • updated worker_manager to populate the new schema
  • updated integration tests to pass with new schema
  • updated benchmark to collect statuses with new schema
  • updated README to show the new schema in output
$ ./zdns A cloudflare.com google.com
{"name":"google.com","results":{"A":{"data":{"additionals":[{"flags":"","type":"EDNS0","udpsize":512,"version":0}],"answers":[{"answer":"142.250.190.110","class":"IN","name":"google.com","ttl":66,"type":"A"}],"protocol":"udp","resolver":"[2603:6013:9d00:3302::1]:53"},"duration":0.034130208,"status":"NOERROR","timestamp":"2024-08-23T13:04:40-04:00"}}}
{"name":"cloudflare.com","results":{"A":{"data":{"additionals":[{"flags":"","type":"EDNS0","udpsize":512,"version":0}],"answers":[{"answer":"104.16.133.229","class":"IN","name":"cloudflare.com","ttl":96,"type":"A"},{"answer":"104.16.132.229","class":"IN","name":"cloudflare.com","ttl":96,"type":"A"}],"protocol":"udp","resolver":"[2603:6013:9d00:3302::1]:53"},"duration":0.035178542,"status":"NOERROR","timestamp":"2024-08-23T13:04:40-04:00"}}}

Run with multiple modules

; Specify Global Options here
[Application Options]
iterative=true
prefer-ipv6-iteration="true"
; List out modules and their respective module-specific options here. A module can only be listed once
; [ALOOKUP]
; ipv4-lookup = true
; ; You can use default values and just list modules if you don't need to specify any options
[A]
[AAAA]
[CNAME]
$ ./zdns MULTIPLE -c "./src/cli/multiple.ini" google.com | jq -c
{"name":"google.com","results":{"A":{"data":{"answers":[{"answer":"142.250.190.110","class":"IN","name":"google.com","ttl":300,"type":"A"}],"protocol":"udp","resolver":"[2001:4860:4802:34::a]:53"},"duration":0.157805125,"status":"NOERROR","timestamp":"2024-08-23T13:07:39-04:00"},"AAAA":{"data":{"answers":[{"answer":"2607:f8b0:4009:80b::200e","class":"IN","name":"google.com","ttl":300,"type":"AAAA"}],"protocol":"udp","resolver":"[2001:4860:4802:34::a]:53"},"duration":0.120570916,"status":"NOERROR","timestamp":"2024-08-23T13:07:39-04:00"},"CNAME":{"data":{"additionals":[{"flags":"","type":"EDNS0","udpsize":512,"version":0}],"authorities":[{"class":"IN","expire":1800,"mbox":"dns-admin.google.com","min_ttl":60,"name":"google.com","ns":"ns1.google.com","refresh":900,"retry":900,"serial":666268564,"ttl":60,"type":"SOA"}],"protocol":"udp","resolver":"[2001:4860:4802:34::a]:53"},"duration":0.17581025,"status":"NOERROR","timestamp":"2024-08-23T13:07:39-04:00"}}}

@phillip-stephens phillip-stephens marked this pull request as ready for review August 23, 2024 17:14
@phillip-stephens phillip-stephens requested a review from a team as a code owner August 23, 2024 17:14
@zakird zakird merged commit a69ae6c into phillip/dig-domains-and-multi-modules Aug 23, 2024
3 checks passed
zakird pushed a commit that referenced this pull request Aug 23, 2024
…apability (#428)

* added dig-style domain passing integration tests

* added ability to pass domains in after command

* able to parse .ini, used hidden Application Options group

* all global options parsed

* able to parse all module types

* working multi-module

* all tests passing

* prevent using a module multiple times in .ini

* added integration tests

* reset zdns exe in integration tests

* lint

* PR cleanup

* update README and fix URL's to be clickable

* README formatting

* Proofreading README

* provide description for MULTIPLE for --help

* Output output from multiple modules in the same output line, similar to Grab (#429)

* only add 'lookup_module' if we're using multiple modules to save storage space

* collect output

* sort imports

* fixed up integration tests to match new schema

* edit todo

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

Successfully merging this pull request may close these issues.

2 participants