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

Adjust multiple DNS related things #18971

Merged
4 commits merged into from
Mar 19, 2024
Merged

Conversation

zeroSteiner
Copy link
Contributor

@zeroSteiner zeroSteiner commented Mar 19, 2024

  • Documentation changes
    • Updated docs to add missing examples for the black hole resolver
    • Add examples for static entries
    • Fix a reference that was spelled blackhole to be black-hole
  • Add spell checking and suggestions in the error message for incorrectly spelled resolver names
  • Update the static entry table output to be visually consistent with the rules when multi-value entries are present

Testing

  • Read the documentation changes, ensure they make sense
  • Print the static entries table, see that it still works is sorted and displays multiple IPs of the same family on new lines
  • Run the command dns add blackhole and see a helpful suggestion

Demo the static entries table updates by adding multiple IPv4 addresses and printing the table. See that localhost exists on its own line with the IP addresses beneath it.

dns add-static localhost 127.0.0.1 127.1.1.1 127.2.2.2
dns

@bwatters-r7 bwatters-r7 self-assigned this Mar 19, 2024
Keep the first line blank for consistency with rules and sort hostnames
and addresses.
@bwatters-r7
Copy link
Contributor

[*] Starting persistent handler(s)...
msf6 > dns print
Default search domain: N/A
Default search list:   N/A
Current cache size:    0

Resolver rule entries
=====================

   #  Rule   Resolver    Comm channel
   -  ----   --------    ------------
   1  *
   .    \_   static      N/A
   .    \_   127.0.0.53


Static hostnames
================

   Hostname         IPv4 Address  IPv6 Address
   --------         ------------  ------------
   ip6-allnodes                   ff02::1
   ip6-allrouters                 ff02::2
   ip6-localhost                  ::1
   ip6-localnet                   fe00::
   ip6-loopback                   ::1
   ip6-mcastprefix                ff00::
   localhost        127.0.0.1
   ubuntu           127.0.1.1


msf6 > dns add-static localhost 127.0.0.1 127.1.1.1 127.2.2.2
[*] Added static hostname mapping localhost to 127.0.0.1
[*] Added static hostname mapping localhost to 127.1.1.1
[*] Added static hostname mapping localhost to 127.2.2.2
msf6 > dns print
Default search domain: N/A
Default search list:   N/A
Current cache size:    0

Resolver rule entries
=====================

   #  Rule   Resolver    Comm channel
   -  ----   --------    ------------
   1  *
   .    \_   static      N/A
   .    \_   127.0.0.53


Static hostnames
================

   Hostname         IPv4 Address  IPv6 Address
   --------         ------------  ------------
   ip6-allnodes                   ff02::1
   ip6-allrouters                 ff02::2
   ip6-localhost                  ::1
   ip6-localnet                   fe00::
   ip6-loopback                   ::1
   ip6-mcastprefix                ff00::
   localhost
     \_             127.0.0.1
     \_             127.1.1.1
     \_             127.2.2.2
   ubuntu           127.0.1.1

msf6 > dns add blackhole
[-] Invalid DNS resolver: blackhole. Did you mean black-hole?
msf6 > 

@bwatters-r7 bwatters-r7 closed this pull request by merging all changes into rapid7:master in 1e47b33 Mar 19, 2024
@bwatters-r7
Copy link
Contributor

Release Notes

This PR updates the documents related to DNS features, adds spell-checking and suggestions for input, and updates the layout for command output.

@smcintyre-r7 smcintyre-r7 added the rn-enhancement release notes enhancement label Mar 19, 2024
@adfoster-r7
Copy link
Contributor

Looks like this doesn't fix the help menu:

msf6 auxiliary(scanner/mysql/mysql_hashdump) > dns help add
USAGE:
  dns [add] [--index <insertion index>] [--rule <wildcard DNS entry>] [--session <session id>] <resolver> ...

OPTIONS:

    -i, --index     Index to insert at
    -r, --rule      Set a DNS wildcard entry to match against
    -s, --session   Force the DNS request to occur over a particular channel (override routing rules)

RESOLVERS:
  ipv4 / ipv6 address - The IP address of an upstream DNS server to resolve from
  blackhole           - Drop all queries
  static              - Reply with statically configured addresses (only for A/AAAA records)
  system              - Use the host operating systems DNS resolution functionality (only for A/AAAA records)

It still references 'blackhole' instead of of the config value that will work: black-hole

msf6 auxiliary(scanner/mysql/mysql_hashdump) > dns add --rule honeypot.lab.lan --index 2 blackhole
[-] Invalid DNS resolver: blackhole. Did you mean black-hole?

@zeroSteiner
Copy link
Contributor Author

@adfoster-r7 I opened #18974 to address that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-enhancement release notes enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants