Skip to content

Add option to change "recursion desired" bit in DNS probe module#764

Merged
phillip-stephens merged 6 commits intozmap:mainfrom
gutjuri:add-dns-rd
Jan 26, 2024
Merged

Add option to change "recursion desired" bit in DNS probe module#764
phillip-stephens merged 6 commits intozmap:mainfrom
gutjuri:add-dns-rd

Conversation

@gutjuri
Copy link
Contributor

@gutjuri gutjuri commented Jan 19, 2024

The DNS probe module now additionally supports options strings like A:rn,google.com. The rn has the effect that the "recursion desired" bit will be unset in the respective DNS query packet. If :rn is omitted, the behaviour is not changed (compared to before this update). Therefore, the change maintains backward-compatibility.

Examples of supported behaviours:

  • --probe-args="A,google.com": rd-bit set to 1
  • --probe-args="A:rn,google.com": rd-bit set to 0
  • --probe-args="A,google.com;A:rn,example.org": rd-bit in the query for google.com set to 1, and in the query to example.org set to 0.

I have tested these behaviours using the above examples with wireshark.

closes #763

ToDo

  • Update Documentation (where?)

@zakird
Copy link
Member

zakird commented Jan 19, 2024

Thanks for putting this together. In terms of help text, it would be best to update the blurb in the probe module registration, which is where we store documentation specific to a given probe module.

This blurb:

    .helptext =
	"This module sends out DNS queries and parses basic responses. "
	"By default, the module will perform an A record lookup for "
	"google.com. You can specify other queries using the --probe-args "
	"argument in the form: 'type,query', e.g. 'A,google.com'. The module "
	"supports sending the the following types: of queries: A, NS, CNAME, SOA, "
	"PTR, MX, TXT, AAAA, RRSIG, and ALL. The module will accept and attempt "
	"to parse all DNS responses. There is currently support for parsing out "
	"full data from A, NS, CNAME, MX, TXT, and AAAA. Any other types will be "
	"output in raw form."

@zakird
Copy link
Member

zakird commented Jan 22, 2024

@phillip-stephens This looks good to me overall. Once we have documentation included in the PR, can you get merged?

@gutjuri gutjuri marked this pull request as ready for review January 22, 2024 11:10
@gutjuri
Copy link
Contributor Author

gutjuri commented Jan 22, 2024

I have updated the documentation and marked the PR as ready to review. Please let me know of there is anything I can do to improve the proposed code changes. Thank you for your time!

Copy link
Contributor

@phillip-stephens phillip-stephens left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @gutjuri !!!

@phillip-stephens phillip-stephens self-requested a review January 26, 2024 19:35
@phillip-stephens phillip-stephens dismissed their stale review January 26, 2024 19:36

Didn't notice the 0xFF bit, have 1 question about it before we merge.

Copy link
Contributor

@phillip-stephens phillip-stephens left a comment

Choose a reason for hiding this comment

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

LGTM, thanks again

@phillip-stephens phillip-stephens merged commit aea444b into zmap:main Jan 26, 2024
@gutjuri gutjuri deleted the add-dns-rd branch January 28, 2024 17:05
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.

DNS probe module: let user set recursion desired bit

3 participants